Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - chore: fix post_update hook #8401

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ post_update pkg do
https://github.com/leanprover/lean4/issues/2752
-/
let wsToolchainFile := rootPkg.dir / "lean-toolchain"
let mathlibToolchain ← IO.FS.readFile <| pkg.dir / "lean-toolchain"
let mathlibToolchain := ← IO.FS.readFile <| pkg.dir / "lean-toolchain"
IO.FS.writeFile wsToolchainFile mathlibToolchain
/-
Instead of building and running cache via the Lake API,
spawn a new `lake` since the toolchain may have changed.
-/
let exitCode ← IO.Process.spawn {
cmd := (← getElan?).map (·.toString) |>.getD "elan"
args := #["run", mathlibToolchain, "lake", "exe", "cache", "get"]
cmd := "elan"
args := #["run", mathlibToolchain.trim, "lake", "exe", "cache", "get"]
} >>= (·.wait)
if exitCode ≠ 0 then
logError s!"{pkg.name}: failed to fetch cache"
Expand Down