Skip to content

Commit

Permalink
build: add crypto check to build targets
Browse files Browse the repository at this point in the history
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 <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
danbev authored and rvagg committed Aug 15, 2018
1 parent cdb8c1b commit c42ff4e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Makefile
Expand Up @@ -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, \
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c42ff4e

Please sign in to comment.