Skip to content

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

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

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 f7cdc8f
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a70b033e11d560008455ab1

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 453e2ef to f7cdc8f Compare August 3, 2026 15:13
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