Skip to content

Link unambiguous workspace peers in pnpm installs - #390

Draft
aghiles-dd wants to merge 1 commit into
yarnpkg:mainfrom
aghiles-dd:aghiles/fix-pnpm-local-peer-links
Draft

aghiles-dd wants to merge 1 commit into
yarnpkg:mainfrom
aghiles-dd:aghiles/fix-pnpm-local-peer-links

Conversation

@aghiles-dd

Copy link
Copy Markdown

Problem

With the pnpm linker, a virtual workspace's peer dependencies are registered under its virtual store path even though the workspace executes from its shared source directory. For example, if workspace a depends on workspace b, and b declares a as a peer, Yarn reports that peer as provided but Node cannot resolve it from b.

Change

Add peer links to the physical workspace directory only when every consumed virtual context agrees on the physical target. Keep existing direct dependencies and peer fallbacks authoritative. Ambiguous or missing peer contexts keep their existing placement: this does not attempt to support multiple incompatible peer environments in one shared source directory.

Ordinary dependency placement is unchanged.

Validation

  • Built the release binary with Rust 1.93.0.
  • The new cycle and matching-peer cases fail against released 6.0.0-rc.23.
  • Full pnpm acceptance suite: 26 passed, two Windows-only tests skipped on macOS.
  • Cases cover cold/warm installs, ordinary virtual dependencies, matching peers, conflicting peers, missing peers, and declared dependency fallbacks.
  • ESLint and diff whitespace checks passed.

Validated the local binary against web-ui with unchanged manifests and lockfile: immutable pnpm install succeeds, Node resolves the previously missing cyclic workspace peer, the 15,838-context inventory has zero unresolved edges/unexplained absences, three graph consumers run, and 74 focused tests pass. The repository was restored to its configured PnP install afterward.

@netlify

netlify Bot commented Oct 28, 2026

Copy link
Copy Markdown

👷 Deploy request for yarn-v6 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit bce225e

@github-actions

Copy link
Copy Markdown

⏱️ Benchmark Results

gatsby install-full-cold

Metric Base Head Difference
Mean 4.802s 4.716s -1.79% ✅
Median 4.801s 4.706s -1.97% ✅
Min 4.653s 4.640s
Max 5.021s 4.842s
Std Dev 0.086s 0.049s
📊 Raw benchmark data (gatsby install-full-cold)

Base times: 4.805s, 4.812s, 4.709s, 4.850s, 4.778s, 4.653s, 4.907s, 4.839s, 4.990s, 4.879s, 4.728s, 4.854s, 4.915s, 4.834s, 4.816s, 4.697s, 4.757s, 5.021s, 4.768s, 4.747s, 4.838s, 4.723s, 4.706s, 4.776s, 4.797s, 4.725s, 4.816s, 4.679s, 4.851s, 4.791s

Head times: 4.842s, 4.735s, 4.755s, 4.660s, 4.726s, 4.768s, 4.712s, 4.640s, 4.692s, 4.726s, 4.813s, 4.687s, 4.657s, 4.681s, 4.697s, 4.715s, 4.653s, 4.723s, 4.683s, 4.739s, 4.690s, 4.680s, 4.733s, 4.695s, 4.747s, 4.680s, 4.682s, 4.701s, 4.747s, 4.826s


gatsby install-cache-only

Metric Base Head Difference
Mean 1.573s 1.574s +0.04% ⚠️
Median 1.543s 1.548s +0.32% ⚠️
Min 1.513s 1.517s
Max 2.167s 1.825s
Std Dev 0.118s 0.072s
📊 Raw benchmark data (gatsby install-cache-only)

Base times: 1.665s, 1.562s, 1.541s, 1.571s, 1.540s, 1.535s, 1.545s, 1.529s, 1.561s, 1.576s, 1.575s, 1.545s, 1.544s, 1.539s, 2.167s, 1.532s, 1.545s, 1.546s, 1.553s, 1.532s, 1.534s, 1.524s, 1.513s, 1.684s, 1.571s, 1.532s, 1.533s, 1.532s, 1.531s, 1.529s

Head times: 1.542s, 1.557s, 1.557s, 1.645s, 1.517s, 1.551s, 1.535s, 1.539s, 1.532s, 1.624s, 1.542s, 1.746s, 1.550s, 1.825s, 1.703s, 1.647s, 1.543s, 1.531s, 1.537s, 1.533s, 1.552s, 1.551s, 1.530s, 1.525s, 1.546s, 1.540s, 1.557s, 1.541s, 1.549s, 1.560s


gatsby install-cache-and-lock (warm, with lockfile)

Metric Base Head Difference
Mean 0.476s 0.532s +11.74% ⚠️
Median 0.476s 0.483s +1.56% ⚠️
Min 0.469s 0.473s
Max 0.483s 1.090s
Std Dev 0.004s 0.153s
📊 Raw benchmark data (gatsby install-cache-and-lock (warm, with lockfile))

Base times: 0.479s, 0.476s, 0.469s, 0.469s, 0.471s, 0.472s, 0.475s, 0.475s, 0.470s, 0.483s, 0.474s, 0.483s, 0.479s, 0.478s, 0.478s, 0.475s, 0.478s, 0.472s, 0.478s, 0.482s, 0.480s, 0.483s, 0.473s, 0.474s, 0.474s, 0.476s, 0.478s, 0.476s, 0.469s, 0.472s

Head times: 0.483s, 0.482s, 0.478s, 0.479s, 0.477s, 0.891s, 0.943s, 1.090s, 0.479s, 0.488s, 0.482s, 0.484s, 0.488s, 0.490s, 0.490s, 0.483s, 0.488s, 0.482s, 0.481s, 0.490s, 0.488s, 0.486s, 0.485s, 0.477s, 0.478s, 0.484s, 0.477s, 0.477s, 0.475s, 0.473s

This branch was successfully deployed

1 active deployment
test-reports — bce225ed Deployed Oct 28, 2026 by aghiles-dd via Reporting test results #1478
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