vweevers / win-version-info

Windows-only native addon to read version info from executables.
MIT License
19 stars 6 forks source link

Don't skip building when cross-installing for win32 #7

Closed pimterry closed 5 years ago

pimterry commented 5 years ago

npm_config_platform=win32 can be used with prebuild-install to download binaries for win32 when running npm install on Linux, allowing for cross-platform installs.

This works fine with other similar packages such as registry-js, but doesn't work with this package, because skip.js assumes that no install step is required at all in this case. This PR ensures that if this env var is set, it overrides the current platform, so on win32 the prebuild step does indeed get run.

vweevers commented 5 years ago

npm_config_platform=win32 can be used with prebuild-install to download binaries for win32 when running npm install on Linux, allowing for cross-platform installs.

That sounds.. exotic 😄

I think I'm good with this PR but busy atm so will review later.

pimterry commented 5 years ago

That sounds.. exotic smile

It is a bit. I'm working on an oclif CLI, and the build process is designed to run on one Linux or OSX machine, and to build all target platforms there in one go.

That works perfectly well for vanilla JS codebases, and automatically bundles the right node binary for each platform's build so it runs out of the box everywhere, but if you need native modules per-platform too then the process gets a little more complicated...

vweevers commented 5 years ago

3.0.1