Skip to content

Comments

Fix arm64-darwin release build#54

Merged
ZilvinasKucinskas merged 3 commits intomainfrom
fix-arm64-darwin-release
Feb 18, 2026
Merged

Fix arm64-darwin release build#54
ZilvinasKucinskas merged 3 commits intomainfrom
fix-arm64-darwin-release

Conversation

@ZilvinasKucinskas
Copy link
Contributor

@ZilvinasKucinskas ZilvinasKucinskas commented Feb 18, 2026

Summary

  • BoringSSL cross-compilation for Darwin fails inside rb-sys-dock Linux containers — CMake picks up /usr/bin/ld (ELF linker) instead of the osxcross Mach-O linker
  • No upstream project (wreq, rnet, boring) cross-compiles BoringSSL for Darwin from Linux; they all use native macOS runners
  • Move arm64-darwin out of the cross-compile matrix into a dedicated native-darwin job on macos-latest
  • Build per-Ruby-version binaries (3.3, 3.4, 4.0) matching the layout rb-sys-dock produces for Linux
  • Add Swatinem/rust-cache so BoringSSL isn't rebuilt from scratch every release
  • Extract gem packaging into script/build_platform_gem.rb with required_ruby_version upper bound
  • Add macOS smoke tests across all supported Ruby versions
  • Remove stale arm64-darwin from Rakefile cross_platform

Note

Medium Risk
Changes the release pipeline and gem packaging for macOS, which could affect published artifacts and CI reliability if the new per-Ruby binary layout or packaging script is incorrect.

Overview
Fixes arm64-darwin release builds by removing Darwin from the Linux rb-sys-dock cross-compile matrix and adding a dedicated native-darwin job that compiles per-Ruby binaries (3.3/3.4/4.0) on macos-latest with Rust caching.

Adds script/build_platform_gem.rb to package those prebuilt .bundle/.so artifacts into a platform gem (with explicit required_ruby_version bounds), updates the release workflow to publish the new Darwin artifact, and introduces a macOS smoke-test job; the Rakefile cross_platform list is updated to only include Linux targets.

Written by Cursor Bugbot for commit 49f8f69. This will update automatically on new commits. Configure here.

BoringSSL cannot be cross-compiled for Darwin from Linux because
CMake picks up /usr/bin/ld (ELF linker) instead of the osxcross
Mach-O linker inside rb-sys-dock containers.

Switch arm64-darwin to a native macos-latest runner that compiles
natively, avoiding the cross-compilation issue entirely. Add macOS
smoke tests to verify the gem loads on Ruby 3.3, 3.4, and 4.0.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

- Compile separate .bundle for Ruby 3.3, 3.4, and 4.0 on macOS,
  matching the per-version binary layout rb-sys-dock produces for Linux
- Add Swatinem/rust-cache to avoid rebuilding BoringSSL every release
- Extract gem packaging into script/build_platform_gem.rb with
  required_ruby_version upper bound (>= 3.3, < 4.1.dev)
- Rename artifact to native-gem-arm64-darwin (not cross-compiled)
- Remove stale arm64-darwin from Rakefile cross_platform
- Include magnus and serde_magnus in cargo clean (both have
  version-conditional #[cfg(ruby_gte_*)] code that must recompile)
- Add cargo clean before first compilation too (handles stale cache
  from previous release run)
- Abort if no compiled binaries found before packaging gem
- Simplify glob to idiomatic spec.files +=
@ZilvinasKucinskas ZilvinasKucinskas merged commit 20df3a7 into main Feb 18, 2026
5 checks passed
@ZilvinasKucinskas ZilvinasKucinskas deleted the fix-arm64-darwin-release branch February 18, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant