Skip to content

Commit 625fcfa

Browse files
authored
Merge branch 'leanprover-community:master' into lowerlimittop
2 parents 02aa441 + 24103a8 commit 625fcfa

7,727 files changed

Lines changed: 208887 additions & 91192 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.

.docker/gitpod-blueprint/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ FROM ubuntu:jammy
1010
USER root
1111

1212
ENV DEBIAN_FRONTEND=noninteractive
13-
RUN apt-get update && apt-get install sudo git curl git bash-completion texlive texlive-xetex latexmk graphviz graphviz-dev python3 python3-pip python3-requests -y && apt-get clean
13+
RUN apt-get update && apt-get install sudo git curl git bash-completion texlive texlive-xetex latexmk graphviz graphviz-dev tzdata python3 python3-pip python3-requests -y && apt-get clean
1414

1515
RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod \
1616
# passwordless sudo for users in the 'sudo' group

.docker/gitpod/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ FROM ubuntu:jammy
99
USER root
1010

1111
ENV DEBIAN_FRONTEND=noninteractive
12-
RUN apt-get update && apt-get install sudo git curl git bash-completion python3 python3-pip python3-requests -y && apt-get clean
12+
RUN apt-get update && apt-get install sudo git curl git tzdata bash-completion python3 python3-pip python3-requests -y && apt-get clean
1313

1414
RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod \
1515
# passwordless sudo for users in the 'sudo' group

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11

22
---
3-
<!-- The text above the `---` will become the commit message when your
4-
PR is merged. Please leave a blank newline before the `---`, otherwise
5-
GitHub will format the text above it as a title.
3+
<!-- Your PR title will become the first line of the commit message.
4+
5+
In this box, the text above the `---` (if not empty) will be appended
6+
to the commit message, and can be used to give additional context or
7+
details. Please leave a blank newline before the `---`, otherwise GitHub
8+
will format the text above it as a title.
69
710
For details on the "pull request lifecycle" in mathlib, please see:
811
https://leanprover-community.github.io/contribute/index.html

.github/build.in.yml

Lines changed: 78 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
concurrency:
1616
# label each workflow run; only the latest with each label will run
1717
# workflows on master get more expressive labels
18-
group: ${{ github.workflow }}-${{ github.ref }}-${{ (contains(fromJSON('["refs/heads/master", "refs/heads/staging"]'), github.ref) && github.run_id) || '' }}
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ (github.event_name == 'push' && contains(fromJSON('["refs/heads/master", "refs/heads/staging"]'), github.ref) && github.run_id) || '' }}
1919
# cancel any running workflow with the same label
2020
cancel-in-progress: true
2121

@@ -38,12 +38,23 @@ 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.
44-
run:
44+
run: # note that .pr-branch/.lake must be created in a step below before we use this
4545
shell: landrun --rox /usr --ro /etc/timezone --rw /dev --rox /home/lean/.elan --rox /home/lean/actions-runner/_work --rox /home/lean/.cache/mathlib/ --rw pr-branch/.lake/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
4646
steps:
47+
- name: job info
48+
env:
49+
WORKFLOW: ${{ github.workflow }}
50+
PR_NUMBER: ${{ github.event.pull_request.number }}
51+
REF: ${{ github.ref }}
52+
EVENT_NAME: ${{ github.event_name }}
53+
RUN_ID: ${{ github.run_id }}
54+
CONCURRENCY_GROUP: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ (github.event_name == 'push' && contains(fromJSON('["refs/heads/master", "refs/heads/staging"]'), github.ref) && github.run_id) || '' }}
55+
shell: bash # there is no script body, so this is safe to "run" outside landrun.
56+
run: |
57+
# We just populate the env vars for this step to make them viewable in the logs
4758
- name: cleanup
4859
shell: bash # This *just* deletes old files, so is safe to run outside landrun.
4960
run: |
@@ -67,7 +78,7 @@ jobs:
6778

6879
# Checkout the master branch into a subdirectory
6980
- name: Checkout master branch
70-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
81+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
7182
with:
7283
# Recall that on the `leanprover-community/mathlib4-nightly-testing` repository,
7384
# we don't maintain a `master` branch at all.
@@ -77,7 +88,7 @@ jobs:
7788

