GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||
GeezerVison is showing github.com — Fix CRLF bin e2e failing under npm 11 on macOS by mikolalysenko · Pull Request #1896 · SocketDev/socket-patch Conversation
|
| npm | node_modules/.bin |
installed bin/cli.js shebang |
test on main |
|---|---|---|---|
| 10.9.4 | empty | \r\n |
pass |
11.21.1 (SOCKET_PATCH_NPM_E2E_BIN) |
cli.js |
\n |
fails, same assertion as CI |
Test-only change. The test now checks whether npm linked the bin (node_modules/.bin/<name> exists):
NPM_BIN_BEFORE/NPM_BIN_AFTER, the same constants npm_agent_patches_crlf_shebang_bin_npm_rewrote uses).In both cases it still checks apply, apply --check and a byte-exact rollback. A new assertion fails if --no-bin-links ever links the bin, so the unlinked #1804 path stays covered on every npm version. If npm linked the bin without rewriting it, or rewrote it without linking it, the test still fails. No assertions were removed.
cargo test -p socket-patch-cli --test e2e_redirect_npm_build -- --ignored crlf (all 3 CRLF tests) passes with npm 10.9.4 and with npm 11.21.1.npm_agent_keeps_crlf… 10 times under each npm version: 0 failures out of 20.cargo clippy -p socket-patch-cli --test e2e_redirect_npm_build -- -D warnings reports no new warnings. The only errors are two duplicate_mod lints that already fire on main for this test target; CI's clippy job doesn't build test targets.rustfmt run on the touched file only.The macOS leg only runs on nightly and workflow_dispatch, so the next nightly will confirm the fix in CI.
Nothing removed or moved. The test still runs on the e2e Ubuntu leg (npm 10) and the nightly e2e-macos leg (npm 11).
Generated by Claude Code
Note
Low Risk
Test-only change in an ignored e2e; no production code or CLI behavior is modified.
Overview
Fixes nightly macOS e2e failures where npm_agent_keeps_crlf_shebang_of_bin_npm_did_not_link assumed npm always leaves CRLF shebangs on directories.bin installs from a file: tarball. npm 11 links those bins into node_modules/.bin and rewrites the shebang like fixBin; npm 10 did not.
The test now detects whether npm linked the expected .bin entry and picks baseline bytes accordingly: untouched CRLF when unlinked (--no-bin-links or npm 10-style behavior), LF shebang (NPM_BIN_*) when linked. It still asserts byte-exact apply, apply --check, and rollback, and fails if --no-bin-links ever creates a link. Doc comments were updated to document npm 10 vs 11.
Reviewed by Cursor Bugbot for commit 9d7d4cb. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
npm_agent_keeps_crlf_shebang_of_bin_npm_did_not_link assumed npm never links a directories.bin-only package installed from a file: tarball. npm 10 doesn't, but npm 11 does: it links bin/cli.js and rewrites its CRLF shebang to LF. The e2e_redirect_npm_build legs use the runner image's npm, which is 11 on macos-latest, so the macOS nightly leg has been red on main since #1805 landed. The test now checks whether npm linked the bin and expects npm's rewritten bytes when it did, and the untouched CRLF bytes when it didn't. apply, apply --check and a byte-exact rollback are still asserted in both cases, and --no-bin-links must still leave the bin unlinked. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011f9aeRC4w7jsAshzLQM6VL
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I dispatched a macOS-only run of this branch to check the fix in CI: https://github.com/SocketDev/socket-patch/actions/runs/41029711345
The PR run is green, including the required Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ready for review (burn-down agent) at
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The --no-bin-links guard looked for .bin/cli.js, but npm names a bin-map link after its key (crlfbin), so the guard could never fire. Pass the link name npm would create for each case: the bin key for the bin map, the file name for directories.bin. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011f9aeTApLyQQnpuXiK39EX
|
Final review: the bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9d7d4cb. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[burn-down agent] Labeled Ready for review again at
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Final review briefWhat it does: Test-only fix for the macOS nightly red in Risk: low. One test file, no product code. The test still checks apply, Look here:
Verified: Read the full diff. Changes I made: none. Auto-merge is armed, so approving sends it straight to the merge queue. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
[agent] Reviewed 9d7d4cbfd7e9bf3ce49a71497051cc99b821c404. Checked npm 10/11 linked-bin expectations and byte-exact apply/check/rollback assertions. No major correctness issues found. Validation: source and regression-test review plus the available exact-head CI checks; no local test pass is claimed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.