[DRE-maint] Bug#1069089: ruby-rubygems: Broken platform detection which lead to unability to install sass-embedded
Antonio Terceiro
terceiro at debian.org
Wed Sep 11 00:39:30 BST 2024
On Mon, Aug 26, 2024 at 04:00:06PM +0200, David Rodríguez wrote:
> Hello, RubyGems upstream maintainer here.
>
> I heard that Bundler now has trouble installing the proper platform specific version of any gems that ship “non-gnu” variants (not only `sass-embedded`) when using RubyGems packed by Debian due to this issue. That means that people using Debian stable fail to use Jekyll: https://github.com/jekyll/jekyll/issues/9478#issuecomment-1785797746.
>
> I’m not fully sure about this issues introduced by the upstream patch but happy to help out with making it possible to revert the patch.
>
> Thanks!
Hi,
The patch mentioned in the jekyll issue was written by me, and looks
like this:
───────┬─────────────────────────────────────────────────────────────────────────────────
│ File: debian/patches/0002-Gem-Platform-emulate-3.3.15-behavior-on-Ruby-3.1.patch
───────┼─────────────────────────────────────────────────────────────────────────────────
1 │ From: Antonio Terceiro <terceiro at debian.org>
2 │ Date: Fri, 13 Oct 2023 11:14:01 -0300
3 │ Subject: Gem::Platform: emulate 3.3.15 behavior on Ruby 3.1
4 │
5 │ rubygems 3.4 calls a Linux platform something like aarch64-linux-gnu,
6 │ where 3.3 called it just aarch64-linux. Given all the existing native
7 │ extensions for Ruby 3.1 in the Debian archive had been built
8 │ using rubygems 3.3, let's keep the old behavior on Ruby 3.1 as to not
9 │ immediately break all the existing extensions.
10 │ ---
11 │ lib/rubygems/platform.rb | 3 +++
12 │ 1 file changed, 3 insertions(+)
13 │
14 │ diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
15 │ index b721629..34d94bd 100644
16 │ --- a/lib/rubygems/platform.rb
17 │ +++ b/lib/rubygems/platform.rb
18 │ @@ -117,6 +117,9 @@ def initialize(arch)
19 │ when /^(\w+_platform)(\d+)?/ then [ $1, $2 ]
20 │ else [ "unknown", nil ]
21 │ end
22 │ +
23 │ + # emulate behavior from 3.3.15 on ruby 3.1
24 │ + @version = nil if (RUBY_VERSION < "3.2" && @os == "linux")
25 │ when Gem::Platform then
26 │ @cpu = arch.cpu
27 │ @os = arch.os
───────┴─────────────────────────────────────────────────────────────────────────────────
As far as I can remember, it was necessary in order to not need to
rebuilding every single Debian package that had been compiled before
rubygems 3.4. The workaround mentioned in a previous message will work,
but it will also break all the Debian ruby-* packages that contain
compiled code.
But, as you can see, the changed behavior only applies to ruby < 3.2. We
are about to start a transition to ruby 3.3, and that will probably take
a few months. After the transition is done, this problem will no longer
be relevant.
With that said, I could not reproduce this issue with the current
default ruby. If someone can provide a minimal reproducer, I can try to
look into it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-ruby-extras-maintainers/attachments/20240910/73d574a6/attachment.sig>
More information about the Pkg-ruby-extras-maintainers
mailing list