Skip to content

Problems building with --without-ssl and openssl-related options in NODE_OPTIONS #59435

@jasnell

Description

@jasnell

Just opening this to not forget.

There are a handful of command line arguments (like --use-openssl-ca) that are only defined when Node.js is being built with openssl enabled. These CLI flags, however, are allowed in NODE_OPTIONS which may be set generally for a user. When NODE_OPTIONS=--use-openssl-ca and we ./configure --without-ssl, the build will fail with an obscure and unhelpful error in the node_mksnapshot step:

FAILED: gen/node_snapshot.cc 
cd ../../; /home/jsnell/projects/node/node/out/Release/node_mksnapshot /home/jsnell/projects/node/node/out/Release/gen/node_snapshot.cc

  #  /home/jsnell/projects/node/node/out/Release/node_mksnapshot[675255]: int BuildSnapshot(int, char **) at ../../tools/snapshot/node_mksnapshot.cc:69
  #  Assertion failed: !result->early_return()

----- Native stack trace -----

 1: 0x5bb18fce856a node::Assert(node::AssertionInfo const&) [/home/jsnell/projects/node/node/out/Release/node_mksnapshot]
 2: 0x5bb18ff5f423 BuildSnapshot(int, char**) [/home/jsnell/projects/node/node/out/Release/node_mksnapshot]
 3: 0x735750429d90  [/lib/x86_64-linux-gnu/libc.so.6]
 4: 0x735750429e40 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
 5: 0x5bb18fd2ef05 _start [/home/jsnell/projects/node/node/out/Release/node_mksnapshot]
Aborted (core dumped)
ninja: build stopped: subcommand failed.
make: *** [Makefile:151: node] Error 1

It's probably a good idea to have node_mksnapshot either ignore NODE_OPTIONS or print more helpful error messages; or, alternatively, allow openssl-related options like --use-openssl-ca to be a defined non-op when building with --without-ssl

/cc @joyeecheung

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to build files or the CI.configIssues or PRs related to the config subsystem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions