feat(CI): add upload & download via lake cache #203
feat(CI): add upload & download via lake cache #203tydeu wants to merge 6 commits intonightly-testingfrom
lake cache #203Conversation
|
This pull request is now in draft mode. No active bors state needed cleanup. While this PR remains draft, bors will ignore commands on this PR. Mark it ready for review before using commands like |
|
@marcelolynch This PR deploys the new Lake cache to Mathlib. It is still a work-in-progress, but it seems reasonable to alert you now, just in case you might already have thoughts about the PR's design. |
|
On a general note: I understand that this PR is open against |
|
@marcelolynch The plan was to merge the finished version of this PR into |
a21445b to
6740dda
Compare
This PR adds upload and download support for Mathlib's CI build artifacts via
lake cache, Lake's native artifact cache system. It runs alongside the existinglake exe cachetooling during a transition/validation period.Changes
lakefile.lean:enableArtifactCache := true— opt into Lake's artifact cacherestoreAllArtifacts := true— restore all artifacts (not just the minimal set) from cache, as various tooling expects Mathlib artifacts to be in the build directory.platformIndependent := true—.oleanfiles built in CI are used cross-platformfixedToolchain := true— Mathlib is tied to the toolchain it was built with.github/workflows/build_template.yml:LAKE_CACHE_DIR: .lake/cacheso Lake stores its artifact cache inside.lake/, which is already within therwmount permitted bylandrun.LAKE_CACHE_DIRthroughlandrun's--envflag so it is visible to sandboxed steps.buildjob, after the build, runlake build --no-build -o .lake/outputs.jsonl+lake cache stageto collect artifacts into a staging directory, then upload that as a GitHub Actions artifact.upload_lake_cachejob, download the staging directory and upload it to the Cloudflare cache vialake cache put-staged.verify_lake_cachejob, build Mathlib's dependencies, fetch the Mathlib Lake cache withlake cache get, and verify completeness withlake build --no-build --rehash -v.🤖 Prepared with Claude Code