Skip to content

Commit 254b850

Browse files
author
leanprover-community-mathlib4-bot
committed
Update lean-toolchain for leanprover/lean4#12545
2 parents 9df350a + b8ea9d6 commit 254b850

5,325 files changed

Lines changed: 105497 additions & 43284 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/actions/get-mathlib-ci/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Any workflow that needs `mathlib-ci` should use this action instead of writing i
99
own `actions/checkout` block for `leanprover-community/mathlib-ci`.
1010

1111
The default `ref` in [`action.yml`](./action.yml) is the single canonical pinned
12-
`mathlib-ci` commit for this repository.
12+
`mathlib-ci` commit for this repository. This is auto-updated regularly by the
13+
[`update_dependencies.yml` workflow](../../workflows/update_dependencies.yml).
1314

1415
## Why
1516

.github/actions/get-mathlib-ci/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ inputs:
99
required: false
1010
# Default pinned commit used by workflows unless they explicitly override.
1111
# Update this ref as needed to pick up changes to mathlib-ci scripts
12-
default: 261ca4c0c6bd3267e4846ef9fdd676afab9fef4e
12+
# This is also updated automatically by .github/workflows/update_dependencies.yml
13+
default: 455d84939bba1fbe157ff2c1469a0c258372d05c
1314
path:
1415
description: Checkout destination path.
1516
required: false

