-
Notifications
You must be signed in to change notification settings - Fork 190
Add musl binary gem support #649
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
Conversation
3db477f to
817bd5a
Compare
This will allow Alpine-based containers to use the precompiled gems without having to install `gcompat`. Relates to ged#648
817bd5a to
88e93c4
Compare
| ['x86_64-linux', 'linux-x86_64', 'x86_64-linux-gnu'], | ||
| ['aarch64-linux', 'linux-aarch64', 'aarch64-linux-gnu'], | ||
| ['x86_64-linux-gnu', 'linux-x86_64', 'x86_64-linux-gnu'], | ||
| ['x86_64-linux-musl', 'linux-x86_64', 'x86_64-unknown-linux-musl'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why this one is unknown-linux while below is linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cbandy I think it's because the gnu compiler is installed via the Ubuntu packages, while the musl compiler is built and installed from https://github.com/richfelker/musl-cross-make.git (see rake-compiler/rake-compiler-dock@da4268d5#diff-f840daec2e49fd92de367e204a8dc78d8713fc3ea99f724da29a841798730fa9):
$ docker run -it ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-x86_64-linux-gnu bash
root@06bb6bae360a:/# dpkg -S x86_64-linux-gnu-gcc
gcc-9: /usr/bin/x86_64-linux-gnu-gcc-ranlib-9
gcc: /usr/bin/x86_64-linux-gnu-gcc-ar
gcc: /usr/bin/x86_64-linux-gnu-gcc
gcc-9: /usr/share/man/man1/x86_64-linux-gnu-gcc-9.1.gz
gcc: /usr/share/man/man1/x86_64-linux-gnu-gcc-ranlib.1.gz
gcc: /usr/bin/x86_64-linux-gnu-gcc-ranlib
gcc: /usr/bin/x86_64-linux-gnu-gcc-nm
gcc-9: /usr/bin/x86_64-linux-gnu-gcc-ar-9
gcc-9: /usr/share/man/man1/x86_64-linux-gnu-gcc-ranlib-9.1.gz
gcc-9: /usr/share/man/man1/x86_64-linux-gnu-gcc-ar-9.1.gz
gcc: /usr/share/man/man1/x86_64-linux-gnu-gcc.1.gz
gcc: /usr/share/man/man1/x86_64-linux-gnu-gcc-ar.1.gz
gcc: /usr/share/man/man1/x86_64-linux-gnu-gcc-nm.1.gz
gcc-9: /usr/share/man/man1/x86_64-linux-gnu-gcc-nm-9.1.gz
gcc-9: /usr/bin/x86_64-linux-gnu-gcc-9
gcc-9: /usr/bin/x86_64-linux-gnu-gcc-nm-9$ docker run -it ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-x86_64-linux-musl bash
root@e97ee7e32d0e:/# which x86_64-unknown-linux-musl-gcc
/usr/bin/x86_64-unknown-linux-musl-gcc
root@e97ee7e32d0e:/# dpkg -S x86_64-unknown-linux-musl-gcc
dpkg-query: no path found matching pattern *x86_64-unknown-linux-musl-gcc*
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to test arm64 as well?
diff --git a/.github/workflows/binary-gems.yml b/.github/workflows/binary-gems.yml
index fbed528..3e9fd13 100644
--- a/.github/workflows/binary-gems.yml
+++ b/.github/workflows/binary-gems.yml
@@ -172,6 +172,10 @@ jobs:
image_platform: linux/x86_64
gem_platform: x86_64-linux-musl
dockerfile: alpine
+ - from_image: alpine
+ image_platform: linux/arm64
+ gem_platform: aarch64-linux-musl
+ dockerfile: alpine
runs-on: ubuntu-latest
steps:RubyGems version >= 3.3.22 is needed, so just bump the Ruby version from 3.0 to 3.1. This fixes https://github.com/ged/ruby-pg/actions/runs/16579089729/job/46916537537.
|
I know from ffi.gem that platform |
|
@larskanis See the detailed notes by @flavorjones in rake-compiler/rake-compiler-dock#117:
|
|
Thank you @stanhu for the pointer! I checked it and my conclusion is that it makes more sense to provide The only thing I worry about is the situation when rubygems or bundler completely fails. I can reproduce the IMHO the added requirement of a more recent rubygems version is worse than the "bad" decision to install the non-musl gem on a musl system. |
As discussed in ged#649 (comment).
|
@larskanis Ok! I've updated this to test both |
|
Oh, I should have notified you. I already put #649 together. The problem is that it fails because after sucessfully building |
|
Thanks. I'll close this in favor of #657 then. |
|
Great! Looking forward to the next release. |
This will allow Alpine-based containers to use the precompiled gems without having to install
gcompat.Relates to #648