Skip to content

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

@ntkme

Description

@ntkme

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions