Skip to content

Commit 2b8f569

Browse files
refacktargos
authored andcommitted
build,deps: refactor and fix v8.gyp
* Make inspector.gypi and v8_external_snapshot.gypi includible targets. * Make `v8_dump_build_config` an action * Better separate `js2c` and `natives_blob` * process action outputs as sources * trigger v8.gyp:postmortem-metadata from v8.gyp PR-URL: #23182 Refs: #23156 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 9352d9d commit 2b8f569

8 files changed

+473
-506
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
# Reset this number to 0 on major V8 upgrades.
3333
# Increment by one for each non-official patch applied to deps/v8.
34-
'v8_embedder_string': '-node.31',
34+
'v8_embedder_string': '-node.32',
3535

3636
# Enable disassembler for `--print-code` v8 options
3737
'v8_enable_disassembler': 1,

deps/v8/gypfiles/features.gypi

+16-27
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,16 @@
2929

3030
{
3131
'variables': {
32-
'variables': {
33-
'v8_target_arch%': '<(target_arch)',
34-
},
32+
'v8_target_arch%': '<(target_arch)',
33+
34+
# Emulate GN variables
35+
'conditions': [
36+
['OS=="android"', { # GYP reverts OS to linux so use `-D OS=android`
37+
'is_android': 1,
38+
}, {
39+
'is_android': 0,
40+
}],
41+
],
3542

3643
# Allows the embedder to add a custom suffix to the version string.
3744
'v8_embedder_string%': '',
@@ -95,6 +102,8 @@
95102

96103
# Enable mitigations for executing untrusted code.
97104
'v8_untrusted_code_mitigations%': 'true',
105+
106+
'v8_enable_handle_zapping%': 1,
98107
},
99108
'target_defaults': {
100109
'conditions': [
@@ -105,7 +114,7 @@
105114
'defines': ['ENABLE_DISASSEMBLER',],
106115
}],
107116
['v8_promise_internal_field_count!=0', {
108-
'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT','v8_promise_internal_field_count'],
117+
'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT=<(v8_promise_internal_field_count)'],
109118
}],
110119
['v8_enable_gdbjit==1', {
111120
'defines': ['ENABLE_GDB_JIT_INTERFACE',],
@@ -155,30 +164,10 @@
155164
['v8_untrusted_code_mitigations=="false"', {
156165
'defines': ['DISABLE_UNTRUSTED_CODE_MITIGATIONS',],
157166
}],
167+
['v8_enable_handle_zapping==1', {
168+
'defines': ['ENABLE_HANDLE_ZAPPING',],
169+
}],
158170
], # conditions
159-
'configurations': {
160-
'DebugBaseCommon': {
161-
'abstract': 1,
162-
'variables': {
163-
'v8_enable_handle_zapping%': 1,
164-
},
165-
'conditions': [
166-
['v8_enable_handle_zapping==1', {
167-
'defines': ['ENABLE_HANDLE_ZAPPING',],
168-
}],
169-
],
170-
}, # Debug
171-
'Release': {
172-
'variables': {
173-
'v8_enable_handle_zapping%': 1,
174-
},
175-
'conditions': [
176-
['v8_enable_handle_zapping==1', {
177-
'defines': ['ENABLE_HANDLE_ZAPPING',],
178-
}],
179-
], # conditions
180-
}, # Release
181-
}, # configurations
182171
'defines': [
183172
'V8_GYP_BUILD',
184173
'V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=<(v8_typed_array_max_size_in_heap)',

deps/v8/gypfiles/inspector.gyp

-89
This file was deleted.

deps/v8/gypfiles/inspector.gypi

+63-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
{
66
'variables': {
7+
'protocol_path': '../third_party/inspector_protocol',
8+
'inspector_path': '../src/inspector',
9+
710
'inspector_generated_sources': [
811
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Forward.h',
912
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Protocol.cpp',
@@ -29,8 +32,6 @@
2932
'inspector_generated_injected_script': '<(SHARED_INTERMEDIATE_DIR)/src/inspector/injected-script-source.h',
3033

3134
'inspector_all_sources': [
32-
'<@(inspector_generated_sources)',
33-
'<(inspector_generated_injected_script)',
3435
'../include/v8-inspector.h',
3536
'../include/v8-inspector-protocol.h',
3637
'../src/inspector/injected-script.cc',
@@ -86,5 +87,64 @@
8687
'../src/inspector/wasm-translation.cc',
8788
'../src/inspector/wasm-translation.h',
8889
]
89-
}
90+
},
91+
'includes': [
92+
'../third_party/inspector_protocol/inspector_protocol.gypi',
93+
],
94+
'actions': [
95+
{
96+
'action_name': 'protocol_compatibility',
97+
'inputs': [
98+
'<(inspector_path)/js_protocol.json',
99+
],
100+
'outputs': [
101+
'<@(SHARED_INTERMEDIATE_DIR)/src/js_protocol.stamp',
102+
],
103+
'action': [
104+
'python',
105+
'<(protocol_path)/CheckProtocolCompatibility.py',
106+
'--stamp', '<@(_outputs)',
107+
'<(inspector_path)/js_protocol.json',
108+
],
109+
'message': 'Checking inspector protocol compatibility',
110+
},
111+
{
112+
'action_name': 'protocol_generated_sources',
113+
'inputs': [
114+
'<(inspector_path)/js_protocol.json',
115+
'<(inspector_path)/inspector_protocol_config.json',
116+
'<@(inspector_protocol_files)',
117+
],
118+
'outputs': [
119+
'<@(inspector_generated_sources)',
120+
],
121+
'process_outputs_as_sources': 1,
122+
'action': [
123+
'python',
124+
'<(protocol_path)/CodeGenerator.py',
125+
'--jinja_dir', '../third_party',
126+
'--output_base', '<(SHARED_INTERMEDIATE_DIR)/src/inspector',
127+
'--config', '<(inspector_path)/inspector_protocol_config.json',
128+
],
129+
'message': 'Generating inspector protocol sources from protocol json',
130+
},
131+
{
132+
'action_name': 'convert_js_to_cpp_char_array',
133+
'inputs': [
134+
'<(inspector_path)/build/xxd.py',
135+
'<(inspector_injected_script_source)',
136+
],
137+
'outputs': [
138+
'<(inspector_generated_injected_script)',
139+
],
140+
'process_outputs_as_sources': 1,
141+
'action': [
142+
'python',
143+
'<(inspector_path)/build/xxd.py',
144+
'InjectedScriptSource_js',
145+
'<(inspector_path)/injected-script-source.js',
146+
'<@(_outputs)'
147+
],
148+
},
149+
],
90150
}

deps/v8/gypfiles/toolchain.gypi

+19
Original file line numberDiff line numberDiff line change
@@ -1425,5 +1425,24 @@
14251425
}],
14261426
],
14271427
}, # configurations
1428+
'msvs_disabled_warnings': [
1429+
4245, # Conversion with signed/unsigned mismatch.
1430+
4267, # Conversion with possible loss of data.
1431+
4324, # Padding structure due to alignment.
1432+
4701, # Potentially uninitialized local variable.
1433+
4702, # Unreachable code.
1434+
4703, # Potentially uninitialized local pointer variable.
1435+
4709, # Comma operator within array index expr (bugged).
1436+
4714, # Function marked forceinline not inlined.
1437+
1438+
# MSVC assumes that control can get past an exhaustive switch and then
1439+
# warns if there's no return there (see https://crbug.com/v8/7658)
1440+
4715, # Not all control paths return a value.
1441+
1442+
4718, # Recursive call has no side-effect.
1443+
4723, # https://crbug.com/v8/7771
1444+
4724, # https://crbug.com/v8/7771
1445+
4800, # Forcing value to bool.
1446+
],
14281447
}, # target_defaults
14291448
}

0 commit comments

Comments
 (0)