Hosted pnpm registry route is refused for every catalog: dependency, and the warning wrongly says pnpm would not override it
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 63/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- rust
- Bereich
- build-system, devtools
Rechercherichtung
Start with crates/socket-patch-core/src/formats/pnpm/registry_alias.rs, especially override_applies around lines 695–700, and the shapes_outside_the_fixtures_are_refused unit test. Check how the route handles catalog entries in the lockfile and compare it with the pnpm 11.29.0 and 12.23.0 behavior described in the issue. Done means catalog importers are routed with the lockfile rewritten correctly, or the fallback warning accurately describes the unsupported lock shape.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
[agent] Found by the scheduled pnpm bug-hunt routine (ledger #303).
Summary
The hosted pnpm registry route (pnpm 11.20+, #2167) is refused for any patched package that a workspace importer declares through catalog:. The scan falls back to trustLockfile: true, which turns off pnpm's lockfile verification for the whole lock, and the warning gives the user the wrong reason:
Per-package registry verification was not set up because pnpm-lock.yaml locks [email protected] for importer
packages/athrough the specifiercatalog:, which pnpm would not override; the hosted patches rely ontrustLockfileinstead.
pnpm does override a catalog dependency. With the scan's own namedRegistries + overrides entries added to the same workspace file by hand, pnpm 11.29.0 and 12.23.0 both route the catalog dependency to the patch's registry:
- the patched bytes are installed;
- a fresh-store
--frozen-lockfileinstall passes; pnpm dedupeleaves the lock byte-identical.
The lock pnpm writes takes the routed package out of catalogs: and gives the importer specifier: socket-bbbbbbbb:1.0.0. The two releases write the same lock.
Impact: catalogs are the standard way to share versions in a pnpm 11/12 monorepo, and such projects never get per-package verification. Instead they silently get the weaker whole-lock trustLockfile. The warning's stated reason sends the user in the wrong direction: there's nothing about pnpm they can change to get the route.
Repro
Use the same local patch-server and registry stand-in as the registry-route legs of crates/socket-patch-cli/tests/e2e_redirect_pnpm_build.rs. The mock script is in #2263. Patch B is for [email protected] and carries an npmRegistryUrl.
export SOCKET_PATCH_SERVER_URL=http://127.0.0.1:18080 SOCKET_NPM_REGISTRY=http://127.0.0.1:18081
mkdir -p proj/packages/a && cd proj
echo '{"name":"root","private":true,"packageManager":"[email protected]"}' > package.json
echo '{"name":"a","version":"1.0.0","dependencies":{"mid":"catalog:","peer-user":"catalog:","host":"1.0.0"}}' > packages/a/package.json
printf 'packages:\n - "packages/*"\ncatalog:\n mid: 1.0.0\n peer-user: 1.0.0\n' > pnpm-workspace.yaml
echo 'registry=http://127.0.0.1:18081/' > .npmrc
pnpm install
socket-patch scan --mode hosted --yes --api-url http://127.0.0.1:18080 --org test-org --api-token fake
# pnpm-workspace.yaml gets `trustLockfile: true`; the warning says pnpm "would not override" catalog:
Check what pnpm itself does with the route. On a fresh copy of the unpatched project:
cat >> pnpm-workspace.yaml <<'Y'
namedRegistries:
socket-bbbbbbbb: http://127.0.0.1:18080/patch/npm/peer-user/1.0.0/<token>/bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb/
overrides:
'[email protected]': 'socket-bbbbbbbb:1.0.0'
Y
pnpm install # importer packages/a: peer-user specifier socket-bbbbbbbb:1.0.0, patched bytes installed
Expected vs actual
- Expected:
docs/ecosystems.md("The registry route") says that when every hosted pin has an address and the pnpm pins prove 11.20+, the CLI routes each patched release. The fallback reasons it lists are a user override, unproven pins, a Bazel hub, or "a workspace file or a lock entry the edit cannot follow". Either the route should cover acatalog:importer (rewrite the lock the way pnpm does: drop the routed entry fromcatalogs:and respell the importer), or the warning should say this is a lock shape the edit doesn't follow yet. It shouldn't claim that pnpm won't override it. - Actual: the route is refused and the stated reason is false.
Versions
Linux, main cfc870f. The scan's refusal reproduced 3 times (12.23.0 with CRLF and LF workspace files, and 11.29.0). Hand-written route results:
| pnpm | scan with catalog: importer |
pnpm with the route added by hand |
|---|---|---|
| 11.29.0 | trustLockfile, "would not override" |
routed, patched, frozen fresh-store install passes, dedupe stable |
| 12.23.0 | trustLockfile, "would not override" |
same; lock identical to 11.29.0's |
This isn't a regression: the route didn't exist in v5.1.0. I didn't test named catalogs (catalog:<name>). I haven't tested macOS or Windows; nothing here is platform-specific.
Suspect code
crates/socket-patch-core/src/formats/pnpm/registry_alias.rs:695-700:override_appliesreturns not-Some(true)forcatalog:, and the error text says "which pnpm would not override".- The unit test
shapes_outside_the_fixtures_are_refused(around line 1750) listscatalog:besidelatest/workspace:*as a shape pnpm wouldn't override.
Generated by Claude Code
- Vorherrschende Sprache
- Rust
- Sterne
- 9
- Forks
- 2
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 313
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus SocketDev/socket-patch
-
agent:triaged arch-audit bug priority:p2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
SocketDev/socket-patch#2306 ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged arch-audit bug priority:p3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
SocketDev/socket-patch#2296 ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:needs-human agent:triaged ci-janitor priority:p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
SocketDev/socket-patch#2270 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged arch-audit bug priority:p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
SocketDev/socket-patch#2259 ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged arch-audit priority:p3 refactor
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
SocketDev/socket-patch#1860 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in SocketDev/socket-patch
Ähnliche Issues
-
Bash init calls `cygpath` unconditionally on Windows, which breaks non-Cygwin shells like `brush`Evtl. vergeben @iliqiliev hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ajeetdsouza/zoxide#1381 ·
Maintainer antworten meist innerhalb von 5 Tagen
-
triage
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
kornia/kornia-rs#1416 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
paritytech/revive#749 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
swc-project/swc-next-issues#1043 ·