-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
bundler install
should not fail when a native platform gem's required_ruby_version is not met, and a suitable ruby
platform gem is available
#4012
Comments
Hi @flavorjones! This is definitely how I expected this to work too after rubygems/bundler#7522 😬. However, it turns out that this behaviour is only enabled with the Since bundler 2.2.0 is supposed to be the release finally providing a nicer platform support, my proposal would be to enable this setting by default in bundler 2.2.0 instead. Thoughts? EDIT: Thanks for the nicely written report by the way, it's really great when people spend time on writing good issues ❤️. |
Somehow I missed the Yes, I personally think we should turn that on in Bundler 2.2 in time for a Ruby 3 release. But my opinion is obviously non-binding, as I'm not a maintainer. EDIT: I've gone through the installation experience with |
The main inconvenience of this setting is that it will generate lockfile changes by adding the current "specific platform" ( So I'd say let's do this now, but I'd like to hear other thoughts. If I don't get feedback in a few days I'll go ahead and merge #4015. |
@flavorjones I didn't forget about this, I'm just fixing some issues with Also, regarding
I added #4049 to implement this. |
With the fixed platform resolution logic #4049 is not as necessary, but I found some cases where it could still be handy. |
Describe the problem as clearly as you can
Given:
ruby
platform gem and a native (e.g.,x86_64-linux
) platform gemspec.required_ruby_version
ruby
platform gem viaspec.required_ruby_version
I expect
bundler install
(and/orgem install
?) to install theruby
platform gem.More specifically, I expect
bundler install
to iterate through the list of Rubygems Platforms for my system, from more-specific to more-general, until it finds a gem that meets all the requirements. It should not give up and raise an error until the list of platforms has been exhausted.Instead, I see
bundler install
select the native gem, and then fail while resolving dependencies with an error message like:Additional context
Given the work done at rubygems/bundler#7522 to improve platform-specific gem resolution, I expected this to eventually install the matching
ruby
gem rather than give up after failing to install the non-matching native gem. Perhaps this is my misunderstanding of that issue.As a maintainer of Nokogiri, about to release native gems (see sparklemotion/nokogiri#2075), I'd like very much for this to work as described. I believe the current behavior will cause confusion for Ruby users whenever a new version of Ruby is made available, and that will create additional support work for native gem maintainers.
I can imagine this unfortunate scenario:
~> 3.0.0
Further confounding the problem is that Ruby users have no way to pin a specific gem to the
ruby
platform, instead they have to set the bundler configforce_ruby_platform
and avoid native gems entirely, until each and every gem they use supports the new version of Ruby.I hope I've explained this scenario adequately -- it's a ticking time bomb once a commonly-used Gem like nokogiri ships native platform gems. Please ask me questions if I'm not being clear, or correct me if my understanding is incorrect.
(I'm tagging @tenderlove, @larskanis, and @casperisfine for visibility because I've discussed this scenario with each of them, and they have context they may wish to share.)
Post steps to reproduce the problem
Brief
=1.11.0.rc3
from rubygems.org usingbundler install
Longer
On a linux machine:
Running ruby installed via rvm:
With these configurations:
In a project directory with the following
Gemfile
:Run:
Which command did you run?
bundle install
What were you expecting to happen?
I expected bundler to choose the
ruby
platform gem rather than the native platform gem.More specifically, I expect
bundler install
to iterate through the list of Rubygems Platforms for my system, from more-specific to more-general, until it finds a gem that meets all the requirements. It should not give up and raise an error until the list of platforms has been exhausted.What actually happened?
Error message:
If not included with the output of your command, run
bundle env
and paste the output belowSee above.
The text was updated successfully, but these errors were encountered: