Skip to content

feat: lake: conditional cache overwrites#14036

Merged
tydeu merged 8 commits into
leanprover:masterfrom
tydeu:lake/cache-overwrite
Jun 14, 2026
Merged

feat: lake: conditional cache overwrites#14036
tydeu merged 8 commits into
leanprover:masterfrom
tydeu:lake/cache-overwrite

Conversation

@tydeu

@tydeu tydeu commented Jun 12, 2026

Copy link
Copy Markdown
Member

This PR refines when and how Lake decides to overwrite data while caching, and has Lake prefer outputs in a local trace file over those stored in the cache.

Key details

  • Introduces an overwrite toggle controlled by the new options --no-overwrite and --force-overwrite. The default for lake cache add is --force-overwrite and the default for lake cache stage/unstage is --no-overwrite.
  • With --force-overwrite, already existing mappings and artifacts are overwritten. With --no-overwrite, they are not.
  • Existing trace's outputs will not overwrite an existing cached input-to-output mapping (so they may diverge). This avoids writing to the cache on every trace read.
  • The ltar output is retained in the module's cached input-to-output mapping after unpacking from the cache.

Closes #13997.

@tydeu tydeu added the changelog-lake Lake label Jun 12, 2026
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jun 12, 2026
@leanprover-bot

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-06-10 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-06-12 21:08:16)

@github-actions github-actions Bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Jun 12, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Jun 12, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jun 12, 2026
@mathlib-lean-pr-testing

mathlib-lean-pr-testing Bot commented Jun 12, 2026

Copy link
Copy Markdown

Mathlib CI status (docs):

@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Jun 12, 2026
@tydeu tydeu force-pushed the lake/cache-overwrite branch from 726e00d to 2aa7927 Compare June 13, 2026 01:07
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Jun 13, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jun 13, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Jun 13, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jun 13, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Jun 13, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jun 13, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Jun 13, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jun 13, 2026
@tydeu tydeu marked this pull request as ready for review June 13, 2026 21:14
@tydeu tydeu added this pull request to the merge queue Jun 14, 2026
Merged via the queue into leanprover:master with commit 7778d70 Jun 14, 2026
23 checks passed
@tydeu tydeu deleted the lake/cache-overwrite branch June 14, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-lake Lake mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lake cache unstage fails with "permission denied" when the artifact cache already holds the artifact

2 participants