7889
# Checkout the PR branch into a subdirectory
7990
- name: Checkout PR branch
80-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
91+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
8192
with:
8293
ref: "${{ PR_BRANCH_REF }}"
8394
path: pr-branch
@@ -212,7 +223,7 @@ jobs:
212223
213224
# Extract all inputRevs from the manifest
214225
invalid_revs=$(jq -r '.packages[].inputRev // empty' lake-manifest.json | \
215-
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)
216227
217228
if [ -n "$invalid_revs" ]; then
218229
echo "❌ Error: Found invalid inputRevs in lake-manifest.json:"
@@ -221,12 +232,57 @@ jobs:
221232
echo "All inputRevs must be one of:"
222233
echo " - 'main'"
223234
echo " - 'master'"
224-
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)"
225236
exit 1
226237
else
227238
echo "✅ All inputRevs in lake-manifest.json are valid"
228239
fi
229240
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+
230286
- name: get cache (1/3 - setup and initial fetch)
231287
id: get_cache_part1_setup
232288
shell: bash # only runs `cache get` from `master-branch`, so doesn't need to be inside landrun
@@ -295,7 +351,7 @@ jobs:
295351
echo "::endgroup::"
296352
297353
../master-branch/scripts/lake-build-with-retry.sh Mathlib
298-
# results of build at pr-branch/.lake/build_summary_Mathlib*.json
354+
# results of build at pr-branch/.lake/build_summary_Mathlib.json
299355
- name: end gh-problem-match-wrap for build step
300356
uses: leanprover-community/gh-problem-matcher-wrap@20007cb926a46aa324653a387363b52f07709845 # 2025-04-23
301357
with:
@@ -364,15 +420,15 @@ jobs:
364420
run: |
365421
cd pr-branch
366422
../master-branch/scripts/lake-build-with-retry.sh Archive
367-
# results of build at pr-branch/.lake/build_summary_Archive*.json
423+
# results of build at pr-branch/.lake/build_summary_Archive.json
368424
369425
- name: build counterexamples
370426
id: counterexamples
371427
continue-on-error: true
372428
run: |
373429
cd pr-branch
374430
../master-branch/scripts/lake-build-with-retry.sh Counterexamples
375-
# results of build at pr-branch/.lake/build_summary_Counterexamples*.json
431+
# results of build at pr-branch/.lake/build_summary_Counterexamples.json
376432
377433
- name: Check if building Archive or Counterexamples failed
378434
if: steps.archive.outcome == 'failure' || steps.counterexamples.outcome == 'failure'
@@ -401,7 +457,7 @@ jobs:
401457
MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }}
402458

403459
- name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean
404-
if: always()
460+
if: ${{ always() && steps.mk_all.outcome != 'skipped' }}
405461
run: |
406462
if [[ "${{ steps.mk_all.outcome }}" != "success" ]]; then
407463
echo "Please run 'lake exe mk_all' to regenerate the import all files"
@@ -419,7 +475,7 @@ jobs:
419475
id: test
420476
run: |
421477
cd pr-branch
422-
lake --iofail test
478+
../master-branch/scripts/lake-build-wrapper.py .lake/build_summary_MathlibTest.json lake --iofail test
423479
- name: end gh-problem-match-wrap for test step
424480
uses: leanprover-community/gh-problem-matcher-wrap@20007cb926a46aa324653a387363b52f07709845 # 2025-04-23
425481
with:
@@ -432,18 +488,20 @@ jobs:
432488
action: add # In order to be able to run a multiline script, we need to add/remove the problem matcher before and after.
433489
linters: gcc
434490

435-
- name: check for unused imports
436-
id: shake
437-
run: |
438-
cd pr-branch
439-
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
440498

