From 4999fc3bb8d8086b1b2141e5e34eb905192edfff Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Nov 2026 21:27:49 +0000 Subject: [PATCH] Fix gemspec-only vendor test on Bundler 1.17 gem_vendor_gemspec_only_dependency_refusal_names_remedies_that_work failed in the nightly Bundler 1.17.3 leg. Its first remedy runs a frozen `bundle install`, and Bundler <= 2.0 persists `BUNDLE_FROZEN: "true"` into the project's `.bundle/config` when it does. The second remedy then changes the Gemfile and installs unfrozen, which that Bundler refuses as a deployment-mode install of a changed Gemfile. Put the committed `.bundle/config` back before that install, as the fresh-checkout tests in this suite already do. The premise assert in `gemspec_library` now prints stdout as well, where Bundler 1.x writes its errors. Fixes #2203 Assisted-by: Claude Code:claude-fable-5-2 Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_011f9aePiVyUzKFwJZh49P6u --- crates/socket-patch-cli/tests/e2e_vendor_gem_build.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/socket-patch-cli/tests/e2e_vendor_gem_build.rs b/crates/socket-patch-cli/tests/e2e_vendor_gem_build.rs index 4a143fdfe..d916212d0 100644 --- a/crates/socket-patch-cli/tests/e2e_vendor_gem_build.rs +++ b/crates/socket-patch-cli/tests/e2e_vendor_gem_build.rs @@ -2274,7 +2274,8 @@ fn gemspec_library(proj: &Path, gemfile: &str) { let relock = bundle(proj, &["install"], false); assert!( relock.status.success(), - "the gem library installs before vendor (test premise):\n{}", + "the gem library installs before vendor (test premise):\n{}\n{}", + String::from_utf8_lossy(&relock.stdout), String::from_utf8_lossy(&relock.stderr) ); } @@ -2445,6 +2446,8 @@ fn gem_vendor_gemspec_only_dependency_refusal_names_remedies_that_work() { locked_gem_version(&lock, DEP) }; + let bundle_config = proj.join(".bundle/config"); + let committed_config = std::fs::read(&bundle_config).unwrap(); gemspec_library(&proj, hidden); assert_eq!(locked(&proj).as_deref(), Some(version), "test premise"); let lock_before = std::fs::read(proj.join("Gemfile.lock")).unwrap(); @@ -2550,7 +2553,11 @@ fn gem_vendor_gemspec_only_dependency_refusal_names_remedies_that_work() { "revert restores Gemfile.lock byte-identical" ); - // The second way out: agent mode, with the Gemfile as it was. + // The second way out: agent mode, with the Gemfile as it was. Bundler + // <= 2.0 persisted `BUNDLE_FROZEN: "true"` into `.bundle/config` on the + // frozen install above and would refuse the changed Gemfile; a + // developer's unfrozen install runs from the committed config. + std::fs::write(&bundle_config, &committed_config).unwrap(); gemspec_library(&proj, hidden); assert_eq!(locked(&proj).as_deref(), Some(version), "test premise"); let installed_rb = PathBuf::from(gem_path(&proj)).join("lib/rack.rb");