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
Platform-specific gem ignored and Gemfile.lock unexpectedly changed by bundle install after upgrading to Ruby 3.3.0 #7506
Comments
After further investigation, I can see the (likely) cause - Perhaps Bundler should at least warn that it can't install the locked gem version (and give a reason why). I'm sure there's much more to it than I've considered, but I think I'd rather have bundler fail to install rather than "silently" change the lock file like this (with the corresponding increase in As a further consideration, before I stripped down to a minimal reproducing example, our --- Gemfile.lock-3.2.3 2024-03-06 13:24:28
+++ Gemfile.lock 2024-03-06 13:28:04
@@ -4,3 +4,3 @@
- sqlite3 (1.6.7-arm64-darwin)
- sqlite3 (1.6.7-x86_64-darwin)
- sqlite3 (1.6.7-x86_64-linux)
+ mini_portile2 (2.8.5)
+ sqlite3 (1.6.9)`
+ mini_portile2 (~> 2.8.0) I'm surprised that the version has changed to 1.6.9 (though I suspect Bundler has just re-resolved the constraint |
Yes, this is indeed expected. In verbose mode there's a bit more information about what's going on under the hood. Bundler should inform that the locked gems are not valid for the current platform (maybe "platform" should read "ruby" in this case), and that's why it will try to re-resolve gems. Maybe we could print this debug output by default. |
Thanks @deivid-rodriguez - this sounds sensible. I'm not sure about debug output in general, but certainly some warning that the requested gem(s) can't be installed and so a re-resolution was happening would have probably put me on the right path |
Yeah, agree on not printing debug output in general, but this particular piece of information probably deserves more visibility. I'll try to improve default output when this kind of edge case happens 👍. |
Describe the problem as clearly as you can
When upgrading from Ruby 3.2.3 to 3.3.0, a
bundle install
on platformx86_64-linux
seems to ignore the platform-specific versions, installs the gem with native extensions, and modifies theGemfile.lock
as follows:Did you try upgrading rubygems & bundler?
Yes, issue reproduced with 3.5.6/2.5.6
Post steps to reproduce the problem
With this setup script in
setup_lockfile.sh
on the host machine:Run the script inside a Ruby 3.2.3 container:
Which will generate this
Gemfile.lock
:With this script in
demonstrate_issue.sh
on the host machine (in the same directory as the Gemfile{,.lock} as generated by the 3.2.3 container in the previous step):set -eux apt-get update apt-get install -y build-essential pkg-config gem update --system 3.5.6 bundle install
Run the script inside a Ruby 3.3.0 container:
...then (after a delay to install the extension) the following
Gemfile.lock
is generated:Which command did you run?
bundle install
after upgrading Ruby to 3.3.0.What were you expecting to happen?
That
sqlite3 (1.6.7-x86_64-linux)
would be installed (thus not requiringbuild-essential
andpkg-config
) and theGemfile.lock
to not be modified.What actually happened?
The platform-specific gem in the lockfile was ignored (with no output to say why) and the lockfile was modified to remove the other platform-specific versions.
If not included with the output of your command, run
bundle env
and paste the output belowIn the Ruby 3.2.3 container:
In the Ruby 3.3.0 container:
The text was updated successfully, but these errors were encountered: