Skip to content

Commit

Permalink
build: require --without-debugger explicitly
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
refack committed May 1, 2017
1 parent aa3eab0 commit 2a158b2
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,14 @@ parser.add_option('--no-browser-globals',

parser.add_option('--without-inspector',
action='store_true',
dest='without_inspector',
help='disable experimental V8 inspector support')
dest='without_debugger',
help='disable V8 inspector support, the only node debugger API')

# more explicit alias to --without-inspector
parser.add_option('--without-debugger',
action='store_true',
dest='without_debugger',
help='disable V8 inspector support, the only node debugger API')

parser.add_option('--shared',
action='store_true',
Expand Down Expand Up @@ -496,6 +502,8 @@ parser.add_option('-C',

(options, args) = parser.parse_args()



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

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

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

output = {
'variables': {},
Expand Down Expand Up @@ -1332,7 +1344,7 @@ configure_v8(output)
configure_openssl(output)
configure_intl(output)
configure_static(output)
configure_inspector(output)
configure_debugger(output)

# variables should be a root level element,
# move everything else to target_defaults
Expand Down

0 comments on commit 2a158b2

Please sign in to comment.