Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
2dd3a1a
Update lean-toolchain for testing https://github.com/leanprover/lean4…
Feb 5, 2026
f532e9a
Update lean-toolchain for https://github.com/leanprover/lean4/pull/12325
Feb 5, 2026
1f59a0f
Update lean-toolchain for https://github.com/leanprover/lean4/pull/12325
Feb 6, 2026
04ae226
Update lean-toolchain for testing https://github.com/leanprover/lean4…
Feb 23, 2026
6fdcfbf
chore: adapt for inclusion of leading whitespace in input syntax
mhuisi Feb 25, 2026
faad388
chore: add Mathlib.Tactic exception
mhuisi Feb 25, 2026
445449b
Update lean-toolchain for https://github.com/leanprover/lean4/pull/12662
Feb 25, 2026
129c3f7
chore: add module docstring linter special handling for eoi tokens
mhuisi Feb 26, 2026
9d26109
Update lean-toolchain for testing https://github.com/leanprover/lean4…
Mar 3, 2026
9a29323
Update lean-toolchain for https://github.com/leanprover/lean4/pull/12325
Mar 4, 2026
b2e01b1
Update lean-toolchain for https://github.com/leanprover/lean4/pull/12781
Mar 4, 2026
edb380e
rm stray file
kim-em Mar 5, 2026
3c63763
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 5, 2026
4c240d3
Merge branch 'nightly-testing' of https://github.com/leanprover-commu…
kim-em Mar 5, 2026
aaea335
mk_all
kim-em Mar 5, 2026
f584b9a
Merge branch 'bump/nightly-2026-03-04' into nightly-testing
kim-em Mar 5, 2026
d20daa0
fixes
kim-em Mar 5, 2026
284b704
Update lean-toolchain for https://github.com/leanprover/lean4/pull/12325
Mar 5, 2026
ec89131
chore: bump to nightly-2026-03-05
mathlib-nightly-testing[bot] Mar 5, 2026
4baec98
Update lean-toolchain for testing https://github.com/leanprover/lean4…
Mar 5, 2026
29e0d5d
fix: address classDefReducibility warnings for lean4#12325
kim-em Mar 5, 2026
daec739
Update lean-toolchain for https://github.com/leanprover/lean4/pull/12325
Mar 5, 2026
f147a6b
fix: remove set_option/implicit_reducible from Setoid-typed defs
kim-em Mar 5, 2026
06f51c7
Update lean-toolchain for https://github.com/leanprover/lean4/pull/12805
Mar 6, 2026
d6d02d2
fix: address classDefReducibility warnings in Archive
kim-em Mar 6, 2026
f682ac9
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 6, 2026
858a3d5
fix: address classDefReducibility warnings in MathlibTest
kim-em Mar 6, 2026
c3bb79a
script
kim-em Mar 6, 2026
4d08fa8
chore: bump to nightly-2026-03-06
mathlib-nightly-testing[bot] Mar 6, 2026
960bf78
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 7, 2026
6203387
Update lean-toolchain for https://github.com/leanprover/lean4/pull/12805
Mar 7, 2026
cc5e4e1
chore: bump to nightly-2026-03-07
mathlib-nightly-testing[bot] Mar 7, 2026
9d5ff52
merge lean-pr-testing-12662
mathlib-nightly-testing[bot] Mar 7, 2026
506e309
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 8, 2026
c64e602
Update lean-toolchain for testing https://github.com/leanprover/lean4…
Mar 8, 2026
a81f3f5
Update lean-toolchain for https://github.com/leanprover/lean4/pull/12841
Mar 8, 2026
93efe7e
fix
kmill Mar 9, 2026
365251e
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 9, 2026
8c1ce5c
Update lean-toolchain for testing https://github.com/leanprover/lean4…
Mar 9, 2026
bcd495b
fixed cdot linters
kmill Mar 9, 2026
a4bc5ff
restrict linter to tactic cdots
kmill Mar 9, 2026
9e6b540
chore: bump to nightly-2026-03-09
mathlib-nightly-testing[bot] Mar 9, 2026
425bcd5
merge lean-pr-testing-12841
mathlib-nightly-testing[bot] Mar 9, 2026
c5a113d
Update lean-toolchain for https://github.com/leanprover/lean4/pull/10384
Mar 9, 2026
a4e193e
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 10, 2026
56d241b
fix: isStructureLike → isStructure
kim-em Mar 10, 2026
0342568
Merge branch 'nightly-testing' of https://github.com/leanprover-commu…
kim-em Mar 10, 2026
d5bdbfc
merge
kim-em Mar 10, 2026
feebe0f
chore: update plausible to nightly-testing (lean4#12325 adaptations)
kim-em Mar 10, 2026
ed9f3fe
fix merge
kim-em Mar 10, 2026
49f8693
implicit_reducible warning
kim-em Mar 10, 2026
795e3ac
fix merge
kim-em Mar 10, 2026
e14778e
more implict_reducible
kim-em Mar 10, 2026
5375d4f
simplify proof
kim-em Mar 10, 2026
b901a68
chore: adaptations for nightly-2026-03-09
kim-em Mar 10, 2026
c04eb92
Apply suggestion from @kim-em
kim-em Mar 10, 2026
8bbcc56
Apply suggestion from @kim-em
kim-em Mar 10, 2026
c7ac5a1
Apply suggestion from @kim-em
kim-em Mar 10, 2026
f54b267
chore: bump to nightly-2026-03-10
mathlib-nightly-testing[bot] Mar 10, 2026
2d77504
merge lean-pr-testing-10384
mathlib-nightly-testing[bot] Mar 10, 2026
18b7f25
merge lean-pr-testing-12805
mathlib-nightly-testing[bot] Mar 10, 2026
937044c
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 11, 2026
419783b
Update lean-toolchain for testing https://github.com/leanprover/lean4…
Mar 11, 2026
7d97381
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 12, 2026
b289305
chore: adapt to lean4#12698 (ExceptToEmoji → ExceptToTraceResult) and…
kim-em Mar 12, 2026
dd522a4
chore: remove manual emoji from withTraceNode callbacks (nightly adap…
kim-em Mar 12, 2026
1f32340
fix: close backtick after script name in scripts/README.md
kim-em Mar 12, 2026
ba2e423
fix: replace toNat! with toNat? in version parsing to avoid panic
kim-em Mar 12, 2026
e410a5e
chore: update aesop dependency
kim-em Mar 13, 2026
bb1ee00
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 13, 2026
0ea8d38
fix
kim-em Mar 13, 2026
abd4d29
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 14, 2026
11da036
chore: bump to nightly-2026-03-14
Rob23oba Mar 14, 2026
48ce724
merge lean-pr-testing-12781
Rob23oba Mar 14, 2026
c5d9519
merge lean-pr-testing-12883
Rob23oba Mar 14, 2026
733720b
chore: adaptations for nightly-2026-03-14
Rob23oba Mar 14, 2026
f91ccc6
feat(Cache): prefer leantar bundled with Lean toolchain
kim-em Mar 16, 2026
99bf220
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 16, 2026
099df6b
chore: bump to nightly-2026-03-15
mathlib-nightly-testing[bot] Mar 16, 2026
24af830
chore(Cache): remove leantar fallback download, require Lean-bundled …
kim-em Mar 16, 2026
46d57d5
chore(Cache): remove dead code after leantar fallback removal
kim-em Mar 16, 2026
c9ca28c
ci: allow leantar /tmp access in landrun sandbox
kim-em Mar 16, 2026
3b056cc
chore: bump to nightly-2026-03-16
mathlib-nightly-testing[bot] Mar 16, 2026
15247f5
Merge master into nightly-testing
mathlib-nightly-testing[bot] Mar 17, 2026
0e1db5d
fix merge
kim-em Mar 17, 2026
7193c91
chore: bump to nightly-2026-03-17
mathlib-nightly-testing[bot] Mar 17, 2026
cf092ce
chore: adaptations for nightly-2026-03-17
kim-em Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/build_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -486,23 +486,28 @@ jobs:
rm -rf cache-staging
mkdir -p cache-staging

# WORKAROUND: leantar v0.1.18 (bundled with Lean) uses tempfile::NamedTempFile::new()
# which unconditionally writes to /tmp. We need --rw /tmp here until leantar is fixed
# to use NamedTempFile::new_in() with an appropriate directory.
# See: https://github.com/digama0/leangz/commit/6d1691e0a4
# TODO: remove --rw /tmp once a fixed leantar is available
- name: stage Mathlib cache files
if: ${{ always() && (steps.build.outcome == 'success' || steps.build.outcome == 'failure' || steps.build.outcome == 'cancelled') }}
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 /home/lean/.cache/mathlib/ --rw pr-branch/.lake/ --rw cache-staging/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
shell: landrun --rox /usr --ro /etc/timezone --rw /dev --rw /tmp --rox /home/lean/.elan --rox /home/lean/actions-runner/_work --rox /home/lean/.cache/mathlib/ --rw /home/lean/.cache/mathlib/ --rw pr-branch/.lake/ --rw cache-staging/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
run: |
cd pr-branch
lake env ../tools-branch/.lake/build/bin/cache --staging-dir="../cache-staging" stage

- name: stage Archive cache files
if: ${{ steps.archive.outcome == 'success' }}
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 /home/lean/.cache/mathlib/ --rw pr-branch/.lake/ --rw cache-staging/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
shell: landrun --rox /usr --ro /etc/timezone --rw /dev --rw /tmp --rox /home/lean/.elan --rox /home/lean/actions-runner/_work --rox /home/lean/.cache/mathlib/ --rw /home/lean/.cache/mathlib/ --rw pr-branch/.lake/ --rw cache-staging/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
run: |
cd pr-branch
lake env ../tools-branch/.lake/build/bin/cache --staging-dir="../cache-staging" stage Archive.lean

- name: stage Counterexamples cache files
if: ${{ steps.counterexamples.outcome == 'success' }}
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 /home/lean/.cache/mathlib/ --rw pr-branch/.lake/ --rw cache-staging/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
shell: landrun --rox /usr --ro /etc/timezone --rw /dev --rw /tmp --rox /home/lean/.elan --rox /home/lean/actions-runner/_work --rox /home/lean/.cache/mathlib/ --rw /home/lean/.cache/mathlib/ --rw pr-branch/.lake/ --rw cache-staging/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
run: |
cd pr-branch
lake env ../tools-branch/.lake/build/bin/cache --staging-dir="../cache-staging" stage Counterexamples.lean
Expand Down
59 changes: 10 additions & 49 deletions Cache/IO.lean
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,24 @@ def CURLBIN :=
-- change file name if we ever need a more recent version to trigger re-download
IO.CACHEDIR / s!"curl-{CURLVERSION}"

/-- leantar version at https://github.com/digama0/leangz -/
def LEANTARVERSION :=
"0.1.17"

def EXE := if System.Platform.isWindows then ".exe" else ""

def LEANTARBIN :=
-- change file name if we ever need a more recent version to trigger re-download
IO.CACHEDIR / s!"leantar-{LEANTARVERSION}{EXE}"

def LAKEPACKAGESDIR : FilePath :=
".lake" / "packages"

def getCurl : IO String := do
return if (← CURLBIN.pathExists) then CURLBIN.toString else "curl"

def getLeanTar : IO String := do
return if (← LEANTARBIN.pathExists) then LEANTARBIN.toString else "leantar"
/-- Path to the `leantar` binary bundled with the Lean toolchain.
This has been bundled since `nightly-2026-03-09` (lean4#12822). -/
private initialize leantarSysrootBin : String ← do
let out ← IO.Process.output { cmd := "lean", args := #["--print-prefix"] }
if out.exitCode == 0 then
let path : FilePath := out.stdout.trimAscii.toString / "bin" / s!"leantar{EXE}"
if ← path.pathExists then return path.toString
throw <| IO.userError "leantar not found in Lean sysroot. This toolchain may predate nightly-2026-03-09."

def getLeanTar : IO String := return leantarSysrootBin

/-- Spawn a `leantar` process for decompression, writing the given JSON config to its stdin.
Returns the process exit code. -/
Expand Down Expand Up @@ -238,45 +238,6 @@ def validateCurl : IO Bool := do
| _ => throw <| IO.userError "Invalidly formatted version of `curl`"
| _ => throw <| IO.userError "Invalidly formatted response from `curl --version`"

def Version := Nat × Nat × Nat
deriving Inhabited, DecidableEq

instance : Ord Version := let _ := @lexOrd; lexOrd
instance : LE Version := leOfOrd

def parseVersion (s : String) : Option Version := do
let [maj, min, patch] := s.trimAscii.toString.splitOn "." | none
some (← String.toNat? maj, ← String.toNat? min, ← String.toNat? patch)

def validateLeanTar : IO Unit := do
if (← LEANTARBIN.pathExists) then return
if let some version ← some <$> runCmd "leantar" #["--version"] <|> pure none then
let "leantar" :: v :: _ := version.splitOn " "
| throw <| IO.userError "Invalidly formatted response from `leantar --version`"
let some v := parseVersion v | throw <| IO.userError "Invalidly formatted version of `leantar`"
-- currently we need exactly one version of leantar, change this to reflect compatibility
if v = (parseVersion LEANTARVERSION).get! then return
let win := System.Platform.getIsWindows ()
let target ← if win then
pure "x86_64-pc-windows-msvc"
else
let mut arch ← (·.trimAscii.copy) <$> runCmd "uname" #["-m"] false
if arch = "arm64" then arch := "aarch64"
unless arch ∈ ["x86_64", "aarch64"] do
throw <| IO.userError s!"unsupported architecture {arch}"
pure <|
if System.Platform.getIsOSX () then s!"{arch}-apple-darwin"
else s!"{arch}-unknown-linux-musl"
IO.println s!"installing leantar {LEANTARVERSION}"
IO.FS.createDirAll IO.CACHEDIR
let ext := if win then "zip" else "tar.gz"
let _ ← runCmd "curl" (stderrAsErr := false) #[
s!"https://github.com/digama0/leangz/releases/download/v{LEANTARVERSION}/leantar-v{LEANTARVERSION}-{target}.{ext}",
"-L", "-o", s!"{LEANTARBIN}.{ext}"]
let _ ← runCmd "tar" #["-xf", s!"{LEANTARBIN}.{ext}",
"-C", IO.CACHEDIR.toString, "--strip-components=1"]
IO.FS.rename (IO.CACHEDIR / s!"leantar{EXE}").toString LEANTARBIN.toString

/-- Recursively gets all files from a directory with a certain extension -/
partial def getFilesWithExtension
(fp : FilePath) (extension : String) (acc : Array FilePath := #[]) :
Expand Down
1 change: 0 additions & 1 deletion Cache/Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def main (args : List String) : IO Unit := do
let hashMemo ← getHashMemo roots
let hashMap := hashMemo.hashMap
let goodCurl ← pure !curlArgs.contains (args.headD "") <||> validateCurl
if leanTarArgs.contains (args.headD "") then validateLeanTar
let get (args : List String) (force := false) (decompress := true) := do
let hashMap ← if args.isEmpty then pure hashMap else hashMemo.filterByRootModules roots.keys
getFiles repo? hashMap force force goodCurl decompress skipProofWidgets
Expand Down
2 changes: 1 addition & 1 deletion lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "22f50046aa2bd8d7e31e066a274bfed54b079133",
"rev": "b7558def110ca10bd6c97c1cbe8a80dbb3c86d8f",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "nightly-testing",
Expand Down
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:nightly-2026-03-14
leanprover/lean4:nightly-2026-03-17
Loading