prebuild / prebuild

A command line tool for easily doing prebuilds for multiple version of node on a specific platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building for electron 6 (ABI 73) actually builds ABI 72

joshuef opened this issue · comments

I'm running prebuild thus: yarn prebuild -r electron -t 6.0.7, this nicely will generate something that looks the part eg: /safe-nodejs-v0.1.3-electron-v73-darwin-x64.tar.gz, and -u will upload this happily.

However, when it comes to using this (in electron, hence the 73 ABI), it turns out it's actually ABI 72... (As I have node 12 running in my shell I assume).

I'm not sure what else to be doing here, been googling around this for a while now, but not found anything solid on this...

Am I right that I should be able to build for different versions from another version of node? That's the point of the headers downloading, no? (Which BTW i can see w/ --verbose, are being downloaded the first time trying a new electron/ABI).

Anyone come across this / have ideas?

Thanks in advance!

However, when it comes to using this (in electron, hence the 73 ABI), it turns out it's actually ABI 72... (As I have node 12 running in my shell I assume).

Do you mean that the wrong prebuilt binary is downloaded? I.e. you're expecting that the prebuilt binary for ABI 73 is downloaded? If so, have a look at electron-rebuild which integrates with prebuild-install to solve this exact problem.

It's downloading the correct file. But that file is built for the wrong ABI. (ie, the 73 file is actually ABI 72).

I've also tried electron-rebuild after downloading (from the project root), but that's no help euther

But that file is built for the wrong ABI.

How did you arrive at that conclusion?

We get our ABI version for a given node or electron version from node-abi which does have the correct ABI (73) for electron 6.

I open the electron app, and receive the NODE_MODULE_VERSION mismatch error (about needing 73, but this being 72)

I'm also checking via the node prompt, (node 12), and require the (supposedly ABI 73) module. It does not complain.

Here's the full upload : https://github.com/joshuef/safe-nodejs/releases/download/v0.1.3/safe-nodejs-v0.1.3-electron-v73-darwin-x64.tar.gz

At a node 12 prompt I'd expect an error when the index.node is the correct version.

