Skip to content
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

Run testbinary after install and fallback to build if it fails #309

Closed
recrsn opened this issue Jul 9, 2017 · 3 comments
Closed

Run testbinary after install and fallback to build if it fails #309

recrsn opened this issue Jul 9, 2017 · 3 comments

Comments

@recrsn
Copy link

recrsn commented Jul 9, 2017

Sometimes, the pre-built binaries are ABI incompatible with host packages. node-pre-gyp reports a successful install and node subsequently segfaults. (kelektiv/node.bcrypt.js#528)

This case is becoming quite common: People are wanting to install pre-built binaries in systems using musl libc, while we only provide binaries linked against glibc. We want to fall-back to source compile in this case.

@springmeyer
Copy link
Contributor

You can do this by putting this in your package.json:

    "scripts": {
        "install": "node-pre-gyp install testbinary --fallback-to-build"
    },

refs #297

@oohnoitz
Copy link

oohnoitz commented Aug 30, 2017

I tried that install script, but it seems that this doesn't really trigger a rebuild at all. What I've noticed is that it does the following:

  • adds { name: 'build', args: ['rebuild'] } to the todo stack if it fails to fetch the binaries
  • runs the testbinary which fails because it can't locate the binaries to test
  • it doesn't attempt to build the binaries since the testbinary command returns an error triggering the process to get killed
  • since the process got killed, it doesn't bother to compile the build (also couldn't find any code where testbinary also uses the same --fallback-to-build logic as install

@recrsn recrsn closed this as completed Oct 22, 2017
@coreprocess
Copy link
Contributor

@agathver node-pre-gyp just released a new version, which support the {libc} token in the path and package name variables. The token resolves to glibc or musl.

See:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants