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
updating to rake-compiler-dock 1.5.0
  • Loading branch information
flavorjones committed Apr 15, 2024
1 parent 0f43d39 commit aba0c06
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 41 deletions.
70 changes: 34 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,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 @@ -257,35 +261,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", bootstrap: "apk add build-base &&" }
- { platform: arm-linux-musl, docker_tag: "-alpine", bootstrap: "apk add build-base &&" }
- { platform: x86-linux-musl, docker_tag: "-alpine", bootstrap: "apk add build-base &&" }
- { platform: x86_64-linux-musl, docker_tag: "-alpine", bootstrap: "apk add build-base &&" }
# 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 @@ -296,8 +293,9 @@ 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 "
${{ matrix.bootstrap }}
gem update --system &&
./bin/test-gem-install ./gems
"
Expand Down Expand Up @@ -361,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
- if: matrix.ruby == '3.0' # https://github.com/rake-compiler/rake-compiler/pull/236
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ group :development do
gem "minitest", "5.22.3"

gem "rake-compiler", "1.2.7"
gem "rake-compiler-dock", "1.4.0"
gem "rake-compiler-dock", "1.5.0"

gem "ruby_memcheck", "2.3.0" if Gem::Platform.local.os == "linux"

Expand Down
12 changes: 8 additions & 4 deletions rakelib/native.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,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 aba0c06

Please sign in to comment.