Skip to content

Commit 660c515

Browse files
danbevtargos
authored andcommitted
build: move available-node variable to top
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: #22356 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent fbc189b commit 660c515

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

Makefile

+12-11
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ BUILD_RELEASE_FLAGS ?= $(BUILD_DOWNLOAD_FLAGS) $(BUILD_INTL_FLAGS)
5858
# or set the V environment variable to an empty string.
5959
V ?= 1
6060

61+
# Use -e to double check in case it's a broken link
62+
# Use $(PWD) so we can cd to anywhere before calling this
63+
available-node = \
64+
if [ -x $(PWD)/$(NODE) ] && [ -e $(PWD)/$(NODE) ]; then \
65+
$(PWD)/$(NODE) $(1); \
66+
elif [ -x `which node` ] && [ -e `which node` ] && [ `which node` ]; then \
67+
`which node` $(1); \
68+
else \
69+
echo "No available node, cannot run \"node $(1)\""; \
70+
exit 1; \
71+
fi;
72+
6173
.PHONY: all
6274
# BUILDTYPE=Debug builds both release and debug builds. If you want to compile
6375
# just the debug build, run `make -C out BUILDTYPE=Debug` instead.
@@ -629,17 +641,6 @@ out/doc/api/assets:
629641
out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets
630642
@cp $< $@
631643

632-
# Use -e to double check in case it's a broken link
633-
# Use $(PWD) so we can cd to anywhere before calling this
634-
available-node = \
635-
if [ -x $(PWD)/$(NODE) ] && [ -e $(PWD)/$(NODE) ]; then \
636-
$(PWD)/$(NODE) $(1); \
637-
elif [ -x `which node` ] && [ -e `which node` ] && [ `which node` ]; then \
638-
`which node` $(1); \
639-
else \
640-
echo "No available node, cannot run \"node $(1)\""; \
641-
exit 1; \
642-
fi;
643644

644645
run-npm-install = $(PWD)/$(NPM) install --production --no-package-lock
645646
run-npm-ci = $(PWD)/$(NPM) ci

0 commit comments

Comments
 (0)