Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d338d41

Browse files
danbevtargos
authored andcommittedAug 11, 2018
build: add crypto check to build targets
Currently when configured without-ssl the build will fail when trying to run the tools/doc/node_modules, and .docbuildstamp make targets: internal/util.js:97 throw new ERR_NO_CRYPTO(); ^ Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support at assertCrypto (internal/util.js:97:11) at crypto.js:31:1 ... at Object.<anonymous> (/node/deps/npm/node_modules/uuid/lib/rng.js:4:14) at Module._compile (internal/modules/cjs/loader.js:689:30) ... make[1]: *** [tools/doc/node_modules] Error 1 This commit adds crypto check to these targets to allow the build to pass. PR-URL: #22148 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent d12c9f5 commit d338d41

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed
 

‎Makefile

+11-3
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,16 @@ ifeq ($(OSTYPE),aix)
320320
DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp
321321
endif
322322

323+
node_use_openssl = $(shell $(call available-node,"-p" \
324+
"process.versions.openssl != undefined"))
323325
test/addons/.docbuildstamp: $(DOCBUILDSTAMP_PREREQS) tools/doc/node_modules
326+
ifeq ($(node_use_openssl),true)
324327
$(RM) -r test/addons/??_*/
325328
[ -x $(NODE) ] && $(NODE) $< || node $<
326329
touch $@
330+
else
331+
@echo "Skipping .docbuildstamp (no crypto)"
332+
endif
327333

328334
ADDONS_BINDING_GYPS := \
329335
$(filter-out test/addons/??_*/binding.gyp, \
@@ -1062,15 +1068,17 @@ lint-md-build: tools/remark-cli/node_modules \
10621068

10631069
.PHONY: tools/doc/node_modules
10641070
tools/doc/node_modules:
1065-
@cd tools/doc && $(call available-node,$(run-npm-install))
1071+
ifeq ($(node_use_openssl),true)
1072+
cd tools/doc && $(call available-node,$(run-npm-install))
1073+
else
1074+
@echo "Skipping tools/doc/node_modules (no crypto)"
1075+
endif
10661076

10671077
.PHONY: lint-md
10681078
ifneq ("","$(wildcard tools/remark-cli/node_modules/)")
10691079

10701080
LINT_MD_DOC_FILES = $(shell ls doc/*.md doc/**/*.md)
10711081
run-lint-doc-md = tools/remark-cli/cli.js -q -f $(LINT_MD_DOC_FILES)
1072-
node_use_openssl = $(shell $(call available-node,"-p" \
1073-
"process.versions.openssl != undefined"))
10741082
# Lint all changed markdown files under doc/
10751083
tools/.docmdlintstamp: $(LINT_MD_DOC_FILES)
10761084
ifeq ($(node_use_openssl),true)

0 commit comments

Comments
 (0)
Please sign in to comment.