Skip to content

[rush] Add pnpm 11 support: allowBuilds in pnpm-workspace.yaml#5817

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/rush-51751-pnpm-1111-fix
Draft

[rush] Add pnpm 11 support: allowBuilds in pnpm-workspace.yaml#5817
Copilot wants to merge 2 commits into
mainfrom
copilot/rush-51751-pnpm-1111-fix

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 4, 2026

pnpm 11 removed support for the pnpm field in package.json (including onlyBuiltDependencies/neverBuiltDependencies) and replaced it with allowBuilds: Record<string, boolean> in pnpm-workspace.yaml. Rush was still writing the old fields, causing [ERR_PNPM_IGNORED_BUILDS] on every install, and rush-pnpm approve-builds would run but never update any config files.

Changes

New globalAllowBuilds config field (pnpm 11+)

  • Added globalAllowBuilds?: Record<string, boolean> to pnpm-config.json schema and PnpmOptionsConfiguration
  • Written to allowBuilds in the generated pnpm-workspace.yaml during installation
  • true = package allowed to run build scripts; false = explicitly denied
// common/config/rush/pnpm-config.json
{
  "globalAllowBuilds": {
    "esbuild": true,
    "@parcel/watcher": true,
    "fsevents": false
  }
}

Backward compatibility

When using pnpm 11 with the old globalOnlyBuiltDependencies/globalNeverBuiltDependencies fields, Rush automatically converts them to allowBuilds format (entries become true/false respectively) and emits a deprecation warning directing users to migrate to globalAllowBuilds.

InstallHelpers.ts

For pnpm ≥ 11.0.0, skips writing neverBuiltDependencies/onlyBuiltDependencies to common/temp/package.json (pnpm 11 ignores the pnpm field entirely).

approve-builds command

For pnpm ≥ 11.0.0, rush-pnpm approve-builds now correctly reads the updated allowBuilds map from pnpm-workspace.yaml (written by pnpm approve-builds) and persists it back to pnpm-config.json as globalAllowBuilds, then re-runs rush update. Previously this was reading from package.json which pnpm 11 no longer updates.

Copilot AI changed the title [WIP] Fix compatibility issue between Rush 5.175.1 and pnpm 11.1.1 [rush] Add pnpm 11 support: allowBuilds in pnpm-workspace.yaml Jun 4, 2026
Copilot AI requested a review from iclanton June 4, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

[rush] Rush 5.175.1 and pnpm 11.1.1 do not work together (build scripts issues)

2 participants