Skip to content

document how bundler and rubygems behave wrt linux, linux-gnu, and linux-musl releases #117

@flavorjones

Description

@flavorjones

We know that rubygems 3.33.22 / bundler 2.3.21 is required for basic support of linux-gnu and linux-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 and linux-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.

  • v0.5.0 and v0.5.0.1 are "linux + linux-musl"
  • v0.5.1 is `"linux-gnu + linux--musl"

Note that the versions in question being tested below are:

ruby gem bundler
3.0 3.2.33 2.2.33
3.0 (updated rubygems) 3.5.7 2.5.7
3.1 3.3.26 2.3.26
3.2 3.4.19 2.4.19
3.3 3.5.3 2.5.3

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

target linux + linux-musl (v0.5.0.1) linux-gnu + linux-musl (v0.5.1)
3.0 gnu ✔ installs -linux 🤷 installs source gem
3.0 musl ✖ installs -linux 🤷 installs source gem
3.0 gnu (updated rubygems) ✔ installs -linux ✔ installs -linux-gnu
3.0 musl (updated rubygems) ✔ installs -linux-musl ✔ installs -linux-musl
3.1 gnu ✔ installs -linux ✔ installs -linux-gnu
3.1 musl ✔ installs -linux-musl ✔ installs -linux-musl
3.2 gnu ✔ installs -linux ✔ installs -linux-gnu
3.2 musl ✔ installs -linux-musl ✔ installs -linux-musl
3.3 gnu ✔ installs -linux ✔ installs -linux-gnu
3.3 musl ✔ installs -linux-musl ✔ installs -linux-musl

testing bundle install

target linux + linux-musl (v0.5.0.1) linux-gnu + linux-musl (v0.5.1)
3.0 gnu ✔ installs -linux 🤷 installs source gem
3.0 musl 🤷 installs source gem 🤷 installs source gem
3.0 gnu (updated rubygems) ✖ fails to install [1] ✔ installs -linux-gnu
3.0 musl (updated rubygems) ✔ installs -linux-musl ✔ installs -linux-musl
3.1 gnu ✔ installs -linux ✔ installs -linux-gnu
3.1 musl ✔ installs -linux-musl ✔ installs -linux-musl
3.2 gnu ✔ installs -linux ✔ installs -linux-gnu
3.2 musl ✔ installs -linux-musl ✔ installs -linux-musl
3.3 gnu ✔ installs -linux ✔ installs -linux-gnu
3.3 musl ✖ installs -linux ✔ installs -linux-musl

Error [1]:

Could not find gems matching 'rcee_precompiled (= 0.5.0.1)' valid for all resolution platforms (aarch64-linux-musl,
aarch64-linux, arm-linux-musl, arm-linux, arm64-darwin, x86-linux-musl, x86-linux, x86_64-darwin, x86_64-linux-musl) in
rubygems repository https://rubygems.org/ or installed locally.

The source contains the following gems matching 'rcee_precompiled (= 0.5.0.1)':
  * rcee_precompiled-0.5.0.1-aarch64-linux
  * rcee_precompiled-0.5.0.1-aarch64-linux-musl
  * rcee_precompiled-0.5.0.1-arm-linux
  * rcee_precompiled-0.5.0.1-arm-linux-musl
  * rcee_precompiled-0.5.0.1-arm64-darwin
  * rcee_precompiled-0.5.0.1
  * rcee_precompiled-0.5.0.1-x64-mingw-ucrt
  * rcee_precompiled-0.5.0.1-x64-mingw32
  * rcee_precompiled-0.5.0.1-x86-linux
  * rcee_precompiled-0.5.0.1-x86-linux-musl
  * rcee_precompiled-0.5.0.1-x86_64-darwin
  * rcee_precompiled-0.5.0.1-x86_64-linux
  * rcee_precompiled-0.5.0.1-x86_64-linux-musl

Recommendations

Given the inconsisent behavior of gem and bundle when the gem in question ships linux and linux-musl platform gems, it seems pretty clear that it's not a good idea to do this.

So the recommendation has to be:

  • either:
    • ship a -linux platform gem that works for both gnu and musl systems,
    • or ship both -linux-gnu and -linux-musl platform gems.
  • do NOT ship -linux and -linux-musl platform gems for the same version.

The installation docs for users should contain some warnings:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions