From f17f4675440270d03b138d8ce55c1345230f6d2a Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 18 Feb 2019 13:20:58 +0100 Subject: build,test: guard eslint with crypto check Currently, configuring --without-ssl will cause the lint-js target to fail with the following error: $ make lint-js Running JS linter... internal/util.js:101 throw new ERR_NO_CRYPTO(); ^ Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support at assertCrypto (internal/util.js:101:11) at crypto.js:31:1 ... (/node/tools/node_modules/eslint/node_modules/file-entry-cache/ cache.js:2:14) at Module._compile (internal/modules/cjs/loader.js:746:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:757:10) make: *** [lint-js] Error 1 There are also a number of tests that are affected in a similar way. This commit adds crypto checks to allow for lint-js and the affected tests to be skipped when configured --without-ssl. PR-URL: https://github.com/nodejs/node/pull/26182 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Refael Ackermann Reviewed-By: Ruben Bridgewater --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c3c9bdf6f7..3d8ef4dc57 100644 --- a/Makefile +++ b/Makefile @@ -1184,8 +1184,12 @@ lint-js-fix: # Note that on the CI `lint-js-ci` is run instead. # Lints the JavaScript code with eslint. lint-js: - @echo "Running JS linter..." - @$(call available-node,$(run-lint-js)) + @if [ "$(shell $(node_use_openssl))" != "true" ]; then \ + echo "Skipping $@ (no crypto)"; \ + else \ + echo "Running JS linter..."; \ + $(call available-node,$(run-lint-js)) \ + fi jslint: lint-js @echo "Please use lint-js instead of jslint" -- cgit v1.2.3