Skip to content

fix: include lake-package-directory in cache key hashes#167

Open
b-mehta wants to merge 1 commit into
leanprover:mainfrom
b-mehta:fix/cache-key-package-directory
Open

fix: include lake-package-directory in cache key hashes#167
b-mehta wants to merge 1 commit into
leanprover:mainfrom
b-mehta:fix/cache-key-package-directory

Conversation

@b-mehta

@b-mehta b-mehta commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

The cache path already honors lake-package-directory, but the key and restore-keys hash root-relative lean-toolchain and lake-manifest.json. For a project whose Lake package lives in a subdirectory those globs match nothing, so both hashes are empty and the key carries no toolchain/manifest information. The restore-key then matches caches from any version, so after a toolchain or Mathlib bump a stale .lake is restored and lake exe cache get fails trying to check Mathlib out to the new revision.

This computes both hashes from lake-package-directory (default ".", unchanged behaviour for root-level projects) at all three call sites — the restore key, the restore-keys, and the save key.

Prepared by Claude Code.

b-mehta added a commit to b-mehta/Polychromatic that referenced this pull request Jun 27, 2026
The make-docs job's GitHub cache key didn't include the toolchain or
manifest hash, because lean-action computes them from the repo root
while our Lake package lives under `Lean/`. That made the restore-key
version-agnostic, so a stale `.lake` from an older Mathlib gets restored
and `lake exe cache get` then fails trying to check Mathlib out to the
new revision — which is what broke make-docs on the v4.30 bump.

This pins lean-action to a fork carrying the fix
(leanprover/lean-action#167) until it's released upstream, at which
point we switch back to the official action.
@b-mehta

b-mehta commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

The CI failure here appears transient, if someone could re-run it that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant