Skip to content

Commit 2a158b2

Browse files
committed
build: require --without-debugger explicitly
* To fix nodejs#12758, added an assertion that if `--without-ssl` or `--without-intl` are set, --without-debugger must also be explicitly set. * Added `--without-debugger` is an alias to `--without-inspector`, since we removed the old TCP `debug` protocol the V8 `inspect` protocol is the only debugger available. Hence disabling `inspector` means disabling any kind on JS debugger. Fixes: nodejs#12758
1 parent aa3eab0 commit 2a158b2

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

configure

+20-8
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,14 @@ parser.add_option('--no-browser-globals',
465465

466466
parser.add_option('--without-inspector',
467467
action='store_true',
468-
dest='without_inspector',
469-
help='disable experimental V8 inspector support')
468+
dest='without_debugger',
469+
help='disable V8 inspector support, the only node debugger API')
470+
471+
# more explicit alias to --without-inspector
472+
parser.add_option('--without-debugger',
473+
action='store_true',
474+
dest='without_debugger',
475+
help='disable V8 inspector support, the only node debugger API')
470476

471477
parser.add_option('--shared',
472478
action='store_true',
@@ -496,6 +502,8 @@ parser.add_option('-C',
496502

497503
(options, args) = parser.parse_args()
498504

505+
506+
499507
# Expand ~ in the install prefix now, it gets written to multiple files.
500508
options.prefix = os.path.expanduser(options.prefix or '')
501509

@@ -1296,11 +1304,15 @@ def configure_intl(o):
12961304
pprint.pformat(icu_config, indent=2) + '\n')
12971305
return # end of configure_intl
12981306

1299-
def configure_inspector(o):
1300-
disable_inspector = (options.without_inspector or
1301-
options.with_intl in (None, 'none') or
1302-
options.without_ssl)
1303-
o['variables']['v8_enable_inspector'] = 0 if disable_inspector else 1
1307+
def configure_debugger(o):
1308+
implicit_disable = (options.with_intl in (None, 'none') or
1309+
options.without_ssl)
1310+
if implicit_disable and not options.without_debugger:
1311+
raise Exception('Setting --without_ssl or --without-intl will disable the '
1312+
'`inspector` protocol. Ever since the removal of the '
1313+
'`debug` protocol this is the only available debugger '
1314+
'API, so it will leave the binary with no debug interfacehence --without-debugger must be set explicitly.')
1315+
o['variables']['v8_enable_inspector'] = 0 if options.without_debugger else 1
13041316

13051317
output = {
13061318
'variables': {},
@@ -1332,7 +1344,7 @@ configure_v8(output)
13321344
configure_openssl(output)
13331345
configure_intl(output)
13341346
configure_static(output)
1335-
configure_inspector(output)
1347+
configure_debugger(output)
13361348

13371349
# variables should be a root level element,
13381350
# move everything else to target_defaults

0 commit comments

Comments
 (0)