Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TruffleRuby set host_cpu to aarch64 on arm64-darwin causing REUSE_AS_BINARY_ON_TRUFFLERUBY to not work as expected #3571

Closed
ntkme opened this issue May 16, 2024 · 3 comments
Assignees

Comments

@ntkme
Copy link
Contributor

ntkme commented May 16, 2024

MRI:

irb(main):001> RbConfig::CONFIG['host_cpu']
=> "arm64"
irb(main):002> Gem::Platform.local
=> #<Gem::Platform:0x0000000100754378 @cpu="arm64", @os="darwin", @version="23">

JRuby:

irb(main):001:0> RbConfig::CONFIG['host_cpu']
=> "arm64"
irb(main):002:0> Gem::Platform.local
=> #<Gem::Platform:0x93fb44 @cpu="universal", @os="java", @version="17">

TruffleRuby:

irb(main):001:0> RbConfig::CONFIG['host_cpu']
=> "aarch64"
irb(main):002:0> Gem::Platform.local
=> #<Gem::Platform:0x1be78 @cpu="aarch64", @os="darwin", @version=nil>

Because MRI normalized aarch64 to arm64 on darwin, prebuilt native gems are shipped as arm64-darwin. This causes a platform mismatch when a gem is part of REUSE_AS_BINARY_ON_TRUFFLERUBY.

Historically, the gem platform normalization convention is messy. E.g.

  • aarch64-linux, aarch64-mingw-ucrt, but arm64-darwin...
  • x86_64-linux, x86_64-darwin, but x64-mingw-ucrt...

However, gem authors have been publish gems with these as a naming convention for the known platforms, it's probably better for truffleruby to normalize its host_cpu to arm64 on darwin.

@ntkme ntkme changed the title TruffleRuby set host_cpu is set to aarch64 on arm64-darwin causing REUSE_AS_BINARY_ON_TRUFFLERUBY to not work as expected TruffleRuby set host_cpu to aarch64 on arm64-darwin causing REUSE_AS_BINARY_ON_TRUFFLERUBY to not work as expected May 16, 2024
@ntkme
Copy link
Contributor Author

ntkme commented May 16, 2024

Related: jruby/jruby#7132

@andrykonchin
Copy link
Member

Thank you for the report, we'll look into it.

@eregon eregon added this to the 24.1.0 Release (Sep 17, 2024) milestone May 31, 2024
@eregon
Copy link
Member

eregon commented May 31, 2024

From https://github.com/eregon/actions-shell/actions/runs/9318186931/job/25650009861, arm64 is used in ruby -v, RUBY_PLATFORM and RbConfig (except build and build_cpu which are aarch64, but I think we don't have those in TruffleRuby anyway).

@andrykonchin andrykonchin self-assigned this Jun 5, 2024
graalvmbot pushed a commit that referenced this issue Jun 7, 2024
andrykonchin pushed a commit to ruby/spec that referenced this issue Jun 7, 2024
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

No branches or pull requests

3 participants