-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix TruffleRuby no longer installing lockfiles using "ruby" platform correctly #5694
Conversation
cbf63bd
to
84e077f
Compare
Until 2.3.17, Bundler would always use the RUBY platform for Truffleruby, so the RUBY platform would always be used in lockfiles generated on Truffleruby. From 2.3.18, Bundler will consider `Gem::Platform.local` as Truffleruby's platform, just like CRuby, and use that inside lockfiles. But we need to properly deal with old lockfiles that used the RUBY platform. This commit implements that.
84e077f
to
f971005
Compare
Thank you! For instance we initially noticed the issue of #5691 by
|
Nice catch. If I had to guess I'd say it doesn't currently work as expected. I will find some time to verify that and try to fix it if necessary. |
I had a look and this is indeed still broken. I'm not sure how to best fix it so I created a PR to revert the whole new approach to supporting TruffleRuby using |
Maybe Bundler could detect the platforms changed, and in that case keep gem versions the same but re-resolve which variant of each gem to use? |
How can we detect that platforms changed? Unless TruffleRuby reports its own platform (and we record it in the lockfile), I'm not sure how to do it.
Yes, I expect this too, but the logic is complicated and since I want to release today I had no time to fix it. I can retry "the new way" in the future, but for now I just want things to work again. |
I'm not sure either, but for instance we could detect "only 'ruby' platform" vs "other platforms than 'ruby'".
I'm not sure if this would help, but I can consider it if it would help.
OK. |
In the case you reported, the current platform is I could've tried to keep the "force_ruby_platform" changes but still let TruffleRuby be reported as "ruby", but again, I just wanted to fix things for now so I reverted the two commits involved. I will make a proposal if I feel we need TruffleRuby to report something specific as its platform when I retry this in the future 👍. |
Fix TruffleRuby no longer installing some lockfiles correctly (cherry picked from commit 759c47f)
What was the end-user or developer problem that led to this PR?
Until 2.3.17, Bundler would always use the RUBY platform for Truffleruby, so the RUBY platform would always be used in lockfiles generated on Truffleruby.
From 2.3.18, Bundler will consider
Gem::Platform.local
as Truffleruby's platform, just like CRuby, and use that inside lockfiles.But we need to properly deal with old lockfiles that used the RUBY platform, because currently Bundler tries to install the most specific variant available and that's usually not expected on Truffleruby.
What is your fix for the problem, implemented in this PR?
My fix is to use TruffleRuby platform selection logic (according to the gem name) not only for resolution but also for materialization, to make sure we never materialize a lockfile into an incorrect platform specific gem.
Closes #5691.
Make sure the following tasks are checked