Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore using old way of passing Ruby version to resolver #7066

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Oct 16, 2023

What was the end-user or developer problem that led to this PR?

Don't break bootboot unnecessarily.

I found this while investigating how the changes in #7047 affect bootboot.

Currently boot boot specs fail against latest Bundler with:

  1) Error:
BootbootTest#test_bundle_install_with_different_ruby_updating_gemfile_next_lock_succeeds:
BootbootTest::BundleInstallError: bundle install failed: Fetching gem metadata from https://rubygems.org/
Fetching /Users/deivid/Code/Shopify/bootboot
Resolving dependencies...
The Gemfile specifies no dependencies
Resolving dependencies...
Updating the /var/folders/w1/r6xjlh5j0x9gngmqkvjvnpy80000gn/T/d20231016-95794-tsdzjn/Gemfile20231016-95794-ken3g5_next.lock
Could not find gem 'Ruby (= 3.2.2)' in Bootboot plugin Ruby source.

The source contains the following gems matching 'Ruby':
  * Ruby-9.9.9

    /Users/deivid/Code/Shopify/bootboot/test/bootboot_test.rb:352:in `block in run_bundle_command'
    /Users/deivid/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler.rb:411:in `block in with_unbundled_env'
    /Users/deivid/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler.rb:657:in `with_env'
    /Users/deivid/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.20/lib/bundler.rb:411:in `with_unbundled_env'
    /Users/deivid/Code/Shopify/bootboot/test/bootboot_test.rb:349:in `run_bundle_command'
    /Users/deivid/Code/Shopify/bootboot/test/bootboot_test.rb:223:in `block in test_bundle_install_with_different_ruby_updating_gemfile_next_lock_succeeds'
    /Users/deivid/Code/Shopify/bootboot/test/bootboot_test.rb:332:in `write_gemfile'
    /Users/deivid/Code/Shopify/bootboot/test/bootboot_test.rb:213:in `test_bundle_install_with_different_ruby_updating_gemfile_next_lock_succeeds'

14 runs, 35 assertions, 0 failures, 1 errors, 1 skips

You have skipped tests. Run with --verbose for details.

What is your fix for the problem, implemented in this PR?

Restore old code that was changed for no known reason.

Make sure the following tasks are checked

We used `Bundler::RubyVersion.system.gem_version` for a long time, but I
changed this to `Gem.ruby_version` at
94f9643. It's unclear why I did that
though since I believe it was unrelated to the fix in there.

Bootboot patches `Bundler::RubyVersion` to customize how Bundler works
with Ruby versions, and that change broke that.

Since it's unclear to me how to achieve what Bootboot is doing with the
current code, and there was no strong reason for the change, let's
restore it for now.
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review October 16, 2023 12:55
@deivid-rodriguez deivid-rodriguez merged commit 5d99479 into master Oct 18, 2023
92 checks passed
@deivid-rodriguez deivid-rodriguez deleted the restore-unnecessary-change branch October 18, 2023 10:17
deivid-rodriguez added a commit that referenced this pull request Nov 8, 2023
Restore using old way of passing Ruby version to resolver

(cherry picked from commit 5d99479)
deivid-rodriguez added a commit that referenced this pull request Nov 8, 2023
Restore using old way of passing Ruby version to resolver

(cherry picked from commit 5d99479)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant