Skip bundler self-checksum on ruby-core in test fixtures#9506
Merged
Conversation
In ruby-core test setup, bundler is loaded as a default gem and the bundler.gem cache file is not present on disk where LockfileGenerator#bundler_checksum looks for it. As a result, the generator omits the bundler checksum from the regenerated lockfile, while the test's checksums_section helper still adds it, making the "does not change the lock" expectations in setup_spec.rb fail on ruby-core CI for release branches (where Bundler::VERSION does not end in .dev). Mirror the generator's give-up conditions in the helper so that test fixtures and the regenerated lockfile stay in sync. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the spec lockfile checksum fixture helper to better match Bundler’s lockfile generation behavior when running inside ruby-core, where the bundler .gem cache file may not be available for checksumming.
Changes:
- Updates
checksums_sectionto skip adding the bundler checksum when running in a ruby-core context. - Expands inline documentation to explain why bundler checksums are omitted in these environments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # - .dev: development builds have no released bundler.gem to checksum. | ||
| # - ruby_core?: bundler is loaded as a default gem, so bundler.gem | ||
| # is not present on disk under the test gem cache. | ||
| next if Bundler::VERSION.to_s.end_with?(".dev") || ruby_core? |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
matzbot
pushed a commit
to ruby/ruby
that referenced
this pull request
Apr 30, 2026
fixtures (ruby/rubygems#9506) * Skip bundler self-checksum on ruby-core in test fixtures In ruby-core test setup, bundler is loaded as a default gem and the bundler.gem cache file is not present on disk where LockfileGenerator#bundler_checksum looks for it. As a result, the generator omits the bundler checksum from the regenerated lockfile, while the test's checksums_section helper still adds it, making the "does not change the lock" expectations in setup_spec.rb fail on ruby-core CI for release branches (where Bundler::VERSION does not end in .dev). Mirror the generator's give-up conditions in the helper so that test fixtures and the regenerated lockfile stay in sync. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- ruby/rubygems@40112f7663 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This was referenced Apr 30, 2026
hsbt
added a commit
that referenced
this pull request
Apr 30, 2026
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>
hsbt
added a commit
that referenced
this pull request
Apr 30, 2026
* Skip bundler self-checksum on ruby-core in test fixtures In ruby-core test setup, bundler is loaded as a default gem and the bundler.gem cache file is not present on disk where LockfileGenerator#bundler_checksum looks for it. As a result, the generator omits the bundler checksum from the regenerated lockfile, while the test's checksums_section helper still adds it, making the "does not change the lock" expectations in setup_spec.rb fail on ruby-core CI for release branches (where Bundler::VERSION does not end in .dev). Mirror the generator's give-up conditions in the helper so that test fixtures and the regenerated lockfile stay in sync. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> (cherry picked from commit 40112f7)
hsbt
added a commit
that referenced
this pull request
Apr 30, 2026
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> (cherry picked from commit 66c7546)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What was the end-user or developer problem that led to this PR?
In ruby-core test setup, bundler is loaded as a default gem and the bundler.gem cache file is not present on disk where
LockfileGenerator#bundler_checksumlooks for it.As a result, the generator omits the bundler checksum from the regenerated lockfile, while the test's checksums_section helper still adds it, making the "does not change the lock" expectations in setup_spec.rb fail on ruby-core CI for release branches (where Bundler::VERSION does not end in .dev).
Make sure the following tasks are checked