Commit 3a997519 authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[build] Improve build dependencies for gn check

Currently if gn check is enabled (with v8/third_party ignored), there
are many errors due to headers being used without adding the proper
dependency in BUILD.gn (or because it's being used transitively without
a public_deps chain).

This makes the number of errors go from 2114 to 195.

Apart from adding dependencies, it also moves _v8_internal_Node_Print
from objects-printer.cc to node.cc so it can see the Node::Print method
which wouldn't otherwise be possible without a circular dependency. Also
removes the previously deleted compiler/graph-builder-tester.h file.

Bug: v8:7330
Change-Id: Icb34585fbef621588265cf4267cfc88ecbcf0a72
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2702331Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72908}
parent 13c3093b
...@@ -1926,6 +1926,8 @@ v8_source_set("v8_initializers") { ...@@ -1926,6 +1926,8 @@ v8_source_set("v8_initializers") {
deps = [ deps = [
":torque_generated_initializers", ":torque_generated_initializers",
":v8_base_without_compiler",
":v8_shared_internal_headers",
":v8_tracing", ":v8_tracing",
] ]
...@@ -2066,6 +2068,7 @@ v8_source_set("v8_init") { ...@@ -2066,6 +2068,7 @@ v8_source_set("v8_init") {
visibility = [ ":*" ] # Only targets in this file can depend on this. visibility = [ ":*" ] # Only targets in this file can depend on this.
deps = [ deps = [
":v8_base_without_compiler",
":v8_initializers", ":v8_initializers",
":v8_tracing", ":v8_tracing",
] ]
...@@ -2162,14 +2165,22 @@ v8_header_set("v8_wrappers") { ...@@ -2162,14 +2165,22 @@ v8_header_set("v8_wrappers") {
sources = [ "src/base/platform/wrappers.h" ] sources = [ "src/base/platform/wrappers.h" ]
} }
# This is split out to share basic headers with Torque. # This is split out to share basic headers with Torque and everything else:(
v8_header_set("v8_shared_internal_headers") { v8_header_set("v8_shared_internal_headers") {
visibility = [ ":*" ] # Only targets in this file can depend on this. visibility = [
":*",
"test/cctest:*",
"test/unittests:*",
"tools/debug_helper/:*",
]
configs = [ ":internal_config" ] configs = [ ":internal_config" ]
sources = [ "src/common/globals.h" ] sources = [ "src/common/globals.h" ]
deps = [ ":v8_headers" ] deps = [
":v8_headers",
":v8_libbase",
]
} }
v8_compiler_sources = [ v8_compiler_sources = [
...@@ -2428,6 +2439,12 @@ v8_source_set("v8_compiler_opt") { ...@@ -2428,6 +2439,12 @@ v8_source_set("v8_compiler_opt") {
":v8_tracing", ":v8_tracing",
] ]
deps = [
":v8_base_without_compiler",
":v8_libbase",
":v8_shared_internal_headers",
]
if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) { if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) {
# The :no_optimize config is added to v8_add_configs in v8.gni. # The :no_optimize config is added to v8_add_configs in v8.gni.
remove_configs = [ "//build/config/compiler:no_optimize" ] remove_configs = [ "//build/config/compiler:no_optimize" ]
...@@ -2453,6 +2470,12 @@ v8_source_set("v8_compiler") { ...@@ -2453,6 +2470,12 @@ v8_source_set("v8_compiler") {
":v8_tracing", ":v8_tracing",
] ]
deps = [
":v8_base_without_compiler",
":v8_libbase",
":v8_shared_internal_headers",
]
configs = [ ":internal_config" ] configs = [ ":internal_config" ]
} }
...@@ -4618,6 +4641,7 @@ v8_source_set("v8_cppgc_shared") { ...@@ -4618,6 +4641,7 @@ v8_source_set("v8_cppgc_shared") {
"src/heap/base/stack.h", "src/heap/base/stack.h",
"src/heap/base/worklist.cc", "src/heap/base/worklist.cc",
"src/heap/base/worklist.h", "src/heap/base/worklist.h",
"src/heap/cppgc/sanitizers.h",
] ]
if (is_clang || !is_win) { if (is_clang || !is_win) {
...@@ -4672,6 +4696,7 @@ v8_header_set("cppgc_headers") { ...@@ -4672,6 +4696,7 @@ v8_header_set("cppgc_headers") {
"include/cppgc/visitor.h", "include/cppgc/visitor.h",
] ]
deps = [ ":cppgc_base" ]
public_deps = [ ":v8_headers" ] public_deps = [ ":v8_headers" ]
} }
...@@ -4780,7 +4805,6 @@ v8_source_set("cppgc_base") { ...@@ -4780,7 +4805,6 @@ v8_source_set("cppgc_base") {
"src/heap/cppgc/process-heap.h", "src/heap/cppgc/process-heap.h",
"src/heap/cppgc/raw-heap.cc", "src/heap/cppgc/raw-heap.cc",
"src/heap/cppgc/raw-heap.h", "src/heap/cppgc/raw-heap.h",
"src/heap/cppgc/sanitizers.h",
"src/heap/cppgc/source-location.cc", "src/heap/cppgc/source-location.cc",
"src/heap/cppgc/stats-collector.cc", "src/heap/cppgc/stats-collector.cc",
"src/heap/cppgc/stats-collector.h", "src/heap/cppgc/stats-collector.h",
...@@ -4869,6 +4893,7 @@ v8_static_library("wee8") { ...@@ -4869,6 +4893,7 @@ v8_static_library("wee8") {
":v8_libbase", ":v8_libbase",
":v8_libplatform", ":v8_libplatform",
":v8_libsampler", ":v8_libsampler",
":v8_shared_internal_headers",
":v8_snapshot", ":v8_snapshot",
"//build/win:default_exe_manifest", "//build/win:default_exe_manifest",
] ]
...@@ -4900,6 +4925,7 @@ if (current_toolchain == v8_generator_toolchain) { ...@@ -4900,6 +4925,7 @@ if (current_toolchain == v8_generator_toolchain) {
"src/builtins/generate-bytecodes-builtins-list.cc", "src/builtins/generate-bytecodes-builtins-list.cc",
"src/interpreter/bytecode-operands.cc", "src/interpreter/bytecode-operands.cc",
"src/interpreter/bytecode-operands.h", "src/interpreter/bytecode-operands.h",
"src/interpreter/bytecode-traits.h",
"src/interpreter/bytecodes.cc", "src/interpreter/bytecodes.cc",
"src/interpreter/bytecodes.h", "src/interpreter/bytecodes.h",
] ]
...@@ -4908,6 +4934,7 @@ if (current_toolchain == v8_generator_toolchain) { ...@@ -4908,6 +4934,7 @@ if (current_toolchain == v8_generator_toolchain) {
deps = [ deps = [
":v8_libbase", ":v8_libbase",
":v8_shared_internal_headers",
"//build/win:default_exe_manifest", "//build/win:default_exe_manifest",
] ]
} }
...@@ -4948,6 +4975,7 @@ if (current_toolchain == v8_snapshot_toolchain) { ...@@ -4948,6 +4975,7 @@ if (current_toolchain == v8_snapshot_toolchain) {
":v8_libbase", ":v8_libbase",
":v8_libplatform", ":v8_libplatform",
":v8_maybe_icu", ":v8_maybe_icu",
":v8_shared_internal_headers",
":v8_tracing", ":v8_tracing",
":v8_wrappers", ":v8_wrappers",
"//build/win:default_exe_manifest", "//build/win:default_exe_manifest",
...@@ -5021,10 +5049,14 @@ if (v8_enable_i18n_support) { ...@@ -5021,10 +5049,14 @@ if (v8_enable_i18n_support) {
v8_executable("gen-regexp-special-case") { v8_executable("gen-regexp-special-case") {
visibility = [ ":*" ] # Only targets in this file can depend on this. visibility = [ ":*" ] # Only targets in this file can depend on this.
sources = [ "src/regexp/gen-regexp-special-case.cc" ] sources = [
"src/regexp/gen-regexp-special-case.cc",
"src/regexp/special-case.h",
]
deps = [ deps = [
":v8_libbase", ":v8_libbase",
":v8_shared_internal_headers",
"//build/win:default_exe_manifest", "//build/win:default_exe_manifest",
"//third_party/icu", "//third_party/icu",
] ]
...@@ -5525,6 +5557,7 @@ v8_source_set("wasm_test_common") { ...@@ -5525,6 +5557,7 @@ v8_source_set("wasm_test_common") {
deps = [ deps = [
":generate_bytecode_builtins_list", ":generate_bytecode_builtins_list",
":run_torque", ":run_torque",
":v8_shared_internal_headers",
":v8_tracing", ":v8_tracing",
] ]
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "src/base/bits.h" #include "src/base/bits.h"
#include "src/codegen/code-factory.h" #include "src/codegen/code-factory.h"
#include "src/codegen/code-stub-assembler.h"
#include "src/codegen/interface-descriptors.h" #include "src/codegen/interface-descriptors.h"
#include "src/codegen/machine-type.h" #include "src/codegen/machine-type.h"
#include "src/codegen/macro-assembler.h" #include "src/codegen/macro-assembler.h"
......
...@@ -499,3 +499,7 @@ bool Node::Uses::empty() const { return begin() == end(); } ...@@ -499,3 +499,7 @@ bool Node::Uses::empty() const { return begin() == end(); }
} // namespace compiler } // namespace compiler
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
V8_EXPORT_PRIVATE extern void _v8_internal_Node_Print(void* object) {
reinterpret_cast<i::compiler::Node*>(object)->Print();
}
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <memory> #include <memory>
#include "src/common/globals.h" #include "src/common/globals.h"
#include "src/compiler/node.h"
#include "src/debug/debug-wasm-objects-inl.h" #include "src/debug/debug-wasm-objects-inl.h"
#include "src/diagnostics/disasm.h" #include "src/diagnostics/disasm.h"
#include "src/diagnostics/disassembler.h" #include "src/diagnostics/disassembler.h"
...@@ -2750,7 +2749,3 @@ V8_EXPORT_PRIVATE extern void _v8_internal_Print_TransitionTree(void* object) { ...@@ -2750,7 +2749,3 @@ V8_EXPORT_PRIVATE extern void _v8_internal_Print_TransitionTree(void* object) {
#endif #endif
} }
} }
V8_EXPORT_PRIVATE extern void _v8_internal_Node_Print(void* object) {
reinterpret_cast<i::compiler::Node*>(object)->Print();
}
...@@ -88,7 +88,6 @@ v8_source_set("cctest_sources") { ...@@ -88,7 +88,6 @@ v8_source_set("cctest_sources") {
"compiler/codegen-tester.h", "compiler/codegen-tester.h",
"compiler/function-tester.cc", "compiler/function-tester.cc",
"compiler/function-tester.h", "compiler/function-tester.h",
"compiler/graph-builder-tester.h",
"compiler/node-observer-tester.h", "compiler/node-observer-tester.h",
"compiler/serializer-tester.cc", "compiler/serializer-tester.cc",
"compiler/serializer-tester.h", "compiler/serializer-tester.h",
...@@ -447,7 +446,10 @@ v8_source_set("cctest_sources") { ...@@ -447,7 +446,10 @@ v8_source_set("cctest_sources") {
] ]
defines = [] defines = []
deps = [ "../..:run_torque" ] deps = [
"../..:run_torque",
"../..:v8_shared_internal_headers",
]
if (v8_enable_i18n_support) { if (v8_enable_i18n_support) {
defines += [ "V8_INTL_SUPPORT" ] defines += [ "V8_INTL_SUPPORT" ]
......
...@@ -480,6 +480,7 @@ v8_source_set("unittests_sources") { ...@@ -480,6 +480,7 @@ v8_source_set("unittests_sources") {
"../..:v8_for_testing", "../..:v8_for_testing",
"../..:v8_libbase", "../..:v8_libbase",
"../..:v8_libplatform", "../..:v8_libplatform",
"../..:v8_shared_internal_headers",
"../..:v8_wrappers", "../..:v8_wrappers",
"../..:wasm_test_common", "../..:wasm_test_common",
"../../third_party/inspector_protocol:crdtp_test", "../../third_party/inspector_protocol:crdtp_test",
......
...@@ -97,6 +97,7 @@ v8_component("v8_debug_helper") { ...@@ -97,6 +97,7 @@ v8_component("v8_debug_helper") {
"../..:run_torque", "../..:run_torque",
"../..:v8_headers", "../..:v8_headers",
"../..:v8_libbase", "../..:v8_libbase",
"../..:v8_shared_internal_headers",
"../..:v8_tracing", "../..:v8_tracing",
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment