Skip to content

Commit

Permalink
ext: stop precompiling native gems for x86-linux and x86-mingw32 (#3374)
Browse files Browse the repository at this point in the history
**What problem is this PR intended to solve?**

Stop precompiling native gems for `x86-linux` and `x86-mingw32`.

Also, backfill documentation changes for dropping Ruby 3.0 and
x64-mingw32 which should have been part of #3368.

Closes #3369
  • Loading branch information
flavorjones authored Dec 12, 2024
2 parents 769a0cc + d078c26 commit 56c8119
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 59 deletions.
6 changes: 0 additions & 6 deletions .cross_rubies
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@
3.1.0:arm-linux
3.1.0:arm64-darwin
3.1.0:x64-mingw-ucrt
3.1.0:x86-linux
3.1.0:x86-mingw32
3.1.0:x86_64-darwin
3.1.0:x86_64-linux
3.2.0:aarch64-linux
3.2.0:arm-linux
3.2.0:arm64-darwin
3.2.0:x64-mingw-ucrt
3.2.0:x86-linux
3.2.0:x86-mingw32
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-linux
3.3.0:x86-mingw32
3.3.0:x86_64-darwin
3.3.0:x86_64-linux
24 changes: 0 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,6 @@ jobs:
- "arm-linux"
- "arm64-darwin"
- "x64-mingw-ucrt"
- "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
Expand All @@ -594,28 +592,6 @@ jobs:
path: gems
retention-days: 1

cruby-x86-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-x86-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/386 \
ruby:${{matrix.ruby}} \
./scripts/test-gem-install gems
cruby-aarch64-linux-install:
needs: ["cruby-package", "ruby_versions"]
strategy:
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ Nokogiri follows [Semantic Versioning](https://semver.org/), please see the [REA

## next / unreleased

### ...
### Notable Changes

#### Ruby

This release ends support for Ruby 3.0, for which [upstream support ended 2024-04-23](https://www.ruby-lang.org/en/downloads/branches/).

This release drops precompiled native platform gems for `x86-linux` and `x86-mingw32`. **These platforms are still supported.** Users on these platforms must install the "ruby platform" gem which requires a compiler toolchain. See [Installing the `ruby` platform gem](https://nokogiri.org/tutorials/installing_nokogiri.html#installing-the-ruby-platform-gem) in the installation docs. (#3369, #3081)


## v1.17.1 / 2024-12-10
Expand Down
12 changes: 6 additions & 6 deletions LICENSE-DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Note that this document is broken into multiple sections, each of which describe

- [Platform Releases](#platform-releases)
* [Default platform release ("ruby")](#default-platform-release-ruby)
* [Native LinuxⓇ platform releases ("x86_64-linux", "arm64-linux", "aarch64-linux", and "arm-linux")](#native-linux%E2%93%A1-platform-releases-x86_64-linux-arm64-linux-aarch64-linux-and-arm-linux)
* [Native LinuxⓇ platform releases ("x86_64-linux", "aarch64-linux", and "arm-linux")](#native-linux%E2%93%A1-platform-releases-x86_64-linux-aarch64-linux-and-arm-linux)
* [Native Darwin (macOSⓇ) platform releases ("x86_64-darwin" and "arm64-darwin")](#native-darwin-macos%E2%93%A1-platform-releases-x86_64-darwin-and-arm64-darwin)
* [Native WindowsⓇ platform releases ("x86-mingw32" and "x64-mingw32")](#native-windows%E2%93%A1-platform-releases-x86-mingw32-and-x64-mingw32)
* [Native WindowsⓇ platform releases ("x64-mingw-ucrt")](#native-windows%E2%93%A1-platform-releases-x64-mingw-ucrt)
* [JavaⓇ (JRuby) platform release ("java")](#java%E2%93%A1-jruby-platform-release-java)
- [Appendix: Dependencies' License Texts](#appendix-dependencies-license-texts)
* [libgumbo](#libgumbo)
Expand Down Expand Up @@ -51,7 +51,7 @@ The default platform release distributes the following dependencies in source fo
This distribution can be identified by inspecting the included Gem::Specification, which will have the value "ruby" for its "platform" attribute.


### Native LinuxⓇ platform releases ("x86_64-linux", "arm64-linux", "aarch64-linux", and "arm-linux")
### Native LinuxⓇ platform releases ("x86_64-linux", "aarch64-linux", and "arm-linux")

The native LinuxⓇ platform release distributes the following dependencies in source form:

Expand All @@ -60,7 +60,7 @@ The native LinuxⓇ platform release distributes the following dependencies in s
* [libgumbo](#libgumbo)
* [zlib](#zlib)

This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x86_64-linux" or "arm64-linux" for its "platform.cpu" attribute.
This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x86_64-linux" or "aarch64-linux" for its "platform.cpu" attribute.


### Native Darwin (macOSⓇ) platform releases ("x86_64-darwin" and "arm64-darwin")
Expand All @@ -76,7 +76,7 @@ The native Darwin platform release distributes the following dependencies in sou
This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x86_64-darwin" or "arm64-darwin" for its "platform.cpu" attribute. Darwin is also known more familiarly as "OSX" or "macOSⓇ" and is the operating system for many AppleⓇ computers.


### Native WindowsⓇ platform releases ("x86-mingw32" and "x64-mingw32")
### Native WindowsⓇ platform releases ("x64-mingw-ucrt")

The native WindowsⓇ platform release distributes the following dependencies in source form:

Expand All @@ -86,7 +86,7 @@ The native WindowsⓇ platform release distributes the following dependencies in
* [zlib](#zlib)
* [libiconv](#libiconv)

This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x64-mingw32" or "x86-mingw32" for its "platform.cpu" attribute.
This distribution can be identified by inspecting the included Gem::Specification, which will have a value similar to "x64-mingw-ucrt" for its "platform.cpu" attribute.


### JavaⓇ (JRuby) platform release ("java")
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ 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-linux` and `x86_64-linux` (req: `glibc >= 2.17`)
- `x86_64-linux` (req: `glibc >= 2.17`)
- `aarch64-linux` and `arm-linux` (req: `glibc >= 2.29`)
- Note that musl platforms like Alpine **are** supported
- Darwin/MacOS: `x86_64-darwin` and `arm64-darwin`
- Windows: `x86-mingw32`, `x64-mingw32`, and `x64-mingw-ucrt`
- Windows: `x64-mingw-ucrt`
- Java: any platform running JRuby 9.4 or higher

To determine whether your system supports one of these gems, look at the output of `bundle platform` or `ruby -e 'puts Gem::Platform.local.to_s'`.
Expand Down
22 changes: 2 additions & 20 deletions rakelib/extensions.rake
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,8 @@ CrossRuby = Struct.new(:version, :platform) do
@host ||= case platform
when "x64-mingw-ucrt"
"x86_64-w64-mingw32"
when "x64-mingw32"
"x86_64-w64-mingw32"
when "x86-mingw32"
"i686-w64-mingw32"
when "x86_64-linux"
"x86_64-linux-gnu"
when "x86-linux"
"i686-linux-gnu"
when "aarch64-linux"
"aarch64-linux"
when "x86_64-darwin"
Expand All @@ -67,14 +61,10 @@ CrossRuby = Struct.new(:version, :platform) do

def tool(name)
(@binutils_prefix ||= case platform
when "x64-mingw-ucrt", "x64-mingw32"
when "x64-mingw-ucrt"
"x86_64-w64-mingw32-"
when "x86-mingw32"
"i686-w64-mingw32-"
when "x86_64-linux"
"x86_64-redhat-linux-gnu-"
when "x86-linux"
"i686-redhat-linux-gnu-"
when "aarch64-linux"
"aarch64-linux-gnu-"
when "x86_64-darwin"
Expand All @@ -90,14 +80,10 @@ CrossRuby = Struct.new(:version, :platform) do

def target_file_format
case platform
when "x64-mingw-ucrt", "x64-mingw32"
when "x64-mingw-ucrt"
"pei-x86-64"
when "x86-mingw32"
"pei-i386"
when "x86_64-linux"
"elf64-x86-64"
when "x86-linux"
"elf32-i386"
when "aarch64-linux"
"elf64-littleaarch64"
when "x86_64-darwin"
Expand All @@ -123,10 +109,6 @@ CrossRuby = Struct.new(:version, :platform) do
case platform
when "x64-mingw-ucrt"
"x64-ucrt-ruby#{api_ver_suffix}.dll"
when "x64-mingw32"
"x64-msvcrt-ruby#{api_ver_suffix}.dll"
when "x86-mingw32"
"msvcrt-ruby#{api_ver_suffix}.dll"
else
raise "CrossRuby.libruby_dll: unmatched platform: #{platform}"
end
Expand Down

0 comments on commit 56c8119

Please sign in to comment.