It might be the known issue of the node-gyp cache not differentiating runtimes (#249), which causes it to use node v6 headers.

I think it's time we temporarily patch this problem in prebuild, until node-gyp fixes it.

I had seen that issue, but wouldn't that result in the ABI being much lower? (node 6 was 50 something or so, no?)

Hm, right. Could you share the output of prebuild -r electron -t 6.0.7 --verbose?

Just to confirm, i'm on a fairly new machine, but I double checked ~/.node-gyp, and I only have 6.0.7 and 12.9.1 there. So I'm sure there's no conflict there.


/safe-nodejs/node_modules/.bin/prebuild -r electron -t 6.0.7 --verbose
prebuild info begin Prebuild version 9.1.0
prebuild info build Preparing to prebuild safe-nodejs@0.1.3 for electron 6.0.7 on darwin-x64 using node-gyp
prebuild verb starting build process node-gyp
prebuild verb execute node-gyp with `node index.js rebuild --target=6.0.7 --target_arch=x64 --runtime=electron --dist-url=https://atom.io/download/electron`
prebuild verb command rebuild []
prebuild verb ok
prebuild verb command clean []
prebuild verb clean removing "build" directory
prebuild verb ok
prebuild verb command configure []
prebuild verb download using dist-url https://atom.io/download/electron
prebuild verb check python checking for Python executable "/usr/bin/python" in the PATH
prebuild verb `which` succeeded /usr/bin/python /usr/bin/python
prebuild verb check python version `/usr/bin/python -c "import sys; print "2.7.10
prebuild verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
prebuild verb get node dir compiling against --target node version: 6.0.7
prebuild verb command install [ '6.0.7' ]
prebuild verb download using dist-url https://atom.io/download/electron
prebuild verb install input version string "6.0.7"
prebuild verb install installing version: 6.0.7
prebuild verb install --ensure was passed, so won't reinstall if already installed
prebuild verb install version is already installed, need to check "installVersion"
prebuild verb got "installVersion" 9
prebuild verb needs "installVersion" 9
prebuild verb install version is good
prebuild verb get node dir target node version installed: 6.0.7
prebuild verb build dir attempting to create "build" dir: /Users/josh/Projects/safe/forks/safe-nodejs/build
prebuild verb build dir "build" dir needed to be created? /Users/josh/Projects/safe/forks/safe-nodejs/build
prebuild verb build/config.gypi creating config file
prebuild verb build/config.gypi writing out config file: /Users/josh/Projects/safe/forks/safe-nodejs/build/config.gypi
prebuild verb config.gypi checking for gypi file: /Users/josh/Projects/safe/forks/safe-nodejs/config.gypi
prebuild verb common.gypi checking for gypi file: /Users/josh/Projects/safe/forks/safe-nodejs/common.gypi
prebuild verb gyp gyp format was not specified; forcing "make"
prebuild info spawn /usr/bin/python
prebuild info spawn args [
prebuild info spawn args   '/Users/josh/Projects/safe/forks/safe-nodejs/node_modules/node-gyp/gyp/gyp_main.py',
prebuild info spawn args   'binding.gyp',
prebuild info spawn args   '-f',
prebuild info spawn args   'make',
prebuild info spawn args   '-I',
prebuild info spawn args   '/Users/josh/Projects/safe/forks/safe-nodejs/build/config.gypi',
prebuild info spawn args   '-I',
prebuild info spawn args   '/Users/josh/Projects/safe/forks/safe-nodejs/node_modules/node-gyp/addon.gypi',
prebuild info spawn args   '-I',
prebuild info spawn args   '/Users/josh/.node-gyp/6.0.7/include/node/common.gypi',
prebuild info spawn args   '-Dlibrary=shared_library',
prebuild info spawn args   '-Dvisibility=default',
prebuild info spawn args   '-Dnode_root_dir=/Users/josh/.node-gyp/6.0.7',
prebuild info spawn args   '-Dnode_gyp_dir=/Users/josh/Projects/safe/forks/safe-nodejs/node_modules/node-gyp',
prebuild info spawn args   '-Dnode_lib_file=/Users/josh/.node-gyp/6.0.7/<(target_arch)/node.lib',
prebuild info spawn args   '-Dmodule_root_dir=/Users/josh/Projects/safe/forks/safe-nodejs',
prebuild info spawn args   '-Dnode_engine=v8',
prebuild info spawn args   '--depth=.',
prebuild info spawn args   '--no-parallel',
prebuild info spawn args   '--generator-output',
prebuild info spawn args   'build',
prebuild info spawn args   '-Goutput_dir=.'
prebuild info spawn args ]
prebuild verb ok
prebuild verb command build []
prebuild verb download using dist-url https://atom.io/download/electron
prebuild verb build type Release
prebuild verb architecture x64
prebuild verb node dev dir /Users/josh/.node-gyp/6.0.7
prebuild verb `which` succeeded for `make` /usr/bin/make
prebuild info spawn make
prebuild info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  c++ -bundle -undefined dynamic_lookup -Wl,-no_pie -Wl,-search_paths_first -mmacosx-version-min=10.10 -arch x86_64 -L./Release -stdlib=libc++  -o Release/index.node
prebuild verb ok
prebuild verb completed building node-gyp
prebuild info build Packing build/Release/index.node into prebuilds/safe-nodejs-v0.1.3-electron-v73-darwin-x64.tar.gz
prebuild info build Prebuild written to prebuilds/safe-nodejs-v0.1.3-electron-v73-darwin-x64.tar.gz
✨  Done in 3.29s.

Hmmm, so I've been playing w/ this and node-gyp again, and I think it may not actually be node-gyp related. I'm using neon for native module builds, and I can get the correct output, if I apply all the npm configs to that build process. It them seems like it's fine for preparing other ABIs from this build, but the other way does not seem to work.

I'm still confirming this / sorting the setup here. If I can get this working with prebuild in a similar fashion I'll report back

Hmmmm, it did not work as well. I did not get a module mismatch, but there was a 'did not self register', error, which may well be coming from neon (as it needs a patched version of node-pre-gyp.

I think this is more than likely neon related that prebuild at this stage. If I discover otherwise, I'll let you know. Otherwise, thanks for the help @vweevers !

OK, I'm closing this then.

FWIW I was unable to reproduce the issue on a normal (non-rust) native module, I correctly got ABI 73.