Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit642d5c5

Browse files
zcbenzmarco-ippolito
authored andcommitted
tools: use v8_features.json to populate config.gypi
PR-URL:#53749Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent2eea850 commit642d5c5

File tree

2 files changed

+7
-31
lines changed

2 files changed

+7
-31
lines changed

‎tools/generate_config_gypi.py

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# will be used to populate process.config.variables.
99

1010
importargparse
11+
importjson
1112
importre
1213
importos
1314
importsubprocess
@@ -16,26 +17,6 @@
1617
sys.path.append(os.path.dirname(__file__))
1718
importgetnapibuildversion
1819

19-
# The defines bellow must include all things from the external_v8_defines list
20-
# in v8/BUILD.gn.
21-
# TODO(zcbenz): Import from v8_features.json once this change gets into Node:
22-
# https://chromium-review.googlesource.com/c/v8/v8/+/5040612
23-
V8_FEATURE_DEFINES= {
24-
'v8_enable_v8_checks':'V8_ENABLE_CHECKS',
25-
'v8_enable_pointer_compression':'V8_COMPRESS_POINTERS',
26-
'v8_enable_pointer_compression_shared_cage':'V8_COMPRESS_POINTERS_IN_SHARED_CAGE',
27-
'v8_enable_31bit_smis_on_64bit_arch':'V8_31BIT_SMIS_ON_64BIT_ARCH',
28-
'v8_enable_zone_compression':'V8_COMPRESS_ZONES',
29-
'v8_enable_sandbox':'V8_ENABLE_SANDBOX',
30-
'v8_deprecation_warnings':'V8_DEPRECATION_WARNINGS',
31-
'v8_imminent_deprecation_warnings':'V8_IMMINENT_DEPRECATION_WARNINGS',
32-
'v8_use_perfetto':'V8_USE_PERFETTO',
33-
'v8_enable_map_packing':'V8_MAP_PACKING',
34-
'tsan':'V8_IS_TSAN',
35-
'v8_enable_conservative_stack_scanning':'V8_ENABLE_CONSERVATIVE_STACK_SCANNING',
36-
'v8_enable_direct_local':'V8_ENABLE_DIRECT_LOCAL',
37-
}
38-
3920
# Regex used for parsing results of "gn args".
4021
GN_RE=re.compile(r'(\w+)\s+=\s+(.*?)$',re.MULTILINE)
4122

@@ -60,15 +41,11 @@ def get_gn_config(out_dir):
6041
returnconfig
6142

6243
defget_v8_config(out_dir,node_gn_path):
63-
# For args that have default values in V8's GN configurations, we can not rely
64-
# on the values printed by "gn args", because most of them would be empty
65-
# strings, and the actual value would depend on the logics in v8/BUILD.gn.
66-
# So we print out the defines and deduce the feature from them instead.
67-
node_defines=subprocess.check_output(
68-
[GN,'desc','-C',out_dir,node_gn_path+":libnode",'defines']).decode().split('\n')
69-
v8_config= {}
70-
forfeature,defineinV8_FEATURE_DEFINES.items():
71-
v8_config[feature]=bool_to_number(defineinnode_defines)
44+
withopen(os.path.join(out_dir,'v8_features.json'))asf:
45+
v8_config=json.load(f)
46+
forkey,valueinv8_config.items():
47+
ifisinstance(value,bool):
48+
v8_config[key]=bool_to_number(value)
7249
returnv8_config
7350

7451
deftranslate_config(out_dir,config,v8_config):
@@ -90,8 +67,6 @@ def translate_config(out_dir, config, v8_config):
9067
'node_use_openssl':config['node_use_openssl'],
9168
'node_use_node_code_cache':config['node_use_node_code_cache'],
9269
'node_use_node_snapshot':config['node_use_node_snapshot'],
93-
'v8_enable_i18n_support':
94-
bool_string_to_number(config['v8_enable_i18n_support']),
9570
'v8_enable_inspector':# this is actually a node misnomer
9671
bool_string_to_number(config['node_enable_inspector']),
9772
'shlib_suffix':'dylib'ifsys.platform=='darwin'else'so',

‎unofficial.gni

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ template("node_gn_build") {
261261
}
262262

263263
action("generate_config_gypi") {
264+
deps= ["$node_v8_path:v8_generate_features_json" ]
264265
script="tools/generate_config_gypi.py"
265266
outputs= ["$target_gen_dir/config.gypi" ]
266267
depfile="$target_gen_dir/$target_name.d"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp