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

"No native build was found" during yarn install --verbose is disconcerting #42

Open
jrose-signal opened this issue Mar 25, 2022 · 4 comments

Comments

@jrose-signal
Copy link

node-gyp-build-the-executable currently detects whether there's a build or prebuild available by running a script that loads node-gyp-build-the-library, which (reasonably) throws an error if the build/prebuild is missing. It also only shows stderr output from this script in "verbose" mode, which is also reasonable. However, this means that yarn install --verbose of a library using node-gyp-build can end up with an "error" in the log output, even though it's just how node-gyp-build is detecting whether there's a build or not. This can lead to confusion, especially if there's an actual problem later on (see signalapp/libsignal#456).

I personally think the best solution is to separate the error-throwing from the search. This would allow other errors to still be displayed, as well as distinguishing between "the build is missing" and "the build is present but cannot be loaded" (rebuilding may not help in the latter case).

@mafintosh
Copy link
Collaborator

What's your suggestion for updating this? Not fully sure I follow. If users use the node-gyp-build cli it will fallback to classic npm behaivour of building the source if no prebuild works - you can disable this with the --optional flag. Are you saying we should never do that?

@jrose-signal
Copy link
Author

No, no! I'm saying it's worth taking extra steps to avoid printing the error, even in --verbose mode. The actual behavior is good.

@vweevers
Copy link
Member

vweevers commented Apr 1, 2022

I've found it useful many times. Would it help to tweak the message?

@jrose-signal
Copy link
Author

That would be fine too! Honestly the biggest problem is that it's displayed as an Error (of course it is, that's what was thrown), and someone who doesn't know about node-gyp-build might think that's an actual error during the build process rather than just part of the detection logic.

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

3 participants