diff --git a/.github/workflows/_cruby_package.yml b/.github/workflows/_cruby_package.yml new file mode 100644 index 00000000000..3cc13fb6187 --- /dev/null +++ b/.github/workflows/_cruby_package.yml @@ -0,0 +1,45 @@ +on: + workflow_call: + inputs: + rcd_image_version: + description: The version of the rake-compiler-dock image to use + required: true + type: string + +jobs: + cruby-package: + name: ${{ matrix.plat }} + strategy: + fail-fast: false + matrix: + plat: + - "aarch64-linux" + - "arm-linux" + - "arm64-darwin" + - "x64-mingw-ucrt" + - "x64-mingw32" + - "x86-linux" + - "x86-mingw32" # github actions does not support this runtime as of 2022-12, but let's build anyway + - "x86_64-darwin" + - "x86_64-linux" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: actions/cache@v4 + with: + path: ports/archives + key: tarballs-ubuntu-${{ hashFiles('dependencies.yml', 'patches/**/*.patch') }} + - env: + DOCKER_IMAGE: "ghcr.io/rake-compiler/rake-compiler-dock-image:${{ inputs.rcd_image_version }}-mri-${{ matrix.plat }}" + run: | + docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \ + -e RCD_VERSION=${{ inputs.rcd_image_version }} \ + ${DOCKER_IMAGE} \ + ./scripts/test-gem-build gems ${{ matrix.plat }} + - uses: actions/upload-artifact@v4 + with: + name: "cruby-${{ matrix.plat }}-gem" + path: gems + retention-days: 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d71bca53f5..e7ad6fe03b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -572,40 +572,9 @@ jobs: cruby-package: needs: ["rcd_image_version"] - name: "cruby-package" - strategy: - fail-fast: false - matrix: - plat: - - "aarch64-linux" - - "arm-linux" - - "arm64-darwin" - - "x64-mingw-ucrt" - - "x64-mingw32" - - "x86-linux" - - "x86-mingw32" # github actions does not support this runtime as of 2022-12, but let's build anyway - - "x86_64-darwin" - - "x86_64-linux" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: actions/cache@v4 - 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: | - docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \ - ${DOCKER_IMAGE} \ - ./scripts/test-gem-build gems ${{matrix.plat}} - - uses: actions/upload-artifact@v4 - with: - name: "cruby-${{matrix.plat}}-gem" - path: gems - retention-days: 1 + uses: ./.github/workflows/_cruby_package.yml + with: + rcd_image_version: ${{ needs.rcd_image_version.outputs.rcd_image_version }} cruby-x86-linux-install: needs: ["cruby-package"] diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 834f3d17937..945ea24f767 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -211,3 +211,8 @@ jobs: - run: bundle install --local || bundle install - run: bundle exec rake compile -- --disable-system-libraries - run: bundle exec rake test + + rake-compiler-dock: + uses: ./.github/workflows/_cruby_package.yml + with: + rcd_image_version: snapshot diff --git a/rakelib/extensions.rake b/rakelib/extensions.rake index 3181dfed85d..de53a07cf66 100644 --- a/rakelib/extensions.rake +++ b/rakelib/extensions.rake @@ -72,9 +72,17 @@ CrossRuby = Struct.new(:version, :platform) do when "x86-mingw32" "i686-w64-mingw32-" when "x86_64-linux" - "x86_64-redhat-linux-gnu-" + if RakeCompilerDock::IMAGE_VERSION >= "1.6" + "x86_64-linux-gnu-" + else + "x86_64-redhat-linux-gnu-" + end when "x86-linux" - "i686-redhat-linux-gnu-" + if RakeCompilerDock::IMAGE_VERSION >= "1.6" + "i686-linux-gnu-" + else + "i686-redhat-linux-gnu-" + end when "aarch64-linux" "aarch64-linux-gnu-" when "x86_64-darwin" @@ -204,7 +212,11 @@ CrossRuby = Struct.new(:version, :platform) do def dll_ref_versions case platform when X86_LINUX_PLATFORM_REGEX - { "GLIBC" => "2.17" } + if RakeCompilerDock::IMAGE_VERSION >= "1.6" + { "GLIBC" => "2.29" } + else + { "GLIBC" => "2.17" } + end when AARCH_LINUX_PLATFORM_REGEX, ARM_LINUX_PLATFORM_REGEX { "GLIBC" => "2.29" } else diff --git a/scripts/test-gem-build b/scripts/test-gem-build index 3df73f038ab..ba440d46f11 100755 --- a/scripts/test-gem-build +++ b/scripts/test-gem-build @@ -19,7 +19,14 @@ set -u -x # avoid the pernicious "fatal: detected dubious ownership in repository" errors git config --global --add safe.directory $(realpath $(dirname $0)/..) +# RCD_VERSION is an env var that should be set in CI +if [[ "${RCD_VERSION:-}" = "snapshot" ]] ; then + bundle remove rake-compiler-dock + bundle add rake-compiler-dock --github rake-compiler/rake-compiler-dock --branch main --skip-install +fi + bundle +bundle show --paths bundle exec rake set-version-to-timestamp