Respect npm_config_arch for cross-compilation scenarios#567
Respect npm_config_arch for cross-compilation scenarios#567dennisameling wants to merge 3 commits intomapbox:masterfrom
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_archenvironment variable: https://www.electronjs.org/docs/tutorial/using-native-node-modules#using-npmprebuild-installchecks the target architecture in a three-step process:pkgConf.arch(through runningprebuild install --arch XXX)process.env.npm_config_archfor cross-compilation scenarios (e.g. a x64 host targeting arm64)process.archfor the architecture that Node is currently running onThis PR also brings that behavior to
node-pre-gyp🚀