From 28675b66d2e2fae839b64cf0b06ebb5df8cde025 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 16 Aug 2018 08:08:00 +0200 Subject: [PATCH] build: move available-node variable to top MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently node_use_openssl uses the available-node variable before it is defined causing the conditions that use it before that point to evaluate incorrectly. As an example running the target test/addons/.docbuildstamp will currently be skipped: $ make test/addons/.docbuildstamp Skipping .docbuildstamp (no crypto) With this commit the target will only be skipped if configured --without-ssl. PR-URL: https://github.com/nodejs/node/pull/22356 Reviewed-By: Richard Lau Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- Makefile | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 1738fb04f17..3ca83bfed85 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +58,18 @@ BUILD_RELEASE_FLAGS ?= $(BUILD_DOWNLOAD_FLAGS) $(BUILD_INTL_FLAGS) # or set the V environment variable to an empty string. V ?= 1 +# Use -e to double check in case it's a broken link +# Use $(PWD) so we can cd to anywhere before calling this +available-node = \ + if [ -x $(PWD)/$(NODE) ] && [ -e $(PWD)/$(NODE) ]; then \ + $(PWD)/$(NODE) $(1); \ + elif [ -x `which node` ] && [ -e `which node` ] && [ `which node` ]; then \ + `which node` $(1); \ + else \ + echo "No available node, cannot run \"node $(1)\""; \ + exit 1; \ + fi; + .PHONY: all # BUILDTYPE=Debug builds both release and debug builds. If you want to compile # just the debug build, run `make -C out BUILDTYPE=Debug` instead. @@ -629,17 +641,6 @@ out/doc/api/assets: out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets @cp $< $@ -# Use -e to double check in case it's a broken link -# Use $(PWD) so we can cd to anywhere before calling this -available-node = \ - if [ -x $(PWD)/$(NODE) ] && [ -e $(PWD)/$(NODE) ]; then \ - $(PWD)/$(NODE) $(1); \ - elif [ -x `which node` ] && [ -e `which node` ] && [ `which node` ]; then \ - `which node` $(1); \ - else \ - echo "No available node, cannot run \"node $(1)\""; \ - exit 1; \ - fi; run-npm-install = $(PWD)/$(NPM) install --production --no-package-lock run-npm-ci = $(PWD)/$(NPM) ci