GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — build: add crypto check to markdown lint target by danbev · Pull Request #21326 · nodejs/node

Conversation

@danbev

@danbev danbev commented Jun 14, 2018

Copy link
Copy Markdown
Contributor

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.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@danbev
build: add crypto check to markdown lint target
6a1a47c
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.
@nodejs-github-bot

nodejs-github-bot commented Jun 14, 2018

Copy link
Copy Markdown
Collaborator

@danbev build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/65/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to Node.js builds or CI infrastructure. label Jun 14, 2018
ryzokuken
ryzokuken approved these changes Jun 14, 2018
View reviewed changes
bnoordhuis
bnoordhuis approved these changes Jun 14, 2018
View reviewed changes
Comment thread Makefile Outdated
run-lint-doc-md = tools/remark-cli/cli.js -q -f $(LINT_MD_DOC_FILES)
# Lint all changed markdown files under doc/
tools/.docmdlintstamp: $(LINT_MD_DOC_FILES)
ifeq ("$(HAS_CRYPTO)", "true")

@bnoordhuis bnoordhuis Jun 14, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly more idiomatic: ifeq ($(HAS_CRYPTO),true)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@danbev danbev Jun 14, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this shortly.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread configure Outdated
'BUILDTYPE': 'Debug' if options.debug else 'Release',
'PYTHON': sys.executable,
'NODE_TARGET_TYPE': variables['node_target_type'],
'HAS_CRYPTO': variables['node_use_openssl'],

@bnoordhuis bnoordhuis Jun 14, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd call this NODE_USE_OPENSSL for consistency with NODE_TARGET_TYPE (and also grep -i greppability.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@danbev danbev Jun 14, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change this as well. Thanks

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tniessen
tniessen approved these changes Jun 14, 2018
View reviewed changes
danbev added 2 commits June 14, 2018 15:14
@danbev
squash: rename HAS_CRYPTO to NODE_USE_OPENSSL
043bcaa
@danbev
squash: fix if statement
ea20291
cjihrig
cjihrig approved these changes Jun 14, 2018
View reviewed changes
richardlau
richardlau requested changes Jun 14, 2018
View reviewed changes

@richardlau richardlau left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is causing the linter jobs (both on Travis and the CI) to skip doc linting:
https://travis-ci.com/nodejs/node/jobs/129356058
https://ci.nodejs.org/blue/rest/organizations/jenkins/pipelines/node-linter/runs/27/nodes/25/log/?start=0

$ NODE=$(which node) make lint-ci
Running JS linter...
Running C++ linter...
Total errors found: 0
Skipping Markdown linter on misc docs (no crypto)
Skipping Markdown linter on docs (no crypto)

The lint jobs use an existing Node.js binary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@danbev

danbev commented Jun 14, 2018 via email

Copy link
Copy Markdown
Contributor Author
I’ll take a look. Thanks tors 14 juni 2018 kl. 16:04 skrev Richard Lau <[email protected]>:
…
***@***.**** requested changes on this pull request. So this is causing the linter jobs (both on Travis and the CI) to skip doc linting: https://travis-ci.com/nodejs/node/jobs/129356058 https://ci.nodejs.org/blue/rest/organizations/jenkins/pipelines/node-linter/runs/27/nodes/25/log/?start=0 $ NODE=$(which node) make lint-ci Running JS linter... Running C++ linter... Total errors found: 0 Skipping Markdown linter on misc docs (no crypto) Skipping Markdown linter on docs (no crypto) The lint jobs use an existing Node.js binary. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#21326 (review)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAaY37nWro8IZq3zR22qwb8lA-dcSLL2ks5t8m1ygaJpZM4UnZs4> .
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@danbev
squash: add default value for NODE_USE_OPENSSL
d8aa677
The lint task my be run without configure being run in which case there
will be no config.mk. The value is set to true as this would be the most
common configuration I think.
richardlau
richardlau approved these changes Jun 14, 2018
View reviewed changes

@richardlau richardlau left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis linter now works: https://travis-ci.com/nodejs/node/jobs/129401932

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@danbev

danbev commented Jun 14, 2018

Copy link
Copy Markdown
Contributor Author

@richardlau I think I'm looking at the correct log and it looks like it is not skipping anymore.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

refack
refack suggested changes Jun 14, 2018
View reviewed changes
Comment thread Makefile Outdated
run-lint-doc-md = tools/remark-cli/cli.js -q -f $(LINT_MD_DOC_FILES)
# Lint all changed markdown files under doc/
tools/.docmdlintstamp: $(LINT_MD_DOC_FILES)
ifeq ($(NODE_USE_OPENSSL),true)

@refack refack Jun 14, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this step anyway requires an existing node binary, why not simply test @$(call available-node,"-p require('crypto')"). Then you can remove all the other "breadcrumbs".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@refack refack Jun 14, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or -p process.config.variables.node_use_openssl

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@danbev danbev Jun 15, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, it would be safer to do that as the existing node binary might have been compiled without openssl (might not be the common case but could happen). I'll take a look and update. Thanks

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
danbev added 2 commits June 15, 2018 08:58
@danbev
squash: remove NODE_USE_OPENSSL variable
030a1ee
@danbev
squash: check process.versions.openssl
5df7691
This commit checks the node environment to determine if openssl (crypto)
support if available.
@danbev

danbev commented Jun 19, 2018

Copy link
Copy Markdown
Contributor Author

@refack Would you be able to take a look at the latest commit and see what you think? Thanks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Jun 21, 2018
View reviewed changes
refack
refack approved these changes Jun 21, 2018
View reviewed changes

@refack refack left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@refack

refack commented Jun 21, 2018

Copy link
Copy Markdown
Contributor

/CC @nodejs/build-files

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@danbev

danbev commented Jun 24, 2018

Copy link
Copy Markdown
Contributor Author

Landed in 6ced651.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@danbev danbev closed this Jun 24, 2018
@danbev
danbev deleted the markdown-linter-crypto-check branch June 24, 2018 04:59
danbev added a commit that referenced this pull request Jun 24, 2018
@danbev
build: add crypto check to markdown lint target
6ced651
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: #21326
Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jun 24, 2018
@danbev @targos
build: add crypto check to markdown lint target
42f5ff8
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: #21326
Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos mentioned this pull request Jul 3, 2018
v10.6.0 proposal #21629
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bnoordhuis bnoordhuis bnoordhuis approved these changes
@jasnell jasnell jasnell approved these changes
@cjihrig cjihrig cjihrig approved these changes
@tniessen tniessen tniessen approved these changes
@richardlau richardlau richardlau approved these changes
+2 more reviewers
@refack refack refack approved these changes
@ryzokuken ryzokuken ryzokuken approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

build Issues and PRs related to Node.js builds or CI infrastructure.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@danbev @nodejs-github-bot @refack @bnoordhuis @jasnell @cjihrig @tniessen @richardlau @ryzokuken
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.