Skip to content

Update build-tools to pnpm 11#27509

Open
CraigMacomber wants to merge 10 commits into
microsoft:mainfrom
CraigMacomber:pnpm11-build-tools
Open

Update build-tools to pnpm 11#27509
CraigMacomber wants to merge 10 commits into
microsoft:mainfrom
CraigMacomber:pnpm11-build-tools

Conversation

@CraigMacomber

Copy link
Copy Markdown
Contributor

Description

Update build-tools to pnpm 11

Reviewer Guidance

The review process is outlined on this wiki page.

Copilot AI review requested due to automatic review settings June 8, 2026 17:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (251 lines, 11 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Comment thread scripts/pack-packages.sh
Comment on lines +22 to +23
flub exec --no-private --concurrency=1 --releaseGroup $RELEASE_GROUP -- "$PACKAGE_MANAGER pack"
flub exec --no-private --concurrency=1 --releaseGroup $RELEASE_GROUP -- "mv -t $STAGING_PATH/pack/tarballs/ ./*.tgz"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This use of && seemed harmful to me, as it obscured the error (this script did not fail). Claude agreed:

These are separate statements (not chained with &&) so that set -e aborts the script on the first
failure. Under set -e, a failing command that is not the last link of an && chain is exempt from
exit-on-error, so chaining would silently swallow a failed pnpm pack and let the script continue.

The && below is also removed for the same reason.

Comment thread scripts/pack-packages.sh
# the working tree. This cleanup deliberately runs here rather than in a package "postpack" script: under
# pnpm >=11, `pnpm pack` re-stats every "files" entry after postpack runs and fails with ENOENT if postpack
# deleted one. Running it here, after all packs complete, avoids that while still cleaning the working tree.
flub exec --no-private --releaseGroup $RELEASE_GROUP -- "pnpm run --if-present clean:manifest"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the issue noted above, this was a bit nasty to root cause, but this fix seems reasonable.

I think pnpm 11 checking for odd changes during pack is good to help ensure packaged content reflects what it looks like was supposed to be in the package, which is nice for auditability/security against attacks which do strange things during publish (like the xz utils attack famously), so I don't think their policy change is a bug, just improved strictness which we violated and needed this change to satisfy.

type: string

# The version of the build tools to install, or "repo" to install the one from the repository.
# If "repo" is selected, this includes a global install of what ever version of pnpm build-tools uses.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't new, but it caused some complications in this change as this now installs pnpm 11, which broke tests-tools by overriding its pnpm 10 install.

CraigMacomber added a commit that referenced this pull request Jun 12, 2026
## Description

This code used to simply try and parse an empty string as JSON and give
an unexpected end of JSON syntax error if there was some issue, like
those caused by include-install-build-tools overwriting the pnpm version
causing pnpm to try and install a different version which failed due to
network isolation (Noted in
#27537 and blocking
#27509). Now it actually
outputs the errors in such cases.
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.

2 participants