-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Apple Silicon Support #37309
Comments
|
Has someone looked into this? It seems that it can be done independently of the other steps, and since v16.0.0 is quite close, I think it would be nice if we could start building the fat binary for nightlies. |
I haven't had the time yet, but its open to anyone interested in helping out. |
Also today I got 3 M1 minis from macstadium so Im setting them up today |
I tried cross compiling on a M1 to intel arch using some steps in nodejs/build#2474 (comment) but hit the following error:
@rvagg I am a total novice at this so is there anything obvious that sticks out about this error? |
Yeah, whacky, it's V8 blocking this: node/deps/v8/src/base/build_config.h Lines 151 to 154 in 52f9aaf
So V8 has opinions about which direction you can cross-compile. That whole surrounding section has strong assertions about which host->target combinations you can cross-compile V8 in. I don't really understand why they need to have such opinions but I guess they have some pretty deep architecture affinity things going on where they have constraints for what to practically support. @targos comes to mind as someone who might have some insight into the why here. But this does answer the question we had at the meeting this week - can we support both architectures on an arm64 release host - NO, for now at least. x64 reigns supreme. So we need to invest in getting the x64->arm64 cross path working cleanly so we can do fat binaries for the .pkg. |
I just learned today about this build config header, no idea why V8 has this limitation. |
What was the reason for creating an universal binary? |
@targos the universal is for the .pkg download, there will still be architecture-specific tarballs that |
Thats a shame its blocked in V8 the arm machines are so much faster. Ill try and get x86 to arm working then and also check the tar building step works as it should on arm |
Thanks to a suggestion @andreialecu from I compiled node under rosetta (didn't even consider compiling under rosetta) and got an x64 binary out on m1
Was a super slow process though - took well over an hour. Also is rosetta a trustworthy path? is it likely to go away before the intel machines do making this process eventually redundant? |
That was easier than I expected:
|
Should the OP be updated now that #38051 has landed? |
Closing as Apple silicon is now fully supported with the release of 16.x. Whilst support is in 14.x we are going to wait for a bit and see if 16.x throws up any bugs. For 14.x it will likely be only the tar will be released for M1 and not the updated pkg. |
big thankyou to @AshCripps for powering through this and delivering binaries! |
This issue to provide visibility about our plans and progress to supporting Apple Silicon natively.
Refs: nodejs/TSC#886
Refs: nodejs/build#2474
Current plan is to have native support for 16.x via a universal binary supporting both Arm and Intel architecture.
NOTE: Support is very unlikely to be back ported to 14.x or before due to requiring a SemVer Major V8 update
How to run Node.js on Apple Silicon currently
You can either build from source on 15.x - This is not officially supported so don’t expect a smooth experience
You can also run x64 Node.js binaries via the translation layer.
Current Known Bugs
-Check failed: allocator->SetPermissions
macOS 11.2: Fatal error- deps: V8: workaround for darwin arm64 code page decommit failures #37276 has landed.Check failed: allocator->SetPermissions
#37061-make check failure
make check failure for macOS arch64 #36656- deps: cherry-pick 8957d4677aa794c230577f234071af0 from V8 upstream #37471 has landed.To Do List
This issue is locked as we will use it to provide updates on progress. If you need help please open an issue on https://github.com/nodejs/help/issues
The text was updated successfully, but these errors were encountered: