You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bundler v4 shows warning about Definition#lock #76
With Bundler v4, it warns that bootboot uses a deprecated argument of Definition#lock. For instance, when I ran bundle exec rake test on the branch of #74 with Bundler v4.0.1, it showed a test failure like the following:
1) Error:
BootbootTest#test_does_not_sync_the_gemfile_next_lock_when_nothing_changed:
BootbootTest::BundleInstallError: bundle install failed: Resolving dependencies...
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Updating the /var/folders/3c/q1lbzm2s6bqchrvd1rq8ng3m0000gp/T/d20251212-30034-3el5bh/Gemfile20251212-30034-q61v3q_next.lock
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
[REMOVED] `Definition#lock` was passed a target file argument. To fix this
warning, remove it from the `Definition#lock` call.
test/bootboot_test.rb:350:in `block in run_bundle_command'
/Users/nekketsuuu/.rbenv/versions/3.3.10/lib/ruby/gems/3.3.0/gems/bundler-4.0.1/lib/bundler.rb:397:in `block in with_unbundled_env'
/Users/nekketsuuu/.rbenv/versions/3.3.10/lib/ruby/gems/3.3.0/gems/bundler-4.0.1/lib/bundler.rb:676:in `with_env'
/Users/nekketsuuu/.rbenv/versions/3.3.10/lib/ruby/gems/3.3.0/gems/bundler-4.0.1/lib/bundler.rb:397:in `with_unbundled_env'
test/bootboot_test.rb:347:in `run_bundle_command'
test/bootboot_test.rb:24:in `block in test_does_not_sync_the_gemfile_next_lock_when_nothing_changed'
test/bootboot_test.rb:332:in `write_gemfile'
test/bootboot_test.rb:20:in `test_does_not_sync_the_gemfile_next_lock_when_nothing_changed'
Cause
This appears to have been intentional on Bundler's part. The target file argument was deprecated at ruby/rubygems#7047, and this pull request says:
I think this may help bootboot remove some monkey patches.
Indeed, I suppose that this change makes DefinitionPatch and SharedHelpersPatch unnecessary. But this requires users to use Bundler >= v4, so we may want a conditional branch that changes bootboot's behavior depending on the Bundler version for backward compatibilities.
Resolution
I believe that this warning can be resolved by rewriting the patches and Bootboot::GemfileNextAutoSync#update!. I'm not sure whether we should support older Bundlers. What do you think?
👋 Thank for raising the issue. ruby/rubygems#7047 was partially reverted in ruby/rubygems#8922. The deprecation is still there but would be removed on future releases.
Fixing this in bootboot would probably need to call DefinitioN#write_lock instead of Definition#lock, though I haven't checked.
Activity
Edouard-chin commentedon Dec 12, 2025
👋 Thank for raising the issue. ruby/rubygems#7047 was partially reverted in ruby/rubygems#8922. The deprecation is still there but would be removed on future releases.
Fixing this in bootboot would probably need to call
DefinitioN#write_lockinstead ofDefinition#lock, though I haven't checked.