From c42ff4ebd89e62a204898ead294dbe677ad1db0f Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 6 Aug 2018 09:26:36 +0200 Subject: [PATCH] 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. (/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: https://github.com/nodejs/node/pull/22148 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson Reviewed-By: Richard Lau --- Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f1242bbb30fc73..0869a8067b503f 100644 --- a/Makefile +++ b/Makefile @@ -320,10 +320,16 @@ ifeq ($(OSTYPE),aix) DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp endif +node_use_openssl = $(shell $(call available-node,"-p" \ + "process.versions.openssl != undefined")) test/addons/.docbuildstamp: $(DOCBUILDSTAMP_PREREQS) tools/doc/node_modules +ifeq ($(node_use_openssl),true) $(RM) -r test/addons/??_*/ [ -x $(NODE) ] && $(NODE) $< || node $< touch $@ +else + @echo "Skipping .docbuildstamp (no crypto)" +endif ADDONS_BINDING_GYPS := \ $(filter-out test/addons/??_*/binding.gyp, \ @@ -1062,15 +1068,17 @@ lint-md-build: tools/remark-cli/node_modules \ .PHONY: tools/doc/node_modules tools/doc/node_modules: - @cd tools/doc && $(call available-node,$(run-npm-install)) +ifeq ($(node_use_openssl),true) + cd tools/doc && $(call available-node,$(run-npm-install)) +else + @echo "Skipping tools/doc/node_modules (no crypto)" +endif .PHONY: lint-md ifneq ("","$(wildcard tools/remark-cli/node_modules/)") LINT_MD_DOC_FILES = $(shell ls doc/*.md doc/**/*.md) run-lint-doc-md = tools/remark-cli/cli.js -q -f $(LINT_MD_DOC_FILES) -node_use_openssl = $(shell $(call available-node,"-p" \ - "process.versions.openssl != undefined")) # Lint all changed markdown files under doc/ tools/.docmdlintstamp: $(LINT_MD_DOC_FILES) ifeq ($(node_use_openssl),true)