Skip to content

Commit 5ddb466

Browse files
authored
Merge branch 'master' into separation
2 parents 84ea1ee + 49c9359 commit 5ddb466

7,404 files changed

Lines changed: 114354 additions & 51845 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/build.in.yml

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
lint-outcome: ${{ steps.lint.outcome }}
3939
mk_all-outcome: ${{ steps.mk_all.outcome }}
4040
noisy-outcome: ${{ steps.noisy.outcome }}
41-
shake-outcome: ${{ steps.shake.outcome }}
41+
# shake-outcome: ${{ steps.shake.outcome }}
4242
test-outcome: ${{ steps.test.outcome }}
4343
defaults: # On Hoskinson runners, landrun is already installed.
4444
run: # note that .pr-branch/.lake must be created in a step below before we use this
@@ -223,7 +223,7 @@ jobs:
223223
224224
# Extract all inputRevs from the manifest
225225
invalid_revs=$(jq -r '.packages[].inputRev // empty' lake-manifest.json | \
226-
grep -v -E '^(main|master|v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?)$' || true)
226+
grep -v -E '^(main|master|v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?)$' || true)
227227
228228
if [ -n "$invalid_revs" ]; then
229229
echo "❌ Error: Found invalid inputRevs in lake-manifest.json:"
@@ -232,12 +232,57 @@ jobs:
232232
echo "All inputRevs must be one of:"
233233
echo " - 'main'"
234234
echo " - 'master'"
235-
echo " - 'vX.Y.Z' (semantic version, e.g., v1.2.3 or v1.2.3-pre)"
235+
echo " - 'vX.Y.Z' (semantic version, e.g., v1.2.3, v1.2.3-pre, or v1.2.3+build)"
236236
exit 1
237237
else
238238
echo "✅ All inputRevs in lake-manifest.json are valid"
239239
fi
240240
241+
- name: verify ProofWidgets lean-toolchain matches on versioned releases
242+
# Only enforce this on the main mathlib4 repository, not on nightly-testing
243+
if: github.repository == 'leanprover-community/mathlib4'
244+
shell: bash
245+
run: |
246+
cd pr-branch
247+
248+
# Read the lean-toolchain file
249+
TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]')
250+
echo "Lean toolchain: $TOOLCHAIN"
251+
252+
# Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1)
253+
if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
254+
echo "✓ Detected versioned Lean release: $TOOLCHAIN"
255+
echo "Verifying ProofWidgets lean-toolchain matches..."
256+
257+
# Check if ProofWidgets lean-toolchain exists
258+
if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then
259+
echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist"
260+
echo "This file should be created by 'lake env' during dependency download."
261+
exit 1
262+
fi
263+
264+
# Read ProofWidgets lean-toolchain
265+
PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]')
266+
echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN"
267+
268+
# Compare the two
269+
if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then
270+
echo "❌ Error: Lean toolchain mismatch!"
271+
echo " Main lean-toolchain: $TOOLCHAIN"
272+
echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN"
273+
echo ""
274+
echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z),"
275+
echo "the ProofWidgets dependency must use the same toolchain."
276+
echo "Please update the ProofWidgets dependency to use $TOOLCHAIN"
277+
exit 1
278+
else
279+
echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN"
280+
fi
281+
else
282+
echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)"
283+
echo "Skipping ProofWidgets toolchain verification."
284+
fi
285+
241286
- name: get cache (1/3 - setup and initial fetch)
242287
id: get_cache_part1_setup
243288
shell: bash # only runs `cache get` from `master-branch`, so doesn't need to be inside landrun
@@ -412,7 +457,7 @@ jobs:
412457
MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }}
413458

414459
- name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean
415-
if: always()
460+
if: ${{ always() && steps.mk_all.outcome != 'skipped' }}
416461
run: |
417462
if [[ "${{ steps.mk_all.outcome }}" != "success" ]]; then
418463
echo "Please run 'lake exe mk_all' to regenerate the import all files"
@@ -443,11 +488,13 @@ jobs:
443488
action: add # In order to be able to run a multiline script, we need to add/remove the problem matcher before and after.
444489
linters: gcc
445490

446-
- name: check for unused imports
447-
id: shake
448-
run: |
449-
cd pr-branch
450-
env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
491+
# With the arrival of the module system, the old `shake` is no longer functional.
492+
# This will be replaced soon.
493+
# - name: check for unused imports
494+
# id: shake
495+
# run: |
496+
# cd pr-branch
497+
# env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
451498

452499
- name: lint mathlib
453500
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}

