Skip to content

Commit 66c7546

Browse files
hsbtclaude
andcommitted
Replace #9506 with a targeted :ruby_repo skip
The blanket skip in checksums_section from #9506 caused 82 ruby-core test failures whose lockfile expectations legitimately include the bundler checksum (paths that go through `bundle install` where bundler is activated as a gem). Revert that change and instead tag only the affected setup_spec example with :ruby_repo, since its `ruby "require 'bundler/setup'"` invocation is the one case where bundler is loaded from $LOAD_PATH and Source::Metadata's synthetic bundler spec has no cache_file on disk. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 40112f7 commit 66c7546

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

spec/runtime/setup_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,12 @@ def lock_with(ruby_version = nil)
13091309
end
13101310

13111311
context "is not present" do
1312-
it "does not change the lock" do
1312+
# Skipped on ruby-core because `ruby "require 'bundler/setup'"` does not
1313+
# activate bundler as a gem there, so Source::Metadata falls back to a
1314+
# synthetic spec whose cache_file does not exist on disk and
1315+
# LockfileGenerator#bundler_checksum drops the bundler checksum, while
1316+
# the on-disk lockfile still has it.
1317+
it "does not change the lock", :ruby_repo do
13131318
expect { ruby "require 'bundler/setup'" }.not_to change { lockfile }
13141319
end
13151320
end

spec/support/checksums.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ def checksums_section(enabled = true, bundler_checksum: true, &block)
5858
ChecksumsBuilder.new(enabled, &block).tap do |builder|
5959
next if builder.bundler_registered || !bundler_checksum
6060

61-
# Mirror the conditions under which LockfileGenerator#bundler_checksum
62-
# gives up and omits the bundler checksum from the lockfile:
63-
# - .dev: development builds have no released bundler.gem to checksum.
64-
# - ruby_core?: bundler is loaded as a default gem, so bundler.gem
65-
# is not present on disk under the test gem cache.
66-
next if Bundler::VERSION.to_s.end_with?(".dev") || Spec::Path.ruby_core?
61+
next if Bundler::VERSION.to_s.end_with?(".dev")
6762
builder.checksum(system_gem_path, "bundler", Bundler::VERSION, Gem::Platform::RUBY, "cache")
6863
end
6964
end

0 commit comments

Comments
 (0)