Skip to content

Commit ee558f2

Browse files
hsbtclaudeEdouard-chin
authored
Skip bundler self-checksum for unreleased bundlers (#9501)
* Skip bundler self-checksum for unreleased bundlers Using `Bundler.gem_version.end_with?(".dev")` only skips the own checksum on master, but patch releases run from a source checkout (e.g., bumping bundler/lib/bundler/version.rb to 4.0.11 on a release branch) still record the checksum, which is environment dependent on the local gem cache and causes frozen-lock drift on CI. Generalize the guard with `released_bundler?`, which returns false for any prerelease version and for bundlers loaded outside of an installed gem location (`/specifications/`), so dev workflows don't record self-checksums while released installs still do. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Revert "Skip bundler self-checksum for unreleased bundlers" This reverts commit d4e51dd. * Skip bundler checksum when running version:update_locked_bundler: - Our development lockfile should not include the checksum of bundler itself. No matter if we are doing a release. The problem being that including a checksum in our development lockfile create issues as some rake tasks don't run the same way on CI. For example, some rake tasks, build bundler.gem and some other don't. I explained in more details the issue here 2c40b8d This commit here is motivated by the fact that when the release manager runs `version:update_locked_bundler`, if a `bundler-<VERSION>.gem` exists on its system (e.g it previously ran `rake bundler:install`), then the lockfile will include a checksum entry. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Edouard CHIN <chin.edouard@gmail.com>
1 parent 0b469ed commit ee558f2

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ namespace :version do
3232
task :update_locked_bundler do |_, _args|
3333
stdout = Spec::Rubygems.dev_bundle "--version"
3434
version = stdout.split(" ").last
35+
ENV["SKIP_BUNDLER_CHECKSUM"] = "1"
3536

3637
Dir.glob("{tool/bundler/*_gems.rb,spec/realworld/fixtures/*/Gemfile}").each do |file|
3738
Spec::Rubygems.dev_bundle("lock", "--update", "--bundler", version, gemfile: file)

bundler/lib/bundler/lockfile_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def add_section(name, value)
103103
end
104104

105105
def bundler_checksum
106-
return [] if Bundler.gem_version.to_s.end_with?(".dev")
106+
return [] if Bundler.gem_version.to_s.end_with?(".dev") || ENV["SKIP_BUNDLER_CHECKSUM"]
107107

108108
bundler_spec = definition.sources.metadata_source.specs.search(["bundler", Bundler.gem_version]).last
109109
return [] unless File.exist?(bundler_spec.cache_file)

0 commit comments

Comments
 (0)