.github/workflows/bors.yml

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
lint-outcome: ${{ steps.lint.outcome }}
4949
mk_all-outcome: ${{ steps.mk_all.outcome }}
5050
noisy-outcome: ${{ steps.noisy.outcome }}
51-
shake-outcome: ${{ steps.shake.outcome }}
51+
# shake-outcome: ${{ steps.shake.outcome }}
5252
test-outcome: ${{ steps.test.outcome }}
5353
defaults: # On Hoskinson runners, landrun is already installed.
5454
run: # note that .pr-branch/.lake must be created in a step below before we use this
@@ -233,7 +233,7 @@ jobs:
233233
234234
# Extract all inputRevs from the manifest
235235
invalid_revs=$(jq -r '.packages[].inputRev // empty' lake-manifest.json | \
236-
grep -v -E '^(main|master|v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?)$' || true)
236+
grep -v -E '^(main|master|v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?)$' || true)
237237
238238
if [ -n "$invalid_revs" ]; then
239239
echo "❌ Error: Found invalid inputRevs in lake-manifest.json:"
@@ -242,12 +242,57 @@ jobs:
242242
echo "All inputRevs must be one of:"
243243
echo " - 'main'"
244244
echo " - 'master'"
245-
echo " - 'vX.Y.Z' (semantic version, e.g., v1.2.3 or v1.2.3-pre)"
245+
echo " - 'vX.Y.Z' (semantic version, e.g., v1.2.3, v1.2.3-pre, or v1.2.3+build)"
246246
exit 1
247247
else
248248
echo "✅ All inputRevs in lake-manifest.json are valid"
249249
fi
250250
251+
- name: verify ProofWidgets lean-toolchain matches on versioned releases
252+
# Only enforce this on the main mathlib4 repository, not on nightly-testing
253+
if: github.repository == 'leanprover-community/mathlib4'
254+
shell: bash
255+
run: |
256+
cd pr-branch
257+
258+
# Read the lean-toolchain file
259+
TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]')
260+
echo "Lean toolchain: $TOOLCHAIN"
261+
262+
# Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1)
263+
if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
264+
echo "✓ Detected versioned Lean release: $TOOLCHAIN"
265+
echo "Verifying ProofWidgets lean-toolchain matches..."
266+
267+
# Check if ProofWidgets lean-toolchain exists
268+
if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then
269+
echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist"
270+
echo "This file should be created by 'lake env' during dependency download."
271+
exit 1
272+
fi
273+
274+
# Read ProofWidgets lean-toolchain
275+
PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]')
276+
echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN"
277+
278+
# Compare the two
279+
if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then
280+
echo "❌ Error: Lean toolchain mismatch!"
281+
echo " Main lean-toolchain: $TOOLCHAIN"
282+
echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN"
283+
echo ""
284+
echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z),"
285+
echo "the ProofWidgets dependency must use the same toolchain."
286+
echo "Please update the ProofWidgets dependency to use $TOOLCHAIN"
287+
exit 1
288+
else
289+
echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN"
290+
fi
291+
else
292+
echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)"
293+
echo "Skipping ProofWidgets toolchain verification."
294+
fi
295+
251296
- name: get cache (1/3 - setup and initial fetch)
252297
id: get_cache_part1_setup
253298
shell: bash # only runs `cache get` from `master-branch`, so doesn't need to be inside landrun
@@ -422,7 +467,7 @@ jobs:
422467
MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }}
423468

424469
- name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean
425-
if: always()
470+
if: ${{ always() && steps.mk_all.outcome != 'skipped' }}
426471
run: |
427472
if [[ "${{ steps.mk_all.outcome }}" != "success" ]]; then
428473
echo "Please run 'lake exe mk_all' to regenerate the import all files"
@@ -453,11 +498,13 @@ jobs:
453498
action: add # In order to be able to run a multiline script, we need to add/remove the problem matcher before and after.
454499
linters: gcc
455500

456-
- name: check for unused imports
457-
id: shake
458-
run: |
459-
cd pr-branch
460-
env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
501+
# With the arrival of the module system, the old `shake` is no longer functional.
502+
# This will be replaced soon.
503+
# - name: check for unused imports
504+
# id: shake
505+
# run: |
506+
# cd pr-branch
507+
# env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
461508

462509
- name: lint mathlib
463510
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}

