build: fallback to autogen.sh if configure fails, and refactor config and build scripts for easier troubleshooting #125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note to @addaleax - I am not very familiar with the node-gyp build system, and these changes do come with risks, so unless after your review you feel very confident in them, then I suggest we don't do these. It's perhaps better to tackle refactorings as part of a larger improvement effort on the build system for both windows and non-windows if/when that is done. Let me know if I should just close this PR.
This PR includes refactorings and some extra robustness if ./configure fails. It is arguably an improvement, but I'm not 100% sure removing the
<!
hack won't cause any problems (why was it there to begin with?).For inspiration we could also look at node-ffi, which previously used a config and build script like we do, and:
./autogen.sh
, so we don't need the config.sub patchChanges:
liblzma-config.sh
: if configure fails, runautogen.sh
/ autoconf (*)build
action inbindings.gyp
so that config and build scripts output is shown, making troubleshooting easier:configure
using<!
early variable expansion of 'input' key , so just run it as a regular build action, and makebuild
dependent on it (in fact, they could be combined into one)README.md
(*) To run autogen.sh you need a full autoconf build environment to build, such as this shell.nix file defines if using Nix
If encountering: gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp
Either wait for nodejs/node-gyp#2497 or update us node 17.