Skip to content

fix(install): verify modern Yarn hashes against the CLI binary - #2227

Open
leslieeilsel wants to merge 1 commit into
voidzero-dev:mainfrom
leslieeilsel:agent/yarn-corepack-hash
Open

fix(install): verify modern Yarn hashes against the CLI binary#2227
leslieeilsel wants to merge 1 commit into
voidzero-dev:mainfrom
leslieeilsel:agent/yarn-corepack-hash

Conversation

@leslieeilsel

Copy link
Copy Markdown

Summary

  • verify Yarn 2+ packageManager hashes against the extracted bin/yarn.js, matching Corepack
  • re-verify the same binary when using an existing Vite+ package-manager cache
  • preserve tarball hash verification for npm, pnpm, and Yarn Classic

Why

Corepack writes Yarn 2+ integrity pins from the extracted CLI binary, while Vite+ previously compared them with the npm tarball hash. This made valid Corepack pins fail with a cold Vite+ cache and appear to pass with a warm cache because the cached artifact was not re-verified.

Fixes #2209

Test Plan

@netlify

netlify Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit c3609f2
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a75a2e3b4f08100082026f3

@leslieeilsel
leslieeilsel force-pushed the agent/yarn-corepack-hash branch 2 times, most recently from f7cdc8f to 26615d1 Compare August 5, 2026 13:19
@leslieeilsel
leslieeilsel marked this pull request as ready for review August 7, 2026 09:03
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copy link
Copy Markdown
Author

Local verification results (run on macOS, nightly-2026-08-02)

Since the CI workflows are waiting for maintainer approval, I ran the checks locally on commit 26615d1:

  • cargo test -p vp_pm_cli --lib734 passed, 0 failed (2 ignored), including package_manager::tests and request::tests
  • cargo fmt --check — clean
  • cargo clippy -p vp_pm_cli --lib -- -D warnings — no warnings

One note: the PR description's Test Plan references vite_install, but the changed crate is vp_pm_cli (the commands above use the actual crate name).

Could a maintainer please approve the workflow runs? Thanks! 🙏

Added verification for Yarn binary hash for modern Yarn installations. Updated download logic to handle Yarn 2+ package manager correctly.

Signed-off-by: Leslie Lau <1178273431@qq.com>
@leslieeilsel
leslieeilsel force-pushed the agent/yarn-corepack-hash branch from 07ce1cf to c3609f2 Compare August 7, 2026 09:18
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.

vp install rejects a Corepack-written packageManager pin: vp hashes the .tgz, Corepack hashes the extracted binary

1 participant