Change official debug builds to release + dcheck_always_on (issue #1961)

This commit is contained in:
Marshall Greenblatt 2016-08-25 14:36:39 +03:00
parent da314f12fb
commit 0cba9481fb
1 changed files with 23 additions and 6 deletions

View File

@ -195,6 +195,10 @@ def ValidateArgs(args):
if not dcheck_always_on: if not dcheck_always_on:
msg('is_asan=true recommends dcheck_always_on=true') msg('is_asan=true recommends dcheck_always_on=true')
# Official build requires Release builds.
if is_official_build:
assert not is_debug, "is_official_build=true requires is_debug=false"
if platform == 'windows': if platform == 'windows':
# Official builds should not use /DEBUG:FASTLINK. # Official builds should not use /DEBUG:FASTLINK.
if is_official_build: if is_official_build:
@ -265,7 +269,18 @@ def GetConfigArgs(args, is_debug, is_x64):
""" """
Return merged GN args for the configuration and validate. Return merged GN args for the configuration and validate.
""" """
result = MergeDicts(args, { add_args = {}
# Cannot create is_official_build=true is_debug=true builds.
# This restriction is enforced in //build/config/BUILDCONFIG.gn.
# Instead, our "official Debug" build is a Release build with dchecks and
# symbols. Symbols will be generated by default for official builds; see the
# definition of 'symbol_level' in //build/config/compiler/compiler.gni.
if is_debug and GetArgValue(args, 'is_official_build'):
is_debug = False
add_args['dcheck_always_on'] = True
result = MergeDicts(args, add_args, {
'is_debug': is_debug, 'is_debug': is_debug,
'target_cpu': 'x64' if is_x64 else 'x86', 'target_cpu': 'x64' if is_x64 else 'x86',
}) })
@ -281,20 +296,22 @@ def GetAllPlatformConfigs(build_args):
# Merged args without validation. # Merged args without validation.
args = GetMergedArgs(build_args) args = GetMergedArgs(build_args)
create_debug = True
# Don't create debug directories for asan builds. # Don't create debug directories for asan builds.
is_asan = GetArgValue(args, 'is_asan') if GetArgValue(args, 'is_asan'):
if is_asan: create_debug = False
msg('Only generating Release configuration due to is_asan=true') msg('Not generating Debug configuration due to is_asan=true')
# Always create x64 configs. # Always create x64 configs.
if not is_asan: if create_debug:
result['Debug_GN_x64'] = GetConfigArgs(args, True, True) result['Debug_GN_x64'] = GetConfigArgs(args, True, True)
result['Release_GN_x64'] = GetConfigArgs(args, False, True) result['Release_GN_x64'] = GetConfigArgs(args, False, True)
# Create x86 configs on Windows and on Linux when using the sysroot. # Create x86 configs on Windows and on Linux when using the sysroot.
if platform == 'windows' or \ if platform == 'windows' or \
(platform == 'linux' and GetArgValue(args, 'use_sysroot') == True): (platform == 'linux' and GetArgValue(args, 'use_sysroot') == True):
if not is_asan: if create_debug:
result['Debug_GN_x86'] = GetConfigArgs(args, True, False) result['Debug_GN_x86'] = GetConfigArgs(args, True, False)
result['Release_GN_x86'] = GetConfigArgs(args, False, False) result['Release_GN_x86'] = GetConfigArgs(args, False, False)