GeezerVison is showing github.com — CI: hermetic spawns in e2e_redirect_cargo_shapes (#823) by mikolalysenko · Pull Request #1522 · SocketDev/socket-patch
Conversation
LLM Description written by Claude Code:claude-opus-5-5
Refs #823 (slice 19: the e2e_redirect_cargo_shapes suite). This uses Refs, so #823 stays open for the last two PENDING_RAW_SPAWNS files: e2e_hosted_production.rs and e2e_vendored_production.rs.
Summary
run_socket_env in e2e_redirect_cargo_shapes.rs now starts socket-patch through hermetic::binary_command() and scrubs an activated venv (Extra::Venv). It sets the leg's own CARGO_HOME after those calls. The file comes off PENDING_RAW_SPAWNS (3 → 2). The change touches tests only: no product code and no workflows.
Root cause
The suite spawned the CLI with a bare Command::new and its own sweep of every ambient SOCKET_*. That sweep was mostly sound, but it had drifted from the shared harness:
- It forced only
SOCKET_NO_CONFIG. The update check and telemetry opt-outs that hermetic::FORCED_OPT_OUTS sets were never forced. (Every call does pass --no-telemetry.)
- There were no hostile seeds, so a dropped scrub line would not turn the suite red.
VIRTUAL_ENV reached the unscoped scan and vex runs.
To be clear about impact: I found no ambient shell that fails this suite on main. Under VIRTUAL_ENV=<real venv with six installed> SOCKET_DRY_RUN=true SOCKET_ECOSYSTEMS=npm SOCKET_NO_CONFIG=0 SOCKET_NO_UPDATE_CHECK=0 SOCKET_TELEMETRY_DISABLED=0 ..., it passes 32/32 both before and after this change. This slice is about consistency and the ratchet, not a live failure.
Test evidence
- Red with only the
PENDING_RAW_SPAWNS removal: spawn_env_hygiene fails no_new_bare_binary_spawns with ["e2e_redirect_cargo_shapes.rs"] (15 passed, 1 failed).
- Green at 4d4ade7:
e2e_redirect_cargo_shapes 32/32 (real cargo 1.93.1 against crates.io through the wiremock mirror) and spawn_env_hygiene 16/16. Both are also green under the hostile shell above. e2e_maven is 22/22 after rebasing onto CI: hermetic spawns in the e2e_maven suite (#823) #1519.
- Re-verified at takeover (2026-10-14, branch 0 commits behind main):
cargo fmt --check clean, clippy on both test targets clean, spawn_env_hygiene 16/16, e2e_redirect_cargo_shapes 32/32.
cargo fmt --all -- --check is clean. cargo clippy --locked --workspace --all-features -- -D warnings is clean, and so is clippy --test e2e_redirect_cargo_shapes --test spawn_env_hygiene -- -D warnings.
/code-review high
- Fixed: the doc comment said the venv scrub was there for the scan only. It applies to every call, because
vex also discovers packages under --cwd.
- Not fixed here (follow-up under Spawn every CLI test child through one hermetic Command builder; 10 test files inherit ambient SOCKET_* today #823): the real-cargo children (
cargo_e2e_matrix::cargo_command) pin CARGO_HOME and drop CARGO_TARGET_DIR, but they still inherit CARGO_BUILD_TARGET_DIR, CARGO_NET_OFFLINE, CARGO_REGISTRIES_* / CARGO_SOURCE_* and RUSTFLAGS. That helper is shared by every cargo matrix suite, so changing it belongs in its own slice.
- Not fixed here (follow-up): about 20 suites now repeat
binary_command() + scrub_extra(Venv). Making the shared builder scrub VIRTUAL_ENV by default (or adding a ratchet for it) would remove the copies.
CI cost
No workflow changes. A lean PR run costs the same before and after: about 28 Linux jobs and about 8 minutes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FFQDbPARQNb93vs7DiZJoP
Generated by Claude Code
Generated by Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The cargo redirect-shapes suite started socket-patch with a bare
Command::new and its own SOCKET_* sweep. That sweep never forced the
update check or telemetry off, and an activated venv reached the
unscoped hosted scan. It now spawns through the shared hermetic
builder, scrubs VIRTUAL_ENV, and leaves PENDING_RAW_SPAWNS.
Refs #823
Assisted-by: Claude Code:claude-opus-5-5
The venv scrub covers every call, not just scan: vex also discovers
packages under --cwd. Reformat the two-entry PENDING_RAW_SPAWNS list
the way rustfmt wants it.
Assisted-by: Claude Code:claude-opus-5-5
This was referenced Oct 14, 2026
cursor[bot] reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for 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 4d4ade7. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|