Skip to content

Cache pinned Corepack package managers separately - #12

Merged
Harold Hunt (huntharo) merged 3 commits into
mainfrom
feat/cache-corepack
Sep 17, 2026
Merged

Harold Hunt (huntharo) merged 3 commits into
mainfrom
feat/cache-corepack

Conversation

@huntharo

@huntharo Harold Hunt (huntharo) commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

I added a separate cache for pinned pnpm and Yarn executables. In PwrGit's Windows job, the dependency store restored successfully, but Corepack failed downloading pnpm itself. With a warm Corepack cache, activation can reuse that executable.

I restore an action-managed COREPACK_HOME before activation and save it immediately after successful preparation, before dependency installation. The key includes OS, architecture, and the full manager version including any integrity hash, independently of the lockfile and dependency cache suffix. Activation and version verification still run. Mutable selectors remain uncached, and lookup-only dependency hits still skip Corepack setup.

Validation

  • I ran all 93 local tests successfully and checked the diff for whitespace errors.
  • I added coverage for cache identity, mutable selectors, and restore/save ordering.
  • I extended the existing Linux/macOS/Windows pnpm and Yarn fixtures to delete COREPACK_HOME before restoring, then require successful activation with COREPACK_ENABLE_NETWORK=0. GitHub Actions results are pending.

Compatibility controls

I added default-on cache-corepack, with cache-corepack: "false" as an opt-out. I preserve a caller-supplied nonempty COREPACK_HOME and skip action-managed Corepack restore/save for that directory. Homes exported by previous invocations in the same job remain action-managed. Activation and dependency caching keep their existing behavior.

I ran all 97 local tests successfully, including execution of the inline resolver with opt-out/custom-home environments and repeated-invocation helper coverage. Cross-platform CI is rerunning for commit 3552259. The earlier offline harness and real PwrGit cold/warm runs validated f5895f6, before these compatibility controls.

@huntharo
Harold Hunt (huntharo) merged commit f51ed2b into main Sep 17, 2026
16 checks passed
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