-
Notifications
You must be signed in to change notification settings - Fork 869
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
Support arm64 binaries since Node.js v16 #970
Conversation
@ajthom90 please check this change also Proof of new logic. Tested on Apple M1 machine: For node
Exactly the same project, but with node version
|
@seregamorph This looks great to me. I was working on this last week and got a little sidetracked (and I cancelled my MacStadium subscription, so I didn't have an M1 Mac to test it on), but my logic looks almost identical to yours. And your code looks much cleaner than mine. Thanks for taking care of this! This idea just popped into my head though and maybe necessarily doesn't need to be done in this PR (or ever be done), but would we possibly want a config option for Mac users to say "I always want the x64 binary" even if they are on an M1 Mac? I'd assume that most people would want to run Node natively when they're on an arm64 machine, but maybe just in case people want the option? I'm good either way, like I said, it just popped into my head, so I figured I'd bring it up here. Thanks again! |
@ajthom90 I had the same idea. IMHO it'll be better to introduce such enhancement in next major release. |
@seregamorph I like it. Thanks again! |
LGTM, thanks! |
Summary
Node.js supports native arm64 binary release since v16:
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V16.md#toolchain-and-compiler-upgrades
For example, you can see
darwin-arm64
releases here: https://nodejs.org/download/release/v16.0.0/Old logic: for mac arm64 always prefer x64 instead.
New logic: for mac arm64 prefer arm64 since node v16, otherwise fallback to old behavior.