Vendored vlt mode makes every later `vlt deploy` fail (vlt 1.7+ refuses file: dependencies), and neither the scan nor the docs say so
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 79/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js, rust
- Lĩnh vực
- cli, devtools, documentation
Hướng nghiên cứu
Đọc ghi chú về vlt trong docs/ecosystems.md quanh dòng 1044 và so sánh các giới hạn hiện có của chế độ vendored với hành vi deploy của vlt được mô tả ở đây. Ghi lại rằng vlt 1.7+ từ chối deploy với các phụ thuộc file: vendored và chế độ hosted hoạt động. Nếu thêm cảnh báo scan, hãy kiểm tra plan_wiring trong crates/socket-patch-core/src/vendor/vlt_lock.rs quanh dòng 962 và thông báo gần dòng 1171; xác nhận cảnh báo xuất hiện trong các lần scan vendored.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[agent] Found by the scheduled vlt bug-hunt routine (ledger #307).
Summary
vlt deploy <dir> (new in vlt 1.7.0) copies a project or workspace plus its production dependencies into a standalone folder, for example for a Docker image. It refuses outright any file: dependency in the production graph:
Usage Error: vlt deploy does not support file: dependencies
Found: file~.socket+vendor+npm+aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa+left-pad-1.3.0+node__modules+left-pad
Vendored vlt mode wires every patched direct dependency as exactly such a file:./.socket/vendor/npm/<uuid>/... dependency. So once a vendored scan succeeds (exit 0, success), every later vlt deploy of that project, or of any workspace member that depends on a vendored package, exits 1. The project still installs, builds and loads patched code locally, so nothing points at the cause until the deploy step in CI or the Docker build fails. Neither the scan output nor the vlt docs mention it (docs/ecosystems.md "npm: vlt notes", vendored section, ~line 1044), although they do list other vlt limits there with "use hosted mode for those".
Hosted mode is unaffected: the pinned vlt-lock.json carries into the deploy output, the deployed project loads patched code, and vlt ci inside the output also stays patched. Re-running scan --mode hosted over the vendored project (the takeover) fixes vlt deploy, so the way out exists. Users just aren't told about it.
Impact
Do no harm: a vlt project whose vlt deploy worked before the vendored scan fails it afterwards. The failure is loud, but it shows up in a later CI or Docker stage, not in the scan.
Repro (vlt 1.9.0, main cfc870f)
This uses the mock registry and patch API attached to #1494, started on :18555 and :18556, with the env from #1494.
mkdir app && cd app && git init -q
echo '{"name":"app","version":"1.0.0","main":"index.js","dependencies":{"left-pad":"1.3.0","right-pad":"1.3.0"}}' > package.json
echo '{"config":{"registries":{"npm":"http://127.0.0.1:18555/"}}}' > vlt.json
echo "console.log(require('left-pad'), require('right-pad'))" > index.js
vlt install --allow-scripts :scripts
vlt deploy ../out-before --allow-scripts :scripts # exit 0
socket-patch scan --mode vendored --yes --json # exit 0, success
vlt ci --allow-scripts :scripts && node index.js # patched patched
vlt deploy ../out --allow-scripts :scripts # exit 1: "vlt deploy does not support file: dependencies"
socket-patch scan --mode hosted --yes --json # takeover, exit 0
vlt ci --allow-scripts :scripts
vlt deploy ../out2 --allow-scripts :scripts && (cd ../out2 && node index.js) # exit 0, patched patched
For the workspace shape (root vlt.json workspaces: ["packages/*"], member a → left-pad + b: workspace:*, member b → rp: npm:[email protected]), vlt deploy -w packages/a ../out fails the same way after a vendored scan, and passes (patched) after a hosted scan.
The refusal lives in vlt's deploy command. It throws EUSAGE for any reached node whose DepID tuple type is file, and it does so on purpose: it can't relocate a path dependency.
Expected vs actual
- Expected: a mode change that breaks a vlt workflow that worked before is either avoided or stated up front.
docs/ecosystems.mdalready lists the vlt cases vendored mode can't serve and points them to hosted mode;vlt deploybelongs on that list. The vendored scan, or at least the docs, should say that vlt ≥ 1.7vlt deployrefuses vendored (file:) dependencies and that hosted mode works with it. - Actual: the scan exits 0 with no warning, and the docs don't mention
deploy. The first sign is a failedvlt deploy.
Versions (Linux)
| socket-patch | vlt | vendored → vlt deploy |
hosted → vlt deploy |
|---|---|---|---|
main cfc870f |
1.9.0 | fail (root ×2, workspace ×1) | pass, patched (root, workspace) |
main cfc870f |
1.7.0 | fail | (not run) |
| v5.1.0 | 1.9.0 | fail | pass, patched |
| any | ≤ 1.6.x | n/a (no deploy command) |
n/a |
It isn't a regression in socket-patch: the incompatibility appeared when vlt 1.7.0 added deploy. The behavior comes from vlt itself, so macOS and Windows almost certainly behave the same, but I didn't probe them.
Suspect code / docs
crates/socket-patch-core/src/vendor/vlt_lock.rs:962(plan_wiring), which moves the importer edges andpackage.jsonspecs tofile:. A vlt-specific advisory could go next tovendor_vlt_reinstall_required(vlt_lock.rs:1171).docs/ecosystems.md:1044, the "Vendored: directory artifacts" paragraph of the vlt notes.
Related, same class on other managers: #2263 (pnpm 12 file: refusal), #2326 (vendored gems in Docker layers).
Generated by Claude Code
- Ngôn ngữ chính
- Rust
- Star
- 9
- Fork
- 2
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 232
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SocketDev/socket-patch
-
agent:triaged bug bughunt pm:bazel priority:p3 ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SocketDev/socket-patch#2386 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit bug priority:p1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
SocketDev/socket-patch#2364 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit bug priority:p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
SocketDev/socket-patch#2346 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged bug bughunt pm:bundler priority:p1 ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
SocketDev/socket-patch#2326 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The unit test for "every jar copy must be patched" passes when VEX checks only the first copyĐang mởagent:triaged arch-audit priority:p3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
SocketDev/socket-patch#2319 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của SocketDev/socket-patch
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
BurntSushi/jiff#755 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
After the kernel is given up on, a new import leaves "Importing…" and its Cancel on the status lineĐang mởbug help wanted priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sawhorse3d/sawhorse#163 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
MartinPTielemans/ilo#4607 ·