diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-06-14 08:11:05 +0200 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-06-24 06:47:37 +0200 |
commit | 6ced651b6c3da64727bce260ecf55b8d86ec6cc3 (patch) | |
tree | bc5ed6733c4dae11034ba4ded5516953d110060d /Makefile | |
parent | a40e06233eeb657a38373c0f1ff03a32a310b998 (diff) | |
download | node-new-6ced651b6c3da64727bce260ecf55b8d86ec6cc3.tar.gz |
build: add crypto check to markdown lint target
Currently, if configured --without-ssl the following error will be
repored by remark-cli:
Running Markdown linter on misc docs...
internal/util.js:100
throw new ERR_NO_CRYPTO();
^
Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support
at assertCrypto (internal/util.js:100:11)
at crypto.js:31:1
at NativeModule.compile (internal/bootstrap/loaders.js:235:7)
at Function.NativeModule.require
(internal/bootstrap/loaders.js:155:18)
at Function.Module._load (internal/modules/cjs/loader.js:530:25)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous>
(/node/tools/remark-cli/node_modules/math-random/node.js:1:76)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js
(internal/modules/cjs/loader.js:713:10)
make[1]: *** [tools/.miscmdlintstamp] Error 1
make: *** [lint] Error 2
This commit adds a check for crypto to avoid this error when node has
been configured without crypto support. The alternative was to try to
fix this in randomatic but that lead to another dependency failing
(uuid) and felt like this might be simpler.
PR-URL: https://github.com/nodejs/node/pull/21326
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1046,11 +1046,17 @@ 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) @echo "Running Markdown linter on docs..." @$(call available-node,$(run-lint-doc-md)) @touch $@ +else + @echo "Skipping Markdown linter on docs (no crypto)" +endif LINT_MD_TARGETS = src lib benchmark tools/doc tools/icu LINT_MD_ROOT_DOCS := $(wildcard *.md) @@ -1059,9 +1065,13 @@ LINT_MD_MISC_FILES := $(shell find $(LINT_MD_TARGETS) -type f \ run-lint-misc-md = tools/remark-cli/cli.js -q -f $(LINT_MD_MISC_FILES) # Lint other changed markdown files maintained by us tools/.miscmdlintstamp: $(LINT_MD_MISC_FILES) +ifeq ($(node_use_openssl),true) @echo "Running Markdown linter on misc docs..." @$(call available-node,$(run-lint-misc-md)) @touch $@ +else + @echo "Skipping Markdown linter on misc docs (no crypto)" +endif tools/.mdlintstamp: tools/.miscmdlintstamp tools/.docmdlintstamp |