From 819c8461763a1c29a0deec75c6b1760ee032b63d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 06:53:21 +0000 Subject: [PATCH] Skip CRLF source-block arm before bundler 2.2 The nightly e2e-extended gem legs for bundler 1.17.3 and 2.1.4 fail since #1961 added the crlf-gemfile-source-block arm to gem_hosted_redirect_keeps_a_crlf_gemfile_crlf. Before 2.2 bundler writes one merged GEM section for every rubygems source, and the redirect nests the Socket block inside the user's own source block, so rollback refuses with hosted_wiring_contested. That is the documented era limit that gem_hosted_unwind_keeps_a_source_block_bang already skips for. Apply the same floor to the source-block arm only; the plain CRLF arm still runs on every bundler era. PR CI only runs bundler 4.0.21, so the gap showed up on the nightly schedule run alone. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_011f9aeQNTkAfriFzVGPKuZP --- .../tests/e2e_redirect_gem_build.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/socket-patch-cli/tests/e2e_redirect_gem_build.rs b/crates/socket-patch-cli/tests/e2e_redirect_gem_build.rs index d2b2fd4a0..3be9902f0 100644 --- a/crates/socket-patch-cli/tests/e2e_redirect_gem_build.rs +++ b/crates/socket-patch-cli/tests/e2e_redirect_gem_build.rs @@ -4774,7 +4774,8 @@ async fn gem_vendored_unwind_names_a_patched_archive_in_vendor_cache() { /// `core.autocrlf=true`) keeps it CRLF throughout, for a plain top-level /// declaration and for one inside the user's own `source … do` block; a /// real bundler converges the result, a re-scan is a no-op, and `rollback` -/// hands back a CRLF Gemfile that still declares the gem. +/// hands back a CRLF Gemfile that still declares the gem. The source-block +/// arm needs bundler >= 2.2 (a separate patch-registry GEM section). #[tokio::test(flavor = "multi_thread")] #[ignore = "host capstone: shells out to a real ruby/gem/bundler (>= 1.17); \ the unpinned `test` job skips it, an e2e job with a pinned toolchain runs it via --ignored"] @@ -4792,6 +4793,18 @@ async fn gem_hosted_redirect_keeps_a_crlf_gemfile_crlf() { else { return; }; + // Same era floor as `gem_hosted_unwind_keeps_a_source_block_bang`: + // before 2.2 bundler merges every rubygems source into one GEM + // section, and the redirect nests the Socket block inside the + // user's, so rollback cannot attribute the gem to the patch. + if driver == Driver::ScanVexSourceBlock && !fx.bundler.at_least(2, 2) { + println!( + "SKIP e2e_redirect_gem_build ({tag}): bundler {} merges every rubygems \ + source into one GEM section", + fx.bundler.version + ); + continue; + } let api = fx._server.uri(); let gemfile_path = fx.proj.join(fx.gemfile_name); let lock_path = fx.proj.join(fx.lock_name);