Electron-builder: should set --abi on `npm rebuild` to make `prebuild` work properly

Created on 5 Nov 2016  路  2Comments  路  Source: electron-userland/electron-builder

  • Version: 7.21.0

  • Target: All


I am building an electron app that uses native dependencies targeting multiple platforms. Prebuild binaries are available for all of them.

However when npmSkipBuildFromSource is enabled, prebuild downloads the binary for the installed node version instead of the electron version. This can be easily handled by specifying a --abi=ELECTRON_ABI_VERSION argument, but electron-builder does not allow this.

881 is a quick workaround to solve this, but as discussed with @develar, it would make sense for electron-builder to just set --abi=$(electron --abi) automatically.

Most helpful comment

Since prebuild v5.0.0+ it can prebuilt native modules against Electron headers and determines the ABI based on the --target and --runtime flags.

This makes it compatible with electron-builder. So this issue can be closed.

All 2 comments

@develar I'm happy to do a PR for this, just not right now, since #881 solves this for me. Might look again in a few weeks if no one else has taken it on.

Since prebuild v5.0.0+ it can prebuilt native modules against Electron headers and determines the ABI based on the --target and --runtime flags.

This makes it compatible with electron-builder. So this issue can be closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

popod picture popod  路  3Comments

iklemm picture iklemm  路  3Comments

StickNitro picture StickNitro  路  3Comments

antonycourtney picture antonycourtney  路  3Comments

ccorcos picture ccorcos  路  3Comments