.github/workflows/build.yml

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ on:
1414
- 'staging.tmp*'
1515
- 'trying.tmp*'
1616
- 'staging*.tmp'
17-
- 'nolints'
1817
# ignore staging branch used by bors, this is handled by bors.yml
1918
- 'staging'
2019
merge_group:
@@ -55,7 +54,7 @@ jobs:
5554
lint-outcome: ${{ steps.lint.outcome }}
5655
mk_all-outcome: ${{ steps.mk_all.outcome }}
5756
noisy-outcome: ${{ steps.noisy.outcome }}
58-
shake-outcome: ${{ steps.shake.outcome }}
57+
# shake-outcome: ${{ steps.shake.outcome }}
5958
test-outcome: ${{ steps.test.outcome }}
6059
defaults: # On Hoskinson runners, landrun is already installed.
6160
run: # note that .pr-branch/.lake must be created in a step below before we use this
@@ -240,7 +239,7 @@ jobs:
240239
241240
# Extract all inputRevs from the manifest
242241
invalid_revs=$(jq -r '.packages[].inputRev // empty' lake-manifest.json | \
243-
grep -v -E '^(main|master|v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?)$' || true)
242+
grep -v -E '^(main|master|v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?)$' || true)
244243
245244
if [ -n "$invalid_revs" ]; then
246245
echo "❌ Error: Found invalid inputRevs in lake-manifest.json:"
@@ -249,12 +248,57 @@ jobs:
249248
echo "All inputRevs must be one of:"
250249
echo " - 'main'"
251250
echo " - 'master'"
252-
echo " - 'vX.Y.Z' (semantic version, e.g., v1.2.3 or v1.2.3-pre)"
251+
echo " - 'vX.Y.Z' (semantic version, e.g., v1.2.3, v1.2.3-pre, or v1.2.3+build)"
253252
exit 1
254253
else
255254
echo "✅ All inputRevs in lake-manifest.json are valid"
256255
fi
257256
257+
- name: verify ProofWidgets lean-toolchain matches on versioned releases
258+
# Only enforce this on the main mathlib4 repository, not on nightly-testing
259+
if: github.repository == 'leanprover-community/mathlib4'
260+
shell: bash
261+
run: |
262+
cd pr-branch
263+
264+
# Read the lean-toolchain file
265+
TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]')
266+
echo "Lean toolchain: $TOOLCHAIN"
267+
268+
# Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1)
269+
if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
270+
echo "✓ Detected versioned Lean release: $TOOLCHAIN"
271+
echo "Verifying ProofWidgets lean-toolchain matches..."
272+
273+
# Check if ProofWidgets lean-toolchain exists
274+
if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then
275+
echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist"
276+
echo "This file should be created by 'lake env' during dependency download."
277+
exit 1
278+
fi
279+
280+
# Read ProofWidgets lean-toolchain
281+
PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]')
282+
echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN"
283+
284+
# Compare the two
285+
if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then
286+
echo "❌ Error: Lean toolchain mismatch!"
287+
echo " Main lean-toolchain: $TOOLCHAIN"
288+
echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN"
289+
echo ""
290+
echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z),"
291+
echo "the ProofWidgets dependency must use the same toolchain."
292+
echo "Please update the ProofWidgets dependency to use $TOOLCHAIN"
293+
exit 1
294+
else
295+
echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN"
296+
fi
297+
else
298+
echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)"
299+
echo "Skipping ProofWidgets toolchain verification."
300+
fi
301+
258302
- name: get cache (1/3 - setup and initial fetch)
259303
id: get_cache_part1_setup
260304
shell: bash # only runs `cache get` from `master-branch`, so doesn't need to be inside landrun
@@ -429,7 +473,7 @@ jobs:
429473
MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }}
430474

431475
- name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean
432-
if: always()
476+
if: ${{ always() && steps.mk_all.outcome != 'skipped' }}
433477
run: |
434478
if [[ "${{ steps.mk_all.outcome }}" != "success" ]]; then
435479
echo "Please run 'lake exe mk_all' to regenerate the import all files"
@@ -460,11 +504,13 @@ jobs:
460504
action: add # In order to be able to run a multiline script, we need to add/remove the problem matcher before and after.
461505
linters: gcc
462506

463-
- name: check for unused imports
464-
id: shake
465-
run: |
466-
cd pr-branch
467-
env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
507+
# With the arrival of the module system, the old `shake` is no longer functional.
508+
# This will be replaced soon.
509+
# - name: check for unused imports
510+
# id: shake
511+
# run: |
512+
# cd pr-branch
513+
# env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
468514

469515
- name: lint mathlib
470516
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}

0 commit comments

Comments
 (0)