-
Notifications
You must be signed in to change notification settings - Fork 30
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
document how bundler and rubygems behave wrt linux
, linux-gnu
, and linux-musl
releases
#117
Comments
OK, so understanding that bundler's behavior has changed in at least two unfortunate ways for the "linux + linux-musl" scenario:
Let's dig in. gnu target platformOn a gnu system (docker image source "https://rubygems.org"
gem "rcee_precompiled", "0.5.0.1"
Error [1]: git-bisected to rubygems/rubygems@66ee354
musl target platformOn a musl system (docker image source "https://rubygems.org"
gem "rcee_precompiled", "0.5.0.1"
Error [1]: incorrectly installs
Note [2]: rubygems/rubygems#7432 was fixed in 2.5.6 by rubygems/rubygems#7441 |
I've updated the recommendations in the description. I'll be opening a bug report on rubygems shortly to report these findings. |
I've created an issue upstream at test: demonstrate issue with installing linux-musl gems by flavorjones · Pull Request #7583 · rubygems/rubygems for the issue described above in bundler 2.5.6. |
Recommendations added to the README. Closing. |
Debian unstable really screwed it up: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1069089 Debian unstable's ruby3.1 package currently bundles rubygems 3.4.20. However, Debian's maintainers patched it in a way that behavior like 3.3.15: diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
index b721629b7..a16c6fca9 100644
--- a/lib/rubygems/platform.rb
+++ b/lib/rubygems/platform.rb
@@ -117,6 +117,9 @@ def initialize(arch)
when /^(\w+_platform)(\d+)?/ then [ $1, $2 ]
else [ "unknown", nil ]
end
+
+ # emulate behavior from 3.3.15 on ruby 3.1
+ @version = nil if (RUBY_VERSION < "3.2" && @os == "linux")
when Gem::Platform then
@cpu = arch.cpu
@os = arch.os It's completely broken despite 3.4.20 > 3.3.22...
I have already got a few bug reports from users on Debian unstable. What I don't want to do is to block rubygems I have tried a few ways to reduce the noises from users by checking if they have a broken rubygems and raise a runtime error, etc. and unfortunately it brought even more noise and confusion. The final solution I end up with is to conditionally block ruby <3.2 on linux native gems, as ruby >=3.2 seems to always have a good default rubygems version (assuming users won't downgrade default rubygems). spec.required_ruby_version = if spec.platform == Gem::Platform::RUBY || spec.platform.os != 'linux'
'>= 3.1.0'
else
'>= 3.2.0'
end |
@ntkme Thanks for adding this context, that's really too bad about the downstream patches that get applied in the Sid distro. I hope it gets fixed. |
We know that rubygems 3.33.22 / bundler 2.3.21 is required for basic support of
linux-gnu
andlinux-musl
platform names; but buggy bundler behavior prior to 2.5.6 may cause challenges for some users.This issue is to record some research into how the default versions behave with different native platform gems, and to document recommendations for maintainers as to how and when to ship
linux-gnu
andlinux-musl
versions.testing
To help test this, I published "linux + linux-musl" and "linux-gnu + linux-musl" combinations of the gem
rcee_precompiled
which you can find at https://rubygems.org/gems/rcee_precompiled/versions.Note that the versions in question being tested below are:
and the alpine containers have
build-base
installed to compile the source gem if necessary.We test Ruby 3.0 with updated rubygems because its default version is below the known minimum needed for this to work correctly (3.3.22).
testing
gem install
-linux
-linux
-linux
-linux-gnu
-linux-musl
-linux-musl
-linux
-linux-gnu
-linux-musl
-linux-musl
-linux
-linux-gnu
-linux-musl
-linux-musl
-linux
-linux-gnu
-linux-musl
-linux-musl
testing
bundle install
-linux
-linux-gnu
-linux-musl
-linux-musl
-linux
-linux-gnu
-linux-musl
-linux-musl
-linux
-linux-gnu
-linux-musl
-linux-musl
-linux
-linux-gnu
-linux
-linux-musl
Error [1]:
Recommendations
Given the inconsisent behavior of
gem
andbundle
when the gem in question shipslinux
andlinux-musl
platform gems, it seems pretty clear that it's not a good idea to do this.So the recommendation has to be:
-linux
platform gem that works for both gnu and musl systems,-linux-gnu
and-linux-musl
platform gems.-linux
and-linux-musl
platform gems for the same version.The installation docs for users should contain some warnings:
required_rubygems_version
for native gems that specify the linux libc rake-compiler#236musl
native gem platform in the lock file rubygems/rubygems#7432The text was updated successfully, but these errors were encountered: