enkessler / childprocess

Cross-platform Ruby library for managing child processes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`host_cpu` changes between Ruby 2.7.2 and 2.7.3

JoshCheek opened this issue · comments

Version:

$ ruby -r childprocess -e 'p ChildProcess::VERSION'
"4.1.0"

The host_cpu changes between patchlevel versions:

$ ruby-install -c -j12 --no-install-deps -r "$HOME"/tmp ruby 2.7.2
$ ruby-install -c -j12 --no-install-deps -r "$HOME"/tmp ruby 2.7.3

$ ruby-2.7.2/bin/ruby -e 'puts RbConfig::CONFIG["host_cpu"]'
arm

$ ruby-2.7.3/bin/ruby -e 'puts RbConfig::CONFIG["host_cpu"]'
arm64

This means that #177 is correct for Ruby 2.7.3+ (including 3.0.x), but for 2.7.2, it looks for the file "arm-macosx.rb" instead of "arm64-macosx.rb".

This leads to #176 still being an issue on Ruby <= 2.7.2

eg:

$ CHILDPROCESS_POSIX_SPAWN=true ruby-2.7.2/bin/ruby -r childprocess -e ChildProcess.new
W, [2021-06-15T22:47:08.489959 #94108]  WARN -- : posix_spawn is not yet supported on arm-macosx (arm64-darwin20), falling back to default implementation. If you believe this is an error, please file a bug at http://github.com/enkessler/childprocess/issues

$ CHILDPROCESS_POSIX_SPAWN=true ruby-2.7.3/bin/ruby -r childprocess -e ChildProcess.new

On TruffleRuby 22.2.0 running on Apple M1 it is different too:

RbConfig::CONFIG['host_cpu']
=> "aarch64"

Sorry this never got a response. Since Ruby 2.7 has reached end-of-life in March 2023, would suggest at this point to upgrade Ruby instead (unless you're seeing this same issue in Ruby 3.x)