441499
- name: lint mathlib
442500
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}
443501
id: lint
444502
run: |
445503
cd pr-branch
446-
env LEAN_ABORT_ON_PANIC=1 lake exe runLinter Mathlib
504+
env LEAN_ABORT_ON_PANIC=1 ../master-branch/scripts/lake-build-wrapper.py .lake/build_summary_lint.json lake exe runLinter Mathlib
447505
448506
- name: end gh-problem-match-wrap for shake and lint steps
449507
uses: leanprover-community/gh-problem-matcher-wrap@20007cb926a46aa324653a387363b52f07709845 # 2025-04-23
@@ -494,7 +552,7 @@ jobs:
494552
runs-on: ubuntu-latest # Note these steps run on disposable GitHub runners, so no landrun sandboxing is needed.
495553
steps:
496554

497-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
555+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
498556
with:
499557
ref: "${{ PR_BRANCH_REF }}"
500558

@@ -630,15 +688,6 @@ jobs:
630688
echo "number=${{ steps.PR_from_push.outputs.number || github.event.pull_request.number }}" | tee -a "$GITHUB_OUTPUT"
631689
echo "pr_labels=${{ steps.PR_from_push.outputs.pr_labels || join(github.event.pull_request.labels.*.name, ',') }}" | tee -a "$GITHUB_OUTPUT"
632690
633-
- if: contains(steps.PR.outputs.pr_labels, 'bench-after-CI')
634-
name: If `bench-after-CI` is present, add a `!bench` comment.
635-
uses: GrantBirki/comment@608e41b19bc973020ec0e189ebfdae935d7fe0cc # v2.1.1
636-
with:
637-
token: ${{ secrets.AUTO_MERGE_TOKEN }}
638-
issue-number: ${{ steps.PR.outputs.number }}
639-
body: |
640-
!bench
641-
642691
- id: remove_labels
643692
name: Remove "awaiting-CI"
644693
# we use curl rather than octokit/request-action so that the job won't fail
@@ -655,7 +704,7 @@ jobs:
655704
# unfortunately we cannot query only for 'auto-merge-after-CI' events
656705
# so we have to process this with jq in the next step
657706
id: get-timeline
658-
uses: octokit/graphql-action@8ad880e4d437783ea2ab17010324de1075228110 # v2.3.2
707+
uses: octokit/graphql-action@abaeca7ba4f0325d63b8de7ef943c2418d161b93 # v3.0.0
659708
with:
660709
query: |
661710
query($owner: String!, $name: String!, $number: Int!) {

.github/workflows/PR_summary.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717

1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2121
with:
2222
ref: ${{ github.event.pull_request.head.sha }}
2323
fetch-depth: 0
2424
path: pr-branch
2525

2626
# Checkout the master branch into a subdirectory
2727
- name: Checkout master branch
28-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2929
with:
3030
# When testing the scripts, comment out the "ref: master"
3131
ref: master
@@ -60,7 +60,7 @@ jobs:
6060
fi
6161
6262
- name: Set up Python
63-
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
63+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
6464
with:
6565
python-version: 3.12
6666

.github/workflows/actionlint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
13+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
1414

1515
- name: suggester / actionlint
16-
uses: reviewdog/action-actionlint@f00ad0691526c10be4021a91b2510f0a769b14d0 # v1.68.0
16+
uses: reviewdog/action-actionlint@83e4ed25b168066ad8f62f5afbb29ebd8641d982 # v1.69.1
1717
with:
1818
tool_name: actionlint
1919
fail_level: error
@@ -22,7 +22,7 @@ jobs:
2222
name: check workflows generated by build.in.yml
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2626

2727
- name: update workflows
2828
run: |

.github/workflows/add_label_from_diff.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
if: github.repository == 'leanprover-community/mathlib4'
2323
steps:
2424
- name: Checkout code
25-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2626
with:
2727
ref: ${{ github.event.pull_request.head.sha }}
2828
fetch-depth: 0

.github/workflows/auto_assign_reviewers.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ jobs:
1111
name: assign automatically proposed reviewers
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
14+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
1515
with:
1616
ref: master
1717
sparse-checkout: |
1818
scripts/assign_reviewers.py
1919
2020
- name: Set up Python
21-
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
21+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
2222
with:
2323
python-version: '3.x'
2424

.github/workflows/bench_summary_comment.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)