Skip to content

Commit

Permalink
ext: update to rake-compiler-dock v1.6.0, ship both GNU and Musl nati…
Browse files Browse the repository at this point in the history
…ve gems (#3375)

**What problem is this PR intended to solve?**

Update rake-compiler-dock to the v1.6.0 version that drops manylinux
before we move on to a v1.7.0 version that will presumably support Ruby
3.4.

As a result of the change from a manylinux image patched to be
less-musl-compatible, we're also forced to start shipping separate GNU
and Musl gems (see [crash
log](https://github.com/sparklemotion/nokogiri/actions/runs/12308677470/job/34354672430)
when running the generic linux gem on musl).


**Have you included adequate test coverage?**

Existing coverage is sufficient.


**Does this change affect the behavior of either the C or the Java
implementations?**

N/A
  • Loading branch information
flavorjones authored Dec 13, 2024
2 parents 56c8119 + 3c0d202 commit ca8a4e6
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 189 deletions.
33 changes: 21 additions & 12 deletions .cross_rubies
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
3.1.0:aarch64-linux
3.1.0:arm-linux
3.1.0:aarch64-linux-gnu
3.1.0:aarch64-linux-musl
3.1.0:arm-linux-gnu
3.1.0:arm-linux-musl
3.1.0:arm64-darwin
3.1.0:x64-mingw-ucrt
3.1.0:x86_64-darwin
3.1.0:x86_64-linux
3.2.0:aarch64-linux
3.2.0:arm-linux
3.1.0:x86_64-linux-gnu
3.1.0:x86_64-linux-musl
3.2.0:aarch64-linux-gnu
3.2.0:aarch64-linux-musl
3.2.0:arm-linux-gnu
3.2.0:arm-linux-musl
3.2.0:arm64-darwin
3.2.0:x64-mingw-ucrt
3.2.0:x86_64-darwin
3.2.0:x86_64-linux
3.3.0:aarch64-linux
3.3.0:arm-linux
3.3.0:arm64-darwin
3.3.0:x64-mingw-ucrt
3.3.0:x86_64-darwin
3.3.0:x86_64-linux
3.2.0:x86_64-linux-gnu
3.2.0:x86_64-linux-musl
3.3.5:aarch64-linux-gnu
3.3.5:aarch64-linux-musl
3.3.5:arm-linux-gnu
3.3.5:arm-linux-musl
3.3.5:arm64-darwin
3.3.5:x64-mingw-ucrt
3.3.5:x86_64-darwin
3.3.5:x86_64-linux-gnu
3.3.5:x86_64-linux-musl
142 changes: 55 additions & 87 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,9 @@ jobs:
with:
path: ports/archives
key: tarballs-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
- env:
DOCKER_IMAGE: "ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.rcd_image_version.outputs.rcd_image_version}}-mri-x86_64-linux"
run: |
- run: |
docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \
${DOCKER_IMAGE} \
ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.rcd_image_version.outputs.rcd_image_version}}-mri-x86_64-linux-gnu \
./scripts/test-gem-build gems ruby
- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -565,12 +563,15 @@ jobs:
fail-fast: false
matrix:
plat:
- "aarch64-linux"
- "arm-linux"
- "aarch64-linux-gnu"
- "aarch64-linux-musl"
- "arm-linux-gnu"
- "arm-linux-musl"
- "arm64-darwin"
- "x64-mingw-ucrt"
- "x86_64-darwin"
- "x86_64-linux"
- "x86_64-linux-gnu"
- "x86_64-linux-musl"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -580,63 +581,17 @@ jobs:
with:
path: ports/archives
key: tarballs-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
- env:
DOCKER_IMAGE: "ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.rcd_image_version.outputs.rcd_image_version}}-mri-${{matrix.plat}}"
run: |
- run: |
docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \
${DOCKER_IMAGE} \
ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.rcd_image_version.outputs.rcd_image_version}}-mri-${{matrix.plat}} \
./scripts/test-gem-build gems ${{matrix.plat}}
- uses: actions/upload-artifact@v4
with:
name: "cruby-${{matrix.plat}}-gem"
path: gems
retention-days: 1

cruby-aarch64-linux-install:
needs: ["cruby-package", "ruby_versions"]
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.ruby_versions.outputs.minors) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: cruby-aarch64-linux-gem
path: gems
- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \
--platform=linux/arm64/v8 \
ruby:${{matrix.ruby}} \
./scripts/test-gem-install gems
cruby-arm-linux-install:
needs: ["cruby-package", "ruby_versions"]
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.ruby_versions.outputs.minors) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: cruby-arm-linux-gem
path: gems
- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \
--platform=linux/arm/v7 \
ruby:${{matrix.ruby}} \
./scripts/test-gem-install gems
cruby-x86_64-linux-install:
cruby-install-with-setup-ruby:
needs: ["cruby-package", "ruby_versions"]
strategy:
fail-fast: false
Expand All @@ -652,64 +607,77 @@ jobs:
ruby-version: "${{matrix.ruby}}"
- uses: actions/download-artifact@v4
with:
name: cruby-x86_64-linux-gem
name: cruby-x86_64-linux-gnu-gem
path: gems
- run: ./scripts/test-gem-install gems

