Repository navigation
Fix bundle clean assertion on Bundler 1.x (#2115) - #2116
Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
Conversation
Assisted-by: Claude Code:claude-fable-5-2
The nightly gem leg runs Bundler 1.17.3 on Ruby 3.1. There
bundle clean prints 'Removing rack (3.2.8)', exits 0 and leaves the
directory: the FileUtils copy Bundler vendors before 2.1 calls
Dir.entries(path, {}), Ruby >= 3.0 rejects the positional hash, and
rm_rf swallows the error. The step added with #2081 asserted the
directory was gone, so it failed on that leg every time.
The test now asserts on every Bundler that bundle clean names the
leftover as stale. On Bundler < 2.1 with Ruby >= 3.0 it checks the
directory is still there and removes it by hand, so the lock and
vex checks after it still run. Every other pair keeps the original
assertion.
Fixes #2115
Assisted-by: Claude Code:claude-fable-5-2
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011f9aePEeutq9i2gda491Vn
Review of the first commit: the stdout check is only needed where bundle clean fails to delete, so it moves into that arm and the other Bundler legs no longer depend on Bundler's wording. On the affected pair the test now also runs vex before removing the directory by hand and asserts vendored_tree_out_of_sync is still reported, so the test shows what a user on that pair sees. The helper's doc comment names the call each Bundler line makes. Refs #2115 Assisted-by: Claude Code:claude-fable-5-2
|
[agent] bugbot run Generated by Claude Code |
PR SummaryLow Risk Overview Adds In the gem vendor capstone’s Self-test coverage documents the version matrix for this helper. Reviewed by Cursor Bugbot for commit 71f0fce. Configure here. |
LLM Description written by Claude Code:claude-fable-5-2
Fixes #2115
Summary
Test-only change. The nightly
e2e-extendedgem leg (Ruby 3.1, Bundler 1.17.3) failsgem_vendor_fresh_checkout_bundle_install_and_reverton every run since #2081, because the step #2081 added asserts thatbundle cleandeletes the gem-home leftover. That Bundler cannot do so on that Ruby. No socket-patch behavior regressed, and no file undersrc/changes.Root cause
Bundler vendors its own FileUtils. Before Bundler 2.1 that copy lists a directory with a positional options hash (
Dir.entries(path, {})in 1.17.3,Dir.children(path, opts)in 2.0.2). Ruby >= 3.0 rejects the call withArgumentError, so the directory's contents are never visited, the finalrmdirfails withENOTEMPTY, andrm_rfswallows the error.bundle cleanprintsRemoving rack (3.2.8), exits 0 and leavesvendor/bundle/ruby/3.1.0/gems/rack-3.2.8in place. Bundler 2.1 passes**optsand works.The assertion never passed on this leg: the last green nightlies ran on 63f791d, before #2081.
The change
tests/common/bundler_e2e.rs:Bundler::clean_leaves_directories(ruby_major), true for Bundler < 2.1 on Ruby >= 3, with a unit check in the module's self-test.tests/e2e_vendor_gem_build.rs: on that pair the test asserts thatbundle cleannamed the leftover as stale, that the directory is still there (so the arm fails once the defect is gone), and thatvexstill reportsvendored_tree_out_of_sync. It then removes the directory by hand and runs the rest of the step. Every other Bundler/Ruby pair keeps the original assertion unchanged.Evidence
Whole suite,
cargo test -p socket-patch-cli --test e2e_vendor_gem_build -- --include-ignored, withSOCKET_PATCH_BUNDLER_E2E_REQUIRED=1:origin/maine2e_vendor_gem_build.rs:787, as in the nightlycargo clippy --locked --workspace --all-features -- -D warnings(the CI command) is clean.cargo clippy -p socket-patch-cli --all-targetsalready fails onorigin/mainin test helpers this PR does not touch; it reports nothing on the changed lines.PR CI runs this suite on its default Bundler only. The 1.17.3 leg runs in the nightly, so the table above is the evidence for that leg until the next nightly.
Review findings not applied
rubyonPATH, not from the interpreter behindbundle. The test already builds the gem directory path from that same probe, and CI provisions both withruby/setup-ruby, so a host where they differ fails earlier for the same reason.Follow-up for a maintainer
On Bundler < 2.1 with Ruby >= 3, the remedy the
vendored_tree_out_of_syncwarning names (bundle clean) does not clear the warning. The verdict and the VEX document are unaffected. Naming a different remedy for that pair would change CLI output, so this PR leaves it alone. The test now pins the current behavior.https://claude.ai/code/session_011f9aePEeutq9i2gda491Vn
Generated by Claude Code