From 2a10c51d7274c188197ed8236f7d462b0a7f1109 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 6 Aug 2018 09:26:36 +0200 Subject: [PATCH 1/4] 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. --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fc4a094656a452..962cd19a8930a7 100644 --- a/Makefile +++ b/Makefile @@ -321,9 +321,13 @@ DOCBUILDSTAMP_PREREQS := $(DOCBUILDSTAMP_PREREQS) out/$(BUILDTYPE)/node.exp endif 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,7 +1066,11 @@ 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/)") From d62522351d44d1948500ef4be838dc84b72b3ac8 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 6 Aug 2018 08:54:04 +0200 Subject: [PATCH 2/4] test: move require of http2 to after crypto check Currently when configured without-ssl test-heapdump-http2.js will fail with a missing crypto message. This commit moves the require of http2 to after the crypto check. --- test/parallel/test-heapdump-http2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-heapdump-http2.js b/test/parallel/test-heapdump-http2.js index cbc1209ab0557f..b503951e65851b 100644 --- a/test/parallel/test-heapdump-http2.js +++ b/test/parallel/test-heapdump-http2.js @@ -2,9 +2,9 @@ 'use strict'; const common = require('../common'); const { recordState } = require('../common/heap'); -const http2 = require('http2'); if (!common.hasCrypto) common.skip('missing crypto'); +const http2 = require('http2'); { const state = recordState(); From f1784a4e11f17cc8b9d060c5063ae93fc6b72df5 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 6 Aug 2018 08:54:04 +0200 Subject: [PATCH 3/4] test: move require of https to after crypto check Currently when configured without-ssl test-request-arguments.js will fail with a missing crypto message. This commit moves the require of https to after the crypto check. --- test/parallel/test-https-request-arguments.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-https-request-arguments.js b/test/parallel/test-https-request-arguments.js index 44037ddd6de90b..9dc80094be0d2c 100644 --- a/test/parallel/test-https-request-arguments.js +++ b/test/parallel/test-https-request-arguments.js @@ -1,11 +1,11 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); -const https = require('https'); const fixtures = require('../common/fixtures'); if (!common.hasCrypto) common.skip('missing crypto'); +const https = require('https'); const options = { key: fixtures.readKey('agent1-key.pem'), From beca02d2593ced77288f834f5974aeb3379e0788 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 7 Aug 2018 12:25:30 +0200 Subject: [PATCH 4/4] squash: move declaration of node_use_openssl This commit moves the declaration of node_use_openssl so that it comes before the first usage as it needs to be available to the ifeq conditions. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 962cd19a8930a7..4cd6baf1c694e4 100644 --- a/Makefile +++ b/Makefile @@ -320,6 +320,8 @@ 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/??_*/ @@ -1077,8 +1079,6 @@ 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)