Vendored pnpm from the root of a sharedWorkspaceLockfile: false workspace fails with vendor_lock_entry_not_found and tells the user to run pnpm install, which cannot help
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Read crates/socket-patch-core/src/vendor/pnpm_lock.rs around line 896 and compare the parallel error handling in crates/socket-patch-core/src/vendor/pnpm_lock_legacy.rs around line 309. Then inspect the existing per-member lock discovery used by hosted mode and the vendor_pnpm_settings_elsewhere contract. Done means root invocation reports the per-member-lock limitation and points to --mode hosted, with regression coverage for this workspace layout.
索引モデルが issue の本文から書いたものです。
説明
[agent] Found by the scheduled pnpm bug-hunt routine (ledger #303).
Summary
In a pnpm workspace that keeps one lock per member (sharedWorkspaceLockfile: false), vendoring a package that only a member depends on, run from the workspace root (where .socket/ lives), fails with vendor_lock_entry_not_found. The message tells the user to run pnpm install:
Error: Cannot vendor pkg:npm/[email protected]: pnpm-lock.yaml has no packages entry for [email protected] — make sure the package is installed and locked (`pnpm install`) before vendoring
Vendored 0 packages; 1 failed.
The package is installed and locked. It's in packages/a/pnpm-lock.yaml, and the root lock has only importers: {.: {}}. Running pnpm install as told changes nothing, and the next vendor fails the same way.
Vendored mode can't wire a member with its own lock. From the member directory, the CLI says so: vendor_pnpm_settings_elsewhere, "… vendored mode cannot wire a member with its own lockfile — use --mode hosted". Run from the root, the same layout gets a misleading "not installed" error instead. Hosted mode does support this layout from the root (CLI_CONTRACT "pnpm per-member locks (#492)").
Impact: friction only. Nothing is written and the exit code is 1. But the suggested remedy doesn't work when followed, and nothing points the user to --mode hosted, the mode that works. The yarn classic version of this message was fixed in #857.
Repro
Linux, Node 22.23.5, main cfc870f. These are real packages from npmjs. The vendored artifact comes from the repo's prebuilt_common fixture server, the same one e2e_vendor_pnpm_build.rs uses, set through SOCKET_VENDOR_URL.
mkdir proj && cd proj
echo '{"name":"proj","private":true,"dependencies":{}}' > package.json
mkdir -p packages/a && echo '{"name":"a","version":"1.0.0","dependencies":{"minimist":"1.2.2"}}' > packages/a/package.json
printf 'packages:\n - packages/*\nsharedWorkspaceLockfile: false\n' > pnpm-workspace.yaml
pnpm install # writes pnpm-lock.yaml (importers: {.: {}}) and packages/a/pnpm-lock.yaml
# stage .socket/manifest.json + blob for pkg:npm/[email protected] (package/index.js), as e2e_vendor_pnpm_build.rs stage_patch does
socket-patch vendor --json # exit 1, events[0].errorCode = vendor_lock_entry_not_found
pnpm install # the suggested remedy: "Done", no change
socket-patch vendor # same error
Expected vs actual
- Expected: a refusal that names the real cause and the way forward. For example, the member's own lock (
packages/a/pnpm-lock.yaml) holds the package, vendored mode can't wire a member with its own lock, and the user should use--mode hosted. That's whatvendor_pnpm_settings_elsewheresays for the same layout from the member directory (CLI_CONTRACTvendor_pnpm_settings_elsewhere). Or, if the root crawl can't tell, the remedy text shouldn't claim the package isn't installed. - Actual:
vendor_lock_entry_not_foundwith the "install and lock it (pnpm install)" remedy. That remedy is a no-op here.
Versions
| pnpm | vendor from the workspace root |
|---|---|
| 12.23.0 | misleading vendor_lock_entry_not_found (3 runs, including after the suggested pnpm install) |
| 11.29.0 | same (2 runs) |
pnpm 10 and older read the setting from .npmrc (shared-workspace-lockfile=false), and I haven't tested them. This isn't specific to macOS or Windows.
Suspect code
crates/socket-patch-core/src/vendor/pnpm_lock.rs:896emits the generic remedy when the root lock lacks the package. It doesn't check whether the workspace has per-member locks (the hosted side reads them through the #492 member-lock discovery). The same text is incrates/socket-patch-core/src/vendor/pnpm_lock_legacy.rs:309.
Generated by Claude Code
- 主要言語
- Rust
- スター
- 9
- フォーク
- 2
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 313
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SocketDev/socket-patch のほかの issue
-
agent:triaged arch-audit bug priority:p2
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
SocketDev/socket-patch#2306 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged arch-audit bug priority:p3
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
SocketDev/socket-patch#2296 ·
メンテナーはふだん 1 日以内に返信
-
agent:needs-human agent:triaged ci-janitor priority:p1
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SocketDev/socket-patch#2270 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged arch-audit bug priority:p1
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
SocketDev/socket-patch#2259 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged arch-audit priority:p3 refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
SocketDev/socket-patch#1860 ·
メンテナーはふだん 1 日以内に返信
SocketDev/socket-patch の issue をすべて見る
似ている issue
-
Bash init calls `cygpath` unconditionally on Windows, which breaks non-Cygwin shells like `brush`対応中かも @iliqiliev が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ajeetdsouza/zoxide#1381 ·
メンテナーはふだん 5 日以内に返信
-
triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
kornia/kornia-rs#1416 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
paritytech/revive#749 ·
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
swc-project/swc-next-issues#1043 ·