Skip to content

fix(patchy): a failed install on pnpm 12 says why - #561

Merged
allisonmahmood merged 4 commits into
mainfrom
fix/patchy-pnpm12-install-errors
Oct 7, 2026
Merged

allisonmahmood merged 4 commits into
mainfrom
fix/patchy-pnpm12-install-errors

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

When patchy init or refresh can't install dependencies on pnpm 12, the CLI says only pnpm: Error: × installing dependencies. pnpm 12 is what npm i -g pnpm installs today, so new users and their agents get no reason. pnpm 12's default output puts the reason in a chain of causes after that first line, wrapped at about 80 columns and often without an ERR_PNPM_ code, and the CLI relays only the first line.

The CLI now runs pnpm install with NO_GRAPHICS=1. pnpm 12 then prints one unwrapped Caused by: line per cause and puts its code on a diagnostic code: line; pnpm 11 ignores the variable. installFailureReason relays the code and the causes, for example pnpm: Failed to resolve dependency tree: Failed to resolve dependency: Tarball server returned HTTP 404 for http://…/patchy-0.0.1.tgz. pnpm 11 output is relayed as before.

Each part is still redacted. Rejoining the wrapped default output can't be made safe: a wrap inside a URL's scheme hides the URL from redaction. The unwrapped output avoids that. Redaction also closes older gaps: a URL now runs to the next ASCII whitespace, so an uppercase scheme or a quote or non-breaking space in its path no longer leaks the query, and a password containing @ is stripped in full. The one visible change for pnpm 11: a quoted URL with a query loses its closing quote.

Found while moving the repo to pnpm 12 (#560), whose CI runs the CLI's installs on pnpm 12. The refresh-failure test passes on both pnpm 11 and 12 locally.

Made by Claude Opus 5.5 via Claude Code in T3 Code; reviewed by GPT 6.1 Sol via codex.

@github-actions github-actions Bot added area:cli Touches the cli area area:docs Touches the docs area size:m 100-500 changed lines labels Oct 6, 2026
@github-actions github-actions Bot added size:s Under 100 changed lines size:m 100-500 changed lines and removed size:m 100-500 changed lines size:s Under 100 changed lines labels Oct 6, 2026
@allisonmahmood
allisonmahmood force-pushed the fix/patchy-pnpm12-install-errors branch from 3615d56 to 64b18b4 Compare October 6, 2026 21:52
allisonmahmood and others added 4 commits October 7, 2026 02:34
pnpm 12 reports a failed install as `× installing dependencies` followed
by its causes, wrapped across lines, often with no ERR_PNPM_ code. The
CLI relayed only that first line, so init and refresh failures on pnpm 12
gave no reason. The relay now rejoins pnpm 12's causes, after its code
when there is one, and still redacts every URL; a wrap inside a URL is
closed up first so a query can't slip past the redaction.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Rejoining pnpm 12's wrapped diagnostic could not be made safe: a wrap
inside the URL scheme hid the URL from redaction. NO_GRAPHICS makes pnpm
12 print one `Caused by:` line per cause and its code on its own line,
and pnpm 11 ignores it. The relay reads those lines, takes the code only
from the code line, and redacts URLs with any scheme case or path
characters.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A URL in a relayed pnpm error now runs to the next ASCII whitespace, so
a raw quote or non-breaking space in its path no longer leaves its query
behind, and credentials are stripped through the last `@` before the
path. Causes are read only from pnpm 12's narrated report, so a pnpm 11
message that happens to contain `Caused by:` relays as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the fix/patchy-pnpm12-install-errors branch from 64b18b4 to 71da1fa Compare October 7, 2026 00:34
@allisonmahmood
allisonmahmood merged commit 6f5a38d into main Oct 7, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the fix/patchy-pnpm12-install-errors branch October 7, 2026 00:43
allisonmahmood added a commit that referenced this pull request Oct 7, 2026
The repo pins pnpm 11.28.3 (packageManager, engines, mise), while pnpm
12 has been the stable line since August; `latest` is 12.9.1.

This moves all three pins and the server image build docs to 12.9.1.
Most of 12.0's breaking changes don't touch this workspace: no git
dependencies, no `--frozen-lockfile false`, and pnpm 12's stricter
`pnpm-workspace.yaml` validation accepts every setting we use. Two did:

- **The lockfile.** When pnpm manages its own version, pnpm 12 writes
itself into a new first lockfile document, and GitHub's dependency graph
still reads only that first document
([dependabot/dependabot-core#15904](dependabot/dependabot-core#15904),
open). On this repo that would show zero dependencies, close the open
security alerts and let `dependency-review` pass blind. `pmOnFail:
ignore` stops pnpm switching versions itself, so the lockfile stays
byte-identical to pnpm 11's. mise, CI (`pnpm/action-setup`) and corepack
already install the `packageManager` version, and `engines.pnpm` still
refuses pnpm 11.
- **The image deploy.** pnpm 12 fails `deploy --prod` when a workspace
patch goes unused. Our one patch (`async-exit-hook`) fixes a test
dependency, so the image build's production deploy passes
`allow-unused-patches`; regular installs keep the check.

- **The CLI's offline test registry.** It packs installed packages with
`tar`, and pnpm 12 hard-links identical store files to one inode, so
three of TypeScript's identical lib files went in as hard-link entries,
which pnpm 12 drops on install. That broke the tier 1 starter's
typecheck in the CLI tests. Real registry tarballs never carry hard
links; the fixture now passes `--hard-dereference`.

The CLI-driven patch repo installs in CI now run on pnpm 12, the version
a new user installs today. That surfaced a real CLI bug for pnpm 12
users, fixed separately in #561: a failed install said only `×
installing dependencies`. That fix landed first, as #561. Patch repos
are unaffected: they use whatever pnpm the user has.

Made by Claude Opus 5.5 via Claude Code in T3 Code; reviewed by GPT 6.1
Sol via codex.

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
allisonmahmood added a commit that referenced this pull request Oct 7, 2026
What's new for this deploy, release 7 (`b765183..48704b0`).

- Fixed: **A patch that fails to set up says why** (#561)
- Behind the scenes: the libraries Patchy is built on are up to date
(#558)
- Behind the scenes: Patchy builds with the newest version of its
package manager (#560)
- No line: Dependabot's workerd ignore (#557) is tooling churn

The range also holds #573, release 6's own What's new entry, left out as
usual.

Made by Claude Opus 5.5 via Claude Code in T3 Code.

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli Touches the cli area area:docs Touches the docs area size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant