Skip to content

Commit

Permalink
ext: ship separate linux native gems for GNU and Musl
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Jan 25, 2024
1 parent 85baefa commit 5a3b782
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 40 deletions.
69 changes: 33 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,18 @@ jobs:
fail-fast: false
matrix:
platform:
- "aarch64-linux"
- "arm-linux"
- "arm64-darwin"
- "x64-mingw-ucrt"
- "x64-mingw32"
- "x86-linux"
- "x86_64-darwin"
- "x86_64-linux"
- aarch64-linux-gnu
- aarch64-linux-musl
- arm-linux-gnu
- arm-linux-musl
- arm64-darwin
- x64-mingw-ucrt
- x64-mingw32
- x86-linux-gnu
- x86-linux-musl
- x86_64-darwin
- x86_64-linux-gnu
- x86_64-linux-musl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -258,35 +262,28 @@ jobs:
fail-fast: false
matrix:
platform:
- aarch64-linux
# - aarch64-linux-gnu
# - aarch64-linux-musl
- arm-linux
# - arm-linux-gnu
# - arm-linux-musl
- x86-linux
# - x86-linux-gnu
# - x86-linux-musl
- x86_64-linux
# - x86_64-linux-gnu
# - x86_64-linux-musl
- aarch64-linux-gnu
- aarch64-linux-musl
- arm-linux-gnu
- arm-linux-musl
- x86-linux-gnu
- x86-linux-musl
- x86_64-linux-gnu
- x86_64-linux-musl
ruby: ["3.3", "3.2", "3.1", "3.0"]
include:
# # declare docker image for each platform
# - { platform: aarch64-linux-musl, docker_tag: "-alpine" }
# - { platform: arm-linux-musl, docker_tag: "-alpine" }
# - { platform: x86-linux-musl, docker_tag: "-alpine" }
# - { platform: x86_64-linux-musl, docker_tag: "-alpine" }
# declare docker image for each platform
- { platform: aarch64-linux-musl, docker_tag: "-alpine" }
- { platform: arm-linux-musl, docker_tag: "-alpine" }
- { platform: x86-linux-musl, docker_tag: "-alpine" }
- { platform: x86_64-linux-musl, docker_tag: "-alpine" }
# declare docker platform for each platform
- { platform: aarch64-linux, docker_platform: "--platform=linux/arm64" }
# - { platform: aarch64-linux-gnu, docker_platform: "--platform=linux/arm64" }
# - { platform: aarch64-linux-musl, docker_platform: "--platform=linux/arm64" }
- { platform: arm-linux, docker_platform: "--platform=linux/arm/v7" }
# - { platform: arm-linux-gnu, docker_platform: "--platform=linux/arm/v7" }
# - { platform: arm-linux-musl, docker_platform: "--platform=linux/arm/v7" }
- { platform: x86-linux, docker_platform: "--platform=linux/386" }
# - { platform: x86-linux-gnu, docker_platform: "--platform=linux/386" }
# - { platform: x86-linux-musl, docker_platform: "--platform=linux/386" }
- { platform: aarch64-linux-gnu, docker_platform: "--platform=linux/arm64" }
- { platform: aarch64-linux-musl, docker_platform: "--platform=linux/arm64" }
- { platform: arm-linux-gnu, docker_platform: "--platform=linux/arm/v7" }
- { platform: arm-linux-musl, docker_platform: "--platform=linux/arm/v7" }
- { platform: x86-linux-gnu, docker_platform: "--platform=linux/386" }
- { platform: x86-linux-musl, docker_platform: "--platform=linux/386" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -297,7 +294,7 @@ jobs:
- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v $PWD:/work -w /work \
${{ matrix.docker_platform}} ruby:${{ matrix.ruby }} \
${{ matrix.docker_platform}} ruby:${{ matrix.ruby }}${{ matrix.docker_tag }} \
sh -c "
gem update --system &&
./bin/test-gem-install ./gems
Expand Down Expand Up @@ -362,7 +359,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: cruby-x86_64-linux-gem
name: cruby-x86_64-linux-musl-gem
path: gems
- run: apk add build-base git
- run: ./bin/test-gem-install ./gems
12 changes: 8 additions & 4 deletions rakelib/native.rake
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ require "yaml"

cross_rubies = ["3.3.0", "3.2.0", "3.1.0", "3.0.0"]
cross_platforms = [
"aarch64-linux",
"arm-linux",
"aarch64-linux-gnu",
"aarch64-linux-musl",
"arm-linux-gnu",
"arm-linux-musl",
"arm64-darwin",
"x64-mingw-ucrt",
"x64-mingw32",
"x86-linux",
"x86-linux-gnu",
"x86-linux-musl",
"x86_64-darwin",
"x86_64-linux"
"x86_64-linux-gnu",
"x86_64-linux-musl"
]
ENV["RUBY_CC_VERSION"] = cross_rubies.join(":")

Expand Down

0 comments on commit 5a3b782

Please sign in to comment.