Skip to content
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

build: fix gyp configs in debug #53605

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 15 additions & 5 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,9 @@ def host_arch_win():

return matchup.get(arch, 'x64')

def set_configuration_variable(configs, name, release=None, debug=None):
configs['Release'][name]= release
configs['Debug'][name]= debug
legendecas marked this conversation as resolved.
Show resolved Hide resolved

def configure_arm(o):
if options.arm_float_abi:
Expand Down Expand Up @@ -1619,7 +1622,9 @@ def configure_library(lib, output, pkgname=None):
output['libraries'] += pkg_libs.split()


def configure_v8(o):
def configure_v8(o, configs):
set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0)

o['variables']['v8_enable_webassembly'] = 0 if options.v8_lite_mode else 1
o['variables']['v8_enable_javascript_promise_hooks'] = 1
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
Expand All @@ -1637,7 +1642,6 @@ def configure_v8(o):
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
o['variables']['v8_enable_shared_ro_heap'] = 0 if options.enable_pointer_compression or options.disable_shared_ro_heap else 1
o['variables']['v8_enable_extensible_ro_snapshot'] = 0
o['variables']['v8_enable_v8_checks'] = 1 if options.debug else 0
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)
o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8)
Expand Down Expand Up @@ -2153,6 +2157,10 @@ def make_bin_override():
'defines': [],
'cflags': [],
}
configurations = {
'Release': { 'variables': {} },
'Debug': { 'variables': {} },
}

# Print a warning when the compiler is too old.
check_compiler(output)
Expand Down Expand Up @@ -2180,7 +2188,7 @@ def make_bin_override():
configure_library('ngtcp2', output, pkgname='libngtcp2')
configure_library('sqlite', output, pkgname='sqlite3')
configure_library('uvwasi', output, pkgname='libuvwasi')
configure_v8(output)
configure_v8(output, configurations)
configure_openssl(output)
configure_intl(output)
configure_static(output)
Expand All @@ -2203,7 +2211,6 @@ def make_bin_override():
# move everything else to target_defaults
variables = output['variables']
del output['variables']
variables['is_debug'] = B(options.debug)

# make_global_settings should be a root level element too
if 'make_global_settings' in output:
Expand All @@ -2212,6 +2219,9 @@ def make_bin_override():
else:
make_global_settings = False

# Add configurations to target defaults
output['configurations'] = configurations

output = {
'variables': variables,
'target_defaults': output,
Expand All @@ -2222,7 +2232,7 @@ def make_bin_override():
print_verbose(output)

write('config.gypi', do_not_edit +
pprint.pformat(output, indent=2, width=1024) + '\n')
pprint.pformat(output, indent=2, width=128) + '\n')

write('config.status', '#!/bin/sh\nset -x\nexec ./configure ' +
' '.join([shlex.quote(arg) for arg in original_argv]) + '\n')
Expand Down
1 change: 0 additions & 1 deletion tools/v8_gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
'v8_enable_private_mapping_fork_optimization': 0,
}],
],
'is_debug%': 0,

# Variables from BUILD.gn

Expand Down
6 changes: 0 additions & 6 deletions tools/v8_gypfiles/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -703,13 +703,7 @@
'configurations': {
'Debug': {
'defines': [
'ENABLE_DISASSEMBLER',
'V8_ENABLE_CHECKS',
'OBJECT_PRINT',
'DEBUG',
'V8_TRACE_MAPS',
'V8_ENABLE_ALLOCATION_TIMEOUT',
'V8_ENABLE_FORCE_SLOW_PATH',
],
'conditions': [
['OS=="linux" and v8_enable_backtrace==1', {
Expand Down
Loading