cruby-x86_64-musl-install:
needs: ["cruby-package"]
strategy:
fail-fast: false
runs-on: ubuntu-latest
container:
image: ghcr.io/sparklemotion/nokogiri-test:alpine
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: cruby-x86_64-linux-gem
path: gems
- run: ./scripts/test-gem-install gems

cruby-x86_64-darwin-install:
cruby-linux-install-matrix:
needs: ["cruby-package", "ruby_versions"]
name: "cruby-${{ matrix.platform }}-install (${{ matrix.ruby }})"
strategy:
fail-fast: false
matrix:
platform:
- aarch64-linux-gnu
- aarch64-linux-musl
- arm-linux-gnu
- arm-linux-musl
- x86_64-linux-gnu
- x86_64-linux-musl
ruby: ${{ fromJSON(needs.ruby_versions.outputs.minors) }}
runs-on: macos-13
include:
# declare docker image for each platform
- { platform: aarch64-linux-musl, docker_tag: "-alpine", bootstrap: "apk add bash build-base &&" }
- { platform: arm-linux-musl, docker_tag: "-alpine", bootstrap: "apk add bash build-base &&" }
- { platform: x86_64-linux-musl, docker_tag: "-alpine", bootstrap: "apk add bash build-base &&" }
# declare docker platform for each platform
- { platform: aarch64-linux-gnu, docker_platform: "--platform=linux/arm64/v8" }
- { platform: aarch64-linux-musl, docker_platform: "--platform=linux/arm64/v8" }
- { platform: arm-linux-gnu, docker_platform: "--platform=linux/arm/v7" }
- { platform: arm-linux-musl, docker_platform: "--platform=linux/arm/v7" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
- uses: actions/download-artifact@v4
with:
name: cruby-x86_64-darwin-gem
name: cruby-${{ matrix.platform }}-gem
path: gems
- run: ./scripts/test-gem-install gems

cruby-arm64-darwin-install:
- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v $PWD:/nokogiri -w /nokogiri \
${{ matrix.docker_platform }} ruby:${{ matrix.ruby }}${{ matrix.docker_tag }} \
sh -c "
${{ matrix.bootstrap }}
${{ matrix.rubyenv }}
./scripts/test-gem-install gems
"
cruby-darwin-install-matrix:
needs: ["cruby-package", "ruby_versions"]
name: "cruby-${{ matrix.platform }}-install (${{ matrix.ruby }})"
strategy:
fail-fast: false
matrix:
platform:
- arm64-darwin
- x86_64-darwin
ruby: ${{ fromJSON(needs.ruby_versions.outputs.minors) }}
runs-on: macos-14
include:
- { platform: arm64-darwin, os: macos-14 }
- { platform: x86_64-darwin, os: macos-13 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
ruby-version: "${{ matrix.ruby }}"
- uses: actions/download-artifact@v4
with:
name: cruby-arm64-darwin-gem
name: cruby-${{ matrix.platform }}-gem
path: gems
- run: ./scripts/test-gem-install gems

Expand Down Expand Up @@ -768,6 +736,6 @@ jobs:
name: jruby-gem
path: gems
- run: |
docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \
docker run --rm -v "$PWD:/nokogiri" -w /nokogiri \
jruby:${{matrix.jruby}}-jre${{matrix.jre}} \
./scripts/test-gem-install gems
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ group :development do

# building extensions
gem "rake-compiler", "1.2.8"
gem "rake-compiler-dock", "1.5.2"
gem "rake-compiler-dock", "1.6.0"

# parser generator
gem "rexical", "1.0.8"
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ If you are compiling the native extension against a system version of libxml2:
Nokogiri ships pre-compiled, "native" gems for the following platforms:

- Linux:
- `x86_64-linux` (req: `glibc >= 2.17`)
- `aarch64-linux` and `arm-linux` (req: `glibc >= 2.29`)
- Note that musl platforms like Alpine **are** supported
- `x86_64-linux-gnu`, `aarch64-linux-gnu`, and `arm-linux-gnu` (req: `glibc >= 2.29`)
- `x86_64-linux-musl`, `aarch64-linux-musl`, and `arm-linux-musl`
- Darwin/MacOS: `x86_64-darwin` and `arm64-darwin`
- Windows: `x64-mingw-ucrt`
- Java: any platform running JRuby 9.4 or higher
Expand Down
Loading

0 comments on commit ca8a4e6

Please sign in to comment.