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

Should work for the M1 chip, but needs to be mapped or smth #176

Closed
JoshCheek opened this issue Mar 16, 2021 · 0 comments · Fixed by #177
Closed

Should work for the M1 chip, but needs to be mapped or smth #176

JoshCheek opened this issue Mar 16, 2021 · 0 comments · Fixed by #177

Comments

@JoshCheek
Copy link

I'm on the new Mac M1

$ uname -a
Darwin MacBook-Air 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64

Using the latest release at this time, 4.0.0

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

It tells me the M1 doesn't have posix spawn, and then it falls back to ForkExecProcess

$ ruby -r childprocess -e '
   require "childprocess"
   ChildProcess.posix_spawn = true
   child = ChildProcess.build("echo", "hello world")
   puts "", "implemented with #{child.class}"
   child.io.stdout = $stdout
   child.start
'
W, [2021-03-15T22:30:38.538819 #1768]  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

implemented with ChildProcess::Unix::ForkExecProcess
hello world

However, when I monkey patch it to use the intel solution, it works just fine:

ruby -r childprocess -e '
   require "childprocess"
   def ChildProcess.platform_name
     "x86_64-macosx"
   end
   ChildProcess.posix_spawn = true
   child = ChildProcess.build("echo", "hello world")
   puts "implemented with #{child.class}"
   child.io.stdout = $stdout
   child.start
'
implemented with ChildProcess::Unix::PosixSpawnProcess
hello world

So, it feels like this should work, and there just needs to be a little bit of code to tell it how to deal with the arm-macosx chip.


This causes it to print the warning in the middle of the output, which goes to my text editor, so it's showing up in the middle of my code now 😛

Untitled

JoshCheek added a commit to JoshCheek/seeing_is_believing that referenced this issue May 23, 2021
I didn't want to commit this, but they haven't responded to my issue:
enkessler/childprocess#176

And I have 2 issues about it not working on the M1 right now:
* #160
* #161

Findally decided that even though it's super questinoable to set the logger
like this, that it's better than SiB being broken on the M1.
JoshCheek added a commit to JoshCheek/seeing_is_believing that referenced this issue May 23, 2021
SiB has been broken on the M1 (Apple Silicon) for a long time,
unnecessarily. I reported that it would work if they just updated
the gem to understand that that architecture exists:
enkessler/childprocess#176

But they haven't gotten back to it. So I figured I'd try out
`Kernel#spawn` again. Turns out, it works, on OS X, anyway.
We'll see what happens on CI.
@sds sds closed this as completed in #177 Jun 3, 2021
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 a pull request may close this issue.

1 participant