Open fynnfluegge opened 1 year ago
Hi @fynnfluegge, that's very strange! Can you check the arch of the actual Volta executable? The version for Apple Silicon should try to fetch the ARM Node if it's available and only fall back to x64 if it can't find an appropriate ARM one (e.g. on older versions of Node that don't have an ARM build).
Hi @charlespierce thanks maybe that's the point! My terminal starts by default with Rosetta emulator with x64. I installed Volta then which gave me x64 executable I think.
lol
@charlespierce I wonder if this is the correct behavior now with universal binary of volta@2 installed in native terminal (mac m1 arm64) where
$ file /Users/ssukienn/.volta/bin/volta
/Users/ssukienn/.volta/bin/volta: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
/Users/ssukienn/.volta/bin/volta (for architecture x86_64): Mach-O 64-bit executable x86_64
/Users/ssukienn/.volta/bin/volta (for architecture arm64): Mach-O 64-bit executable arm64
$ file /Users/ssukienn/.volta/bin/node
/Users/ssukienn/.volta/bin/node: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
/Users/ssukienn/.volta/bin/node (for architecture x86_64): Mach-O 64-bit executable x86_64
/Users/ssukienn/.volta/bin/node (for architecture arm64): Mach-O 64-bit executable arm64
$ node -p process.arch
x64
I have some conditional logic that expects arm64
and node is run on native terminal (not rosetta) but arch
in node process is x64
, which I think is missleading.
For now I will need to fallback to volta <2. Wonder if this is volta problem or not?
Hi @ssukienn, the universal binary shouldn't change the behavior, so that's odd! What version of Node is that running? Can you also share the output of file $(volta which node)
? That should resolve the info about the actually installed Node binary.
I can't reproduce locally—also on an ARM64 Mac—Using the native terminal and the universal binary, I get the expected arm64
when running node -p process.arch
Is it possible that when Node was installed, you were in a Rosetta terminal? In that case it may launch the x64
portion of the universal binary, which would then only download the x64
node.
Separately, I wonder if we could improve our inventory to also consider architecture as well as version—that would alleviate the problem of installing a specific version with the "wrong" architecture, because the next time Volta was run with a different one, it would see that the matching architecture wasn't available and would then fetch the appropriate one.
Hi, ye I just discovered I entered some workload which works in node14... So it was that as there are no official binaries for arm. Sorry for the fuss and thanks for the help!
Ah ha, yeah that would do it! No worries, I still think it might make sense at some point in the future to include the architecture in the inventory check.
When I fetch a node runtime with volta on a terminal session with arch
arm64
it fetches node withx64
executable.What I did Make sure that my terminal session is on
arm64
:Fetching node 18:
Check current node version:
Check arch of current node version:
What I expect
node -e 'console.log(process.arch)'
should returnarm64
Current workaround I have to use nvm for
arm64
node executablesVolta Vserion 1.1.1