From 5366f807b754461865d5bb84861fed1f5575688c Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Mon, 6 Nov 2017 19:26:23 -0500 Subject: [PATCH] deps: V8 fix build on windows --- deps/v8/src/v8.gyp | 12 +++++------ .../testrunner/utils/dump_build_config_gyp.py | 21 ++++++++++++------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/deps/v8/src/v8.gyp b/deps/v8/src/v8.gyp index 1a2940b394c805..68a1ee8ac2b79d 100644 --- a/deps/v8/src/v8.gyp +++ b/deps/v8/src/v8.gyp @@ -2554,23 +2554,23 @@ ], 'action': [ 'python', - '../tools/testrunner/utils/dump_build_config_gyp.py', - '<(PRODUCT_DIR)/v8_build_config.json', + '<@(_inputs)', + '<@(_outputs)', 'dcheck_always_on=<(dcheck_always_on)', 'is_asan=<(asan)', 'is_cfi=<(cfi_vptr)', - 'is_component_build="<(component)"', - 'is_debug="<(CONFIGURATION_NAME)"', + 'is_component_build=<(component)', + 'is_debug=<(CONFIGURATION_NAME)', # Not available in gyp. 'is_gcov_coverage=0', 'is_msan=<(msan)', 'is_tsan=<(tsan)', # Not available in gyp. 'is_ubsan_vptr=0', - 'target_cpu="<(target_arch)"', + 'target_cpu=<(target_arch)', 'v8_enable_i18n_support=<(v8_enable_i18n_support)', 'v8_enable_verify_predictable=<(v8_enable_verify_predictable)', - 'v8_target_cpu="<(v8_target_arch)"', + 'v8_target_cpu=<(v8_target_arch)', 'v8_use_snapshot=<(v8_use_snapshot)', ], }, diff --git a/deps/v8/tools/testrunner/utils/dump_build_config_gyp.py b/deps/v8/tools/testrunner/utils/dump_build_config_gyp.py index 920459d929667f..7f726271314aac 100644 --- a/deps/v8/tools/testrunner/utils/dump_build_config_gyp.py +++ b/deps/v8/tools/testrunner/utils/dump_build_config_gyp.py @@ -20,28 +20,35 @@ GYP_GN_CONVERSION = { 'is_component_build': { - '"shared_library"': 'true', - '"static_library"': 'false', + 'shared_library': 'true', + 'static_library': 'false', }, 'is_debug': { - '"Debug"': 'true', - '"Release"': 'false', + 'Debug': 'true', + 'Release': 'false', }, } DEFAULT_CONVERSION ={ '0': 'false', '1': 'true', - '"ia32"': '"x86"', + 'ia32': 'x86', } def gyp_to_gn(key, value): - return GYP_GN_CONVERSION.get(key, DEFAULT_CONVERSION).get(value, value) + value = GYP_GN_CONVERSION.get(key, DEFAULT_CONVERSION).get(value, value) + value = value if value in ['true', 'false'] else '"{0}"'.format(value) + return value def as_json(kv): assert '=' in kv k, v = kv.split('=', 1) - return k, json.loads(gyp_to_gn(k, v)) + v2 = gyp_to_gn(k, v) + try: + return k, json.loads(v2) + except ValueError as e: + print(k, v, v2) + raise e with open(sys.argv[1], 'w') as f: json.dump(dict(map(as_json, sys.argv[2:])), f)