Add native gem precompilation support#4080
Conversation
Package precompiled native gems for Ruby 3.3, 3.4, and 4.0 across 10 platforms: aarch64-linux-gnu, aarch64-linux-musl, aarch64-mingw-ucrt, arm-linux-gnu, arm-linux-musl, arm64-darwin, x64-mingw-ucrt, x86_64-darwin, x86_64-linux-gnu, and x86_64-linux-musl. - Add Ruby-version-aware extension loader in lib/prism.rb with GLIBC error message for musl/glibc mismatches - Add cross-compilation support to Rakefile using rake-compiler-dock - Add CI workflow for building and testing native gems across all platforms and Ruby versions - Add bin/ scripts for building, installing, testing, and verifying gems Also, temporarily switch to manual publishing via bin/build-gems + gem push, and remove automated publish-gem.yml workflow. We should plan on adding automated publishing of native gems once this all works.
The "gem" task does not exist.
|
Only minor comment (that can be left until after merge) is that I'd love these It seems like right now the GitHub action triggers on a bunch of stuff, but presumably after you get CI passing we'll switch it to just tags right? |
I don't think it's obvious that they should be rake tasks, but I do want to try to follow the project conventions. If that's what you want, we can try to make it work. The shell scripts are intentionally operating outside of bundler, and test-gem-file-contents is a self-contained minitest suite.
I mean, it's obviously up to you when you want to run these tests, but my implementation decision to run these tests on every pull request is intentional. The new workflow isn't publishing, it's testing:
and I think these are valuable tests for any PR that modifies the source code or the build process. |
to make sure CI can use precompiled nokogiri.
WIP: Looking for CI feedback on this approach.
Closes #4026
Package precompiled native gems for Ruby 3.3, 3.4, and 4.0 across 10 platforms: aarch64-linux-gnu, aarch64-linux-musl, aarch64-mingw-ucrt, arm-linux-gnu, arm-linux-musl, arm64-darwin, x64-mingw-ucrt, x86_64-darwin, x86_64-linux-gnu, and x86_64-linux-musl.
Also, temporarily switch to manual publishing via bin/build-gems + gem push, and remove automated publish-gem.yml workflow. We should plan on adding automated publishing of native gems once this all works.
This approach uses rake-compiler-dock to build a broad set of platform gems, including GNU and Musl linux variants.
I also have an experimental branch that uses https://github.com/shopify/cibuildgem, however I think for a gem like prism it may be prudent to choose the more mature rake-compiler-dock toolchain, until cibuildgem is at parity.