-
Notifications
You must be signed in to change notification settings - Fork 262
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
Respect npm_config_arch for cross-compilation scenarios #567
base: master
Are you sure you want to change the base?
Conversation
@dennisameling thanks. A few questions:
|
|
👍 thanks. |
Just a quick note that I didn't get to writing the test today - have rescheduled for tomorrow. Will keep you posted, sorry for the delay |
@springmeyer just added the test. The weird thing is if that I run Also, Linux doesn't support cross-compilation unless things like |
Bizarre, no. Are all your tests uniquely named?
Right. Hmm. Yeah, would be nice to test this without compiling. Perhaps you could just have a test that runs Or instead add a test that looks at the versioning specifically without messing with a build or install: https://github.com/mapbox/node-pre-gyp/blob/master/test/versioning.test.js |
Electron supports cross-compilation (e.g. from x64 to arm64) through the
npm_config_arch
environment variable: https://www.electronjs.org/docs/tutorial/using-native-node-modules#using-npmprebuild-install
checks the target architecture in a three-step process:pkgConf.arch
(through runningprebuild install --arch XXX
)process.env.npm_config_arch
for cross-compilation scenarios (e.g. a x64 host targeting arm64)process.arch
for the architecture that Node is currently running onThis PR also brings that behavior to
node-pre-gyp
🚀