.github/workflows/PR_summary.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ jobs:
228228
then
229229
# Format each changed workflow path as a Markdown bullet: "- `path`"
230230
workflowFilesChangedMarkdown="$(sed "s|^|- \`|; s|\$|\`|" <<< "${workflowFilesChanged}")"
231-
workflowDocsReminder="$(printf "### Workflow documentation reminder\nThis PR modifies files under \`.github/workflows/\`.\nPlease update \`docs/workflows.md\` if the workflow inventory, triggers, or behavior changed.\n\nModified workflow files:\n%s\n" "${workflowFilesChangedMarkdown}")"
231+
workflowDocsReminder="$(printf "### ⚠️ Workflow documentation reminder\nThis PR modifies files under \`.github/workflows/\`.\nPlease update \`docs/workflows.md\` if the workflow inventory, triggers, or behavior changed.\n\nModified workflow files:\n%s\n" "${workflowFilesChangedMarkdown}")"
232232
else
233233
workflowDocsReminder=""
234234
fi
@@ -239,7 +239,7 @@ jobs:
239239
then
240240
# Format each added scripts path as a Markdown bullet: "- `path`"
241241
scriptsFilesAddedMarkdown="$(sed "s|^|- \`|; s|\$|\`|" <<< "${scriptsFilesAdded}")"
242-
scriptsLocationReminder="$(printf "### Scripts folder reminder\nThis PR adds files under \`scripts/\`.\nPlease consider whether each added script belongs in this repository or in \`leanprover-community/mathlib-ci\`.\n\nAdded scripts files:\n%s\n" "${scriptsFilesAddedMarkdown}")"
242+
scriptsLocationReminder="$(printf "### ⚠️ Scripts folder reminder\nThis PR adds files under \`scripts/\`.\nPlease consider whether each added script belongs in this repository or in [\`leanprover-community/mathlib-ci\`](https://github.com/leanprover-community/mathlib-ci).\n\nA script belongs in **\`mathlib-ci\`** if it is a CI automation script that interacts with GitHub (e.g. managing labels, posting comments, triggering bots), runs from a trusted external checkout in CI, or requires access to secrets.\n\nA script belongs in **this repository** (\`scripts/\`) if it is a developer or maintainer tool to be run locally, a code maintenance or analysis utility, a style linting tool, or a data file used by the library's own linters.\n\nSee the [\`mathlib-ci\` README](https://github.com/leanprover-community/mathlib-ci) for more details.\n\nAdded scripts files:\n%s\n" "${scriptsFilesAddedMarkdown}")"
243243
else
244244
scriptsLocationReminder=""
245245
fi

.github/workflows/actionlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1313

1414
- name: suggester / actionlint
15-
uses: reviewdog/action-actionlint@0d952c597ef8459f634d7145b0b044a9699e5e43 # v1.71.0
15+
uses: reviewdog/action-actionlint@6fb7acc99f4a1008869fa8a0f09cfca740837d9d # v1.72.0
1616
with:
1717
tool_name: actionlint
1818
fail_level: any

.github/workflows/add_label_from_diff.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
ref: master
2828
path: tools
2929
- name: Configure Lean
30-
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
30+
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
3131
with:
3232
auto-config: false
3333
use-github-cache: false

.github/workflows/build_template.yml

Lines changed: 42 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222
223223
- name: validate lake-manifest.json inputRevs
224224
# Only enforce this on the main mathlib4 repository, not on nightly-testing
225-
if: github.repository == 'leanprover-community/mathlib4'
225+
if: github.repository == 'leanprover-community/mathlib4' && github.ref_name != 'nightly-testing'
226226
shell: bash
227227
run: |
228228
cd pr-branch
@@ -247,76 +247,6 @@ jobs:
247247
echo "✅ All inputRevs in lake-manifest.json are valid"
248248
fi
249249
250-
- name: validate ProofWidgets source repository
251-
# Only enforce this on the main mathlib4 repository, not on nightly-testing
252-
if: github.repository == 'leanprover-community/mathlib4'
253-
shell: bash
254-
run: |
255-
cd pr-branch
256-
257-
expected_url='https://github.com/leanprover-community/ProofWidgets4'
258-
proofwidgets_count=$(jq '[.packages[] | select(.name == "proofwidgets")] | length' lake-manifest.json)
259-
if [ "$proofwidgets_count" -ne 1 ]; then
260-
echo "❌ Error: expected exactly one proofwidgets entry in lake-manifest.json, found $proofwidgets_count"
261-
exit 1
262-
fi
263-
264-
proofwidgets_url=$(jq -r '.packages[] | select(.name == "proofwidgets") | .url' lake-manifest.json)
265-
normalized_url="${proofwidgets_url%.git}"
266-
if [ "$normalized_url" != "$expected_url" ]; then
267-
echo "❌ Error: invalid ProofWidgets source URL in lake-manifest.json"
268-
echo " expected: $expected_url"
269-
echo " found: $proofwidgets_url"
270-
exit 1
271-
fi
272-
273-
echo "✅ ProofWidgets source URL is allowed: $proofwidgets_url"
274-
275-
- name: verify ProofWidgets lean-toolchain matches on versioned releases
276-
# Only enforce this on the main mathlib4 repository, not on nightly-testing
277-
if: github.repository == 'leanprover-community/mathlib4'
278-
shell: bash
279-
run: |
280-
cd pr-branch
281-
282-
# Read the lean-toolchain file
283-
TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]')
284-
echo "Lean toolchain: $TOOLCHAIN"
285-
286-
# Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1)
287-
if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
288-
echo "✓ Detected versioned Lean release: $TOOLCHAIN"
289-
echo "Verifying ProofWidgets lean-toolchain matches..."
290-
291-
# Check if ProofWidgets lean-toolchain exists
292-
if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then
293-
echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist"
294-
echo "This file should be created by 'lake env' during dependency download."
295-
exit 1
296-
fi
297-
298-
# Read ProofWidgets lean-toolchain
299-
PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]')
300-
echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN"
301-
302-
# Compare the two
303-
if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then
304-
echo "❌ Error: Lean toolchain mismatch!"
305-
echo " Main lean-toolchain: $TOOLCHAIN"
306-
echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN"
307-
echo ""
308-
echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z),"
309-
echo "the ProofWidgets dependency must use the same toolchain."
310-
echo "Please update the ProofWidgets dependency to use $TOOLCHAIN"
311-
exit 1
312-
else
313-
echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN"
314-
fi
315-
else
316-
echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)"
317-
echo "Skipping ProofWidgets toolchain verification."
318-
fi
319-
320250
- name: get cache (1/3 - setup and initial fetch)
321251
id: get_cache_part1_setup
322252
shell: bash # only runs `cache get` from `tools-branch`, so doesn't need to be inside landrun
@@ -327,7 +257,7 @@ jobs:
327257
328258
# Fail quickly if the cache is completely cold, by checking for Mathlib.Init
329259
echo "Attempting to fetch olean for Mathlib/Init.lean from cache..."
330-
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get Mathlib/Init.lean
260+
../tools-branch/.lake/build/bin/cache get Mathlib/Init.lean
331261
332262
- name: get cache (2/3 - test Mathlib.Init cache)
333263
id: get_cache_part2_test
@@ -380,13 +310,19 @@ jobs:
380310
# cf. https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Mathlib.20has.20moved.20to.20the.20new.20module.20system/near/563452000
381311
echo "Warming up cache using previous commit: $PREV_SHA (source: $PREV_SHA_SOURCE)"
382312
if git cat-file -e "$PREV_SHA^{commit}" 2>/dev/null || git fetch --no-tags --depth=1 origin "$PREV_SHA"; then
383-
git checkout "$PREV_SHA"
384-
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get
385-
# Run again with --repo, to ensure we actually get the oleans.
386-
../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" --skip-proofwidgets get
387-
388-
echo "Switching back to branch head"
389-
git checkout "$ORIG_SHA"
313+
# Skip warmup if the previous commit uses a different toolchain
314+
PREV_TOOLCHAIN=$(git show "$PREV_SHA:lean-toolchain" 2>/dev/null || true)
315+
if [[ "$PREV_TOOLCHAIN" != "$(cat lean-toolchain)" ]]; then
316+
echo "Previous commit $PREV_SHA uses a different toolchain ($PREV_TOOLCHAIN); skipping warmup."
317+
else
318+
git checkout "$PREV_SHA"
319+
../tools-branch/.lake/build/bin/cache get
320+
# Run again with --repo, to ensure we actually get the oleans.
321+
../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" get
322+
323+
echo "Switching back to branch head"
324+
git checkout "$ORIG_SHA"
325+
fi
390326
else
391327
echo "Could not fetch $PREV_SHA; skipping parent warmup cache fetch."
392328
fi
@@ -396,18 +332,10 @@ jobs:
396332
397333
echo "Fetching all remaining cache..."
398334
399-
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get
335+
../tools-branch/.lake/build/bin/cache get
400336
401337
# Run again with --repo, to ensure we actually get the oleans.
402-
../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" --skip-proofwidgets get
403-
404-
- name: fetch ProofWidgets release
405-
# We need network access for ProofWidgets frontend assets.
406-
# Run inside landrun so PR-controlled code remains sandboxed.
407-
shell: landrun --unrestricted-network --rox /etc --rox /usr --rw /dev --rox /home/lean/.elan --rox /home/lean/actions-runner/_work --rw pr-branch/.lake/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
408-
run: |
409-
cd pr-branch
410-
lake build proofwidgets:release
338+
../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" get
411339
412340
- name: update {Mathlib, Tactic, Counterexamples, Archive}.lean
413341
id: mk_all
@@ -462,8 +390,8 @@ jobs:
462390
shell: bash
463391
run: |
464392
cd pr-branch
465-
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get Archive.lean
466-
../tools-branch/.lake/build/bin/cache --skip-proofwidgets get Counterexamples.lean
393+
../tools-branch/.lake/build/bin/cache get Archive.lean
394+
../tools-branch/.lake/build/bin/cache get Counterexamples.lean
467395
468396
- name: build archive
469397
id: archive
@@ -523,7 +451,7 @@ jobs:
523451
524452
- name: upload cache staging artifact
525453
if: ${{ always() && steps.cache_staging_check.outputs.has_files == 'true' }}
526-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
454+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
527455
with:
528456
name: cache-staging
529457
path: cache-staging/
@@ -646,12 +574,14 @@ jobs:
646574
- name: Generate lean-pr-testing app token
647575
if: ${{ always() && github.repository == 'leanprover-community/mathlib4-nightly-testing' && (startsWith(github.ref_name, 'lean-pr-testing-') || startsWith(github.ref_name, 'batteries-pr-testing-')) }}
648576
id: lean-pr-testing-token
649-
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
577+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
650578
with:
651-
app-id: ${{ secrets.MATHLIB_LEAN_PR_TESTING_APP_ID }}
652-
private-key: ${{ secrets.MATHLIB_LEAN_PR_TESTING_PRIVATE_KEY }}
653-
owner: leanprover
654-
repositories: lean4
579+
# `batteries-pr-testing-*` branches need a token scoped to `leanprover-community/batteries`
580+
# for the labelling API; `lean-pr-testing-*` branches need one scoped to `leanprover/lean4`.
581+
app-id: ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && secrets.MATHLIB_NIGHTLY_TESTING_APP_ID || secrets.MATHLIB_LEAN_PR_TESTING_APP_ID }}
582+
private-key: ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && secrets.MATHLIB_NIGHTLY_TESTING_PRIVATE_KEY || secrets.MATHLIB_LEAN_PR_TESTING_PRIVATE_KEY }}
583+
owner: ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && 'leanprover-community' || 'leanprover' }}
584+
repositories: ${{ startsWith(github.ref_name, 'batteries-pr-testing-') && 'batteries' || 'lean4' }}
655585
# The create-github-app-token README states that this token is masked and will not be logged accidentally.
656586
- name: Post comments for lean-pr-testing-NNNN and batteries-pr-testing-NNNN branches
657587
if: ${{ always() && github.repository == 'leanprover-community/mathlib4-nightly-testing' && (startsWith(github.ref_name, 'lean-pr-testing-') || startsWith(github.ref_name, 'batteries-pr-testing-')) }}
@@ -690,7 +620,7 @@ jobs:
690620
fetch-depth: 1
691621

692622
- name: Configure Lean
693-
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
623+
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
694624
with:
695625
auto-config: false # Don't run `lake build`, `lake test`, or `lake lint` automatically.
696626
use-github-cache: false
@@ -708,7 +638,7 @@ jobs:
708638
echo "CACHE_BIN=$CACHE_BIN" >> "$GITHUB_ENV"
709639
710640
- name: Download cache staging artifact
711-
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
641+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
712642
with:
713643
name: cache-staging
714644
path: cache-staging
@@ -761,7 +691,7 @@ jobs:
761691
ref: ${{ inputs.pr_branch_ref }}
762692

763693
- name: Configure Lean
764-
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
694+
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
765695
with:
766696
auto-config: false # Don't run `lake build`, `lake test`, or `lake lint` automatically.
767697
use-github-cache: false
@@ -804,7 +734,7 @@ jobs:
804734
lake exe graph
805735
806736
- name: upload the import graph
807-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
737+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
808738
with:
809739
name: import-graph
810740
path: import_graph.dot
@@ -815,6 +745,12 @@ jobs:
815745
- name: clean up the import graph file
816746
run: rm import_graph.dot
817747

748+
- name: check all scripts build successfully
749+
run: |
750+
lake env lean scripts/create_deprecated_modules.lean
751+
lake env lean scripts/autolabel.lean
752+
lake exe check_title_labels --labels "t-algebra" "feat: dummy PR for testing"
753+
818754
- name: build everything
819755
# make sure everything is available for test/import_all.lean
820756
# and that miscellaneous executables still work
@@ -937,9 +873,10 @@ jobs:
937873
- if: >- # bot usernames will cause this step to error with "Could not resolve to a User..."
938874
contains(steps.PR.outputs.pr_labels, 'auto-merge-after-CI') &&
939875
steps.get-label-actor.outputs.username != 'mathlib-nolints' &&
940-
steps.get-label-actor.outputs.username != 'mathlib-update-dependencies'
876+
steps.get-label-actor.outputs.username != 'mathlib-update-dependencies' &&
877+
steps.get-label-actor.outputs.username != 'mathlib-splicebot'
941878
name: check team membership
942-
uses: tspascoal/get-user-teams-membership@57e9f42acd78f4d0f496b3be4368fc5f62696662 # v3.0.0
879+
uses: tspascoal/get-user-teams-membership@818140d631d5f29f26b151afbe4179f87d9ceb5e # v4.0.1
943880
id: actorTeams
944881
with:
945882
organization: leanprover-community # optional. Default value ${{ github.repository_owner }}
@@ -952,7 +889,9 @@ jobs:
952889
(
953890
steps.get-label-actor.outputs.username == 'mathlib-nolints' ||
954891
steps.get-label-actor.outputs.username == 'mathlib-update-dependencies' ||
892+
steps.get-label-actor.outputs.username == 'mathlib-splicebot' ||
955893
contains(steps.actorTeams.outputs.teams, 'mathlib-maintainers') ||
894+
contains(steps.actorTeams.outputs.teams, 'lean-release-managers') ||
956895
contains(steps.actorTeams.outputs.teams, 'bot-users')
957896
)
958897
name: If `auto-merge-after-CI` is present, add a `bors merge` comment.

.github/workflows/check_pr_titles.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
ref: master
2525
- name: Configure Lean
26-
uses: leanprover/lean-action@c544e89643240c6b398f14a431bcdc6309e36b3e # v1.4.0
26+
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
2727
with:
2828
auto-config: false
2929
use-github-cache: false
@@ -70,7 +70,7 @@ jobs:
7070
fi
7171
7272
- name: Add comment to fix PR title
73-
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
73+
uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4
7474
if: failure() && steps.pr-title-check.outputs.errors
7575
with:
7676
header: 'PR Title Check'
@@ -120,7 +120,7 @@ jobs:
120120
121121
- name: Add comment that PR title is fixed
122122
if: steps.pr-title-check.outcome == 'success'
123-
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
123+
uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4
124124
with:
125125
header: 'PR Title Check'
126126
# should do nothing if a 'PR Title Check' comment does not exist

.github/workflows/commit_verification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
}' > bridge-outputs.json
112112
113113
- name: Emit bridge artifact
114-
uses: leanprover-community/privilege-escalation-bridge/emit@d3bd99c50a4cf8c5350a211e8e3ba07ac19067d8 # v1.1.0
114+
uses: leanprover-community/privilege-escalation-bridge/emit@f5dfe313a79647c07315b451b2dc2a81a161a50d # v1.2.0
115115
with:
116116
artifact: workflow-data
117117
outputs_file: bridge-outputs.json

.github/workflows/commit_verification_wf_run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
- name: Consume bridge artifact
2727
id: bridge
28-
uses: leanprover-community/privilege-escalation-bridge/consume@d3bd99c50a4cf8c5350a211e8e3ba07ac19067d8 # v1.1.0
28+
uses: leanprover-community/privilege-escalation-bridge/consume@f5dfe313a79647c07315b451b2dc2a81a161a50d # v1.2.0
2929
with:
3030
token: ${{ github.token }}
3131
artifact: workflow-data

0 commit comments

Comments
 (0)