[Medium] Fetch Native Apple Silicon Node builds for Node 16+#974
[Medium] Fetch Native Apple Silicon Node builds for Node 16+#974chriskrycho merged 3 commits intovolta-cli:mainfrom
Conversation
0c91bac to
cfd717f
Compare
🎉 |
chriskrycho
left a comment
There was a problem hiding this comment.
I have three comments:
- This is awesome! And wow is Node running native on M1 fast.
- Thank you for all the clear comments along the way!
- The fact that this also passes around
Versioninstead of&stris 🤩
!
|
Should this be working now? I'm using volta 1.0.4 and volta install node@16 installs an x86_64 version. |
|
Hmm. It should, yes, and I’ve seen it fetch the right thing. 🤔 Can you provide further information on Volta itself, the Node installed, etc.? |
|
It may be because I fetched node@16 before upgrading volta. More info: |
|
Also, this didn't help: |
|
HMMMM. A couple more investigatory questions:
|
|
Np, happy to help. I'm running these commands using Alacritty, which launches zsh, which launches tmux, which launches zsh 😅 |
|
I'm not at all an expert in how Rosetta works, but I'm wondering if starting with Alacritty (which appears to be an x64 program) puts everything underneath it into "Compat mode", meaning even though For some context, Another thing worth checking, since the install involves piping into bash, would be the output of |
|
I know almost nothing about Rosetta tbh. I found some interesting things: This is run under zsh, which according to activity monitor is running without rosetta: This seems to indicate that this comment is right
So I opened Terminal.app, running zsh without tmux (both are aarm64), and this worked: Now on Alacritty: |
|
Okay, great! Yeah, it seems like something in the setup (my guess is alacritty at the start, but I don't have enough expertise to know for sure) was setting things up in a way that misled the Volta installer, causing it to fetch the x64 Mac version, instead of the native one. Now that you have the proper native one, however, Volta should work properly even in the Alacritty environment (since it uses compile-time flags to determine the architecture, rather than detecting it at runtime). So I believe you should be good to go. One last thing, as I mentioned |
|
Oh, I missed that part! Yeah, it's |
Closes #919
Info
Changes
tool/node/mod.rsto include the constant values for Apple Silicon architecturefilesmetadata in the Node index will check for both the native and x64 versions of Node.archive_filenameon Apple Silicon builds to check the Node major version and fetch either a native or x64 build of Node depending on whether it is greater than or equal to 16.Tested
Notes