Skip to content

src: gate all quic behind disabled-by-default compile flag #57142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
sys.path.insert(0, 'tools')
import getmoduleversion
import getnapibuildversion
import getsharedopensslhasquic
from gyp_node import run_gyp
from utils import SearchFiles

Expand Down Expand Up @@ -847,6 +846,12 @@

# End dummy list.

parser.add_argument('--with-quic',
action='store_true',
dest='quic',
default=None,
help='build with QUIC support')

parser.add_argument('--without-ssl',
action='store_true',
dest='without_ssl',
Expand Down Expand Up @@ -1743,6 +1748,7 @@ def configure_openssl(o):
variables['node_shared_ngtcp2'] = b(options.shared_ngtcp2)
variables['node_shared_nghttp3'] = b(options.shared_nghttp3)
variables['openssl_is_fips'] = b(options.openssl_is_fips)
variables['node_quic'] = b(options.quic)
variables['node_fipsinstall'] = b(False)

if options.openssl_no_asm:
Expand Down Expand Up @@ -1804,13 +1810,8 @@ def without_ssl_error(option):
if options.openssl_is_fips and not options.shared_openssl:
variables['node_fipsinstall'] = b(True)

if options.shared_openssl:
has_quic = getsharedopensslhasquic.get_has_quic(options.__dict__['shared_openssl_includes'])
else:
has_quic = getsharedopensslhasquic.get_has_quic('deps/openssl/openssl/include')

variables['openssl_quic'] = b(has_quic)
if has_quic:
variables['openssl_quic'] = b(options.quic)
if options.quic:
o['defines'] += ['NODE_OPENSSL_HAS_QUIC']

configure_library('openssl', o)
Expand Down
6 changes: 5 additions & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -927,12 +927,16 @@
[ 'node_use_openssl=="true"', {
'sources': [
'<@(node_crypto_sources)',
'<@(node_quic_sources)',
],
'dependencies': [
'deps/ncrypto/ncrypto.gyp:ncrypto',
],
}],
[ 'node_quic=="true"', {
'sources': [
'<@(node_quic_sources)',
],
}],
[ 'OS in "linux freebsd mac solaris" and '
'target_arch=="x64" and '
'node_target_type=="executable"', {
Expand Down
6 changes: 6 additions & 0 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,13 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
true);
AddOption("--experimental-quic",
"" /* undocumented until its development */,
#ifdef NODE_OPENSSL_HAS_QUIC
&EnvironmentOptions::experimental_quic,
#else
// Option is a no-op if the NODE_OPENSSL_HAS_QUIC
// compile flag is not enabled
NoOp{},
#endif
kAllowedInEnvvar);
AddOption("--experimental-webstorage",
"experimental Web Storage API",
Expand Down
2 changes: 2 additions & 0 deletions src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ class EnvironmentOptions : public Options {
bool experimental_websocket = true;
bool experimental_sqlite = true;
bool experimental_webstorage = false;
#ifdef NODE_OPENSSL_HAS_QUIC
bool experimental_quic = false;
#endif
std::string localstorage_file;
bool experimental_global_navigator = true;
bool experimental_global_web_crypto = true;
Expand Down
2 changes: 1 addition & 1 deletion test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const noop = () => {};
const hasCrypto = Boolean(process.versions.openssl) &&
!process.env.NODE_SKIP_CRYPTO;

const hasQuic = hasCrypto && !!process.config.variables.openssl_quic;
const hasQuic = hasCrypto && !!process.config.variables.node_quic;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like something we should add to process.features when we bring it back…


function parseTestFlags(filename = process.argv[1]) {
// The copyright notice is relatively big and the flags could come afterwards.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ assert(undocumented.delete('--no-verify-base-objects'));
assert(undocumented.delete('--trace-promises'));
assert(undocumented.delete('--no-trace-promises'));
assert(undocumented.delete('--experimental-quic'));
assert(undocumented.delete('--no-experimental-quic'));
if (common.hasQuic) {
assert(undocumented.delete('--no-experimental-quic'));
}

// Remove negated versions of the flags.
for (const flag of undocumented) {
Expand Down
23 changes: 0 additions & 23 deletions tools/getsharedopensslhasquic.py

This file was deleted.

Loading