Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v12.x] Backport V8 changes to remove set_sources_assignment_filter #39245

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.47',
'v8_embedder_string': '-node.55',

##### V8 defaults for Node.js #####

Expand Down
47 changes: 8 additions & 39 deletions deps/v8/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import("//build/config/android/config.gni")
import("//build/config/arm.gni")
import("//build/config/dcheck_always_on.gni")
import("//build/config/host_byteorder.gni")
import("//build/config/jumbo.gni")
import("//build/config/mips.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build_overrides/build.gni")
Expand Down Expand Up @@ -266,7 +265,8 @@ v8_toolset_for_shell = "host"
#

config("internal_config_base") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
# Only targets in this file and its subdirs can depend on this.
visibility = [ "./*" ]

include_dirs = [
".",
Expand All @@ -276,7 +276,8 @@ config("internal_config_base") {

config("internal_config") {
defines = []
visibility = [ ":*" ] # Only targets in this file can depend on this.
# Only targets in this file and its subdirs can depend on this.
visibility = [ "./*" ]

configs = [
"//build/config/compiler:wexit_time_destructors",
Expand Down Expand Up @@ -362,7 +363,8 @@ config("v8_header_features") {
# Put defines here that are only used in our internal files and NEVER in
# external headers that embedders (such as chromium and node) might include.
config("features") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
# Only targets in this file and its subdirs can depend on this.
visibility = [ "./*" ]

defines = []

Expand Down Expand Up @@ -479,7 +481,8 @@ config("features") {
}

config("toolchain") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
# Only targets in this file and its subdirs can depend on this.
visibility = [ "./*" ]

defines = []
cflags = []
Expand Down Expand Up @@ -1470,17 +1473,12 @@ if (v8_use_snapshot && v8_use_external_startup_data) {
if (v8_use_multi_snapshots) {
deps += [ ":asm_to_inline_asm_trusted" ]
sources += [ "$target_gen_dir/embedded_trusted.cc" ]
jumbo_excluded_sources = [ "$target_gen_dir/embedded_trusted.cc" ]
}
} else if (v8_enable_embedded_builtins) {
sources += [ "$target_gen_dir/embedded.S" ]

if (v8_use_multi_snapshots) {
sources += [ "$target_gen_dir/embedded_trusted.S" ]
jumbo_excluded_sources = [
# Duplicated symbols with embedded.S
"$target_gen_dir/embedded_trusted.S",
]
}
} else {
sources += [ "src/snapshot/embedded/embedded-empty.cc" ]
Expand Down Expand Up @@ -1577,17 +1575,6 @@ v8_source_set("v8_initializers") {
"src/interpreter/interpreter-intrinsics-generator.h",
]

jumbo_excluded_sources = [
# TODO(mostynb@vewd.com): don't exclude these http://crbug.com/752428
"src/builtins/builtins-async-iterator-gen.cc",
"src/builtins/builtins-async-generator-gen.cc",

# These source files take an unusually large amount of time to
# compile. Build them separately to avoid bottlenecks.
"src/builtins/builtins-regexp-gen.cc",
"src/codegen/code-stub-assembler.cc",
]

if (v8_current_cpu == "x86") {
sources += [
### gcmole(arch:ia32) ###
Expand Down Expand Up @@ -2996,19 +2983,6 @@ v8_source_set("v8_base_without_compiler") {
sources += check_header_includes_sources
}

jumbo_excluded_sources = [
# TODO(mostynb@vewd.com): don't exclude these http://crbug.com/752428
"src/profiler/heap-snapshot-generator.cc", # Macro clash in mman-linux.h

# These source files take an unusually large amount of time to
# compile. Build them separately to avoid bottlenecks.
"src/api/api.cc",
"src/heap/heap.cc",
"src/objects/elements.cc",
"src/objects/objects.cc",
"src/parsing/parser.cc",
]

if (v8_current_cpu == "x86") {
sources += [ ### gcmole(arch:ia32) ###
"src/codegen/ia32/assembler-ia32-inl.h",
Expand Down Expand Up @@ -3162,11 +3136,6 @@ v8_source_set("v8_base_without_compiler") {
"src/diagnostics/unwinding-info-win64.h",
]
}
jumbo_excluded_sources += [
# TODO(mostynb@vewd.com): fix this code so it doesn't need
# to be excluded, see the comments inside.
"src/codegen/arm64/instructions-arm64-constants.cc",
]
} else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
sources += [ ### gcmole(arch:mipsel) ###
"src/codegen/mips/assembler-mips-inl.h",
Expand Down
26 changes: 17 additions & 9 deletions deps/v8/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
# directory and assume that the root of the checkout is in ./v8/, so
# all paths in here must match this assumption.

gclient_gn_args_file = 'v8/build/config/gclient_args.gni'
gclient_gn_args = [
'checkout_aemu'
]

vars = {
# By Default, do not checkout AEMU, as it is too big, as is done in Chromium.
'checkout_aemu': False,

# Fetches only the SDK boot images which match at least one of the whitelist
# entries in a comma-separated list.
#
Expand Down Expand Up @@ -72,15 +80,15 @@ vars = {

deps = {
'v8/build':
Var('chromium_url') + '/chromium/src/build.git' + '@' + '693faeda4ee025796c7e473d953a5a7b6ad64c93',
Var('chromium_url') + '/chromium/src/build.git' + '@' + 'c854b8178a7e0a20b168ffded4f2d2cb1e136e42',
'v8/third_party/depot_tools':
Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'f38bc1796282c61087dcf15abc61b8fd18a68402',
Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'd4e6fb6573e0955110a2c69be29557f6626d9ae6',
'v8/third_party/icu':
Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '53f6b233a41ec982d8445996247093f7aaf41639',
'v8/third_party/instrumented_libraries':
Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + 'b1c3ca20848c117eb935b02c25d441f03e6fbc5e',
'v8/buildtools':
Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '74cfb57006f83cfe050817526db359d5c8a11628',
Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '6302c1175607a436e18947a5abe9df2209e845fc',
'v8/buildtools/clang_format/script':
Var('chromium_url') + '/chromium/llvm-project/cfe/tools/clang-format.git' + '@' + '96636aa0e9f047f17447f2d45a094d0b59ed7917',
'v8/buildtools/linux64': {
Expand All @@ -104,11 +112,11 @@ deps = {
'condition': 'host_os == "mac"',
},
'v8/buildtools/third_party/libc++/trunk':
Var('chromium_url') + '/chromium/llvm-project/libcxx.git' + '@' + '5938e0582bac570a41edb3d6a2217c299adc1bc6',
Var('chromium_url') + '/chromium/llvm-project/libcxx.git' + '@' + '78d6a7767ed57b50122a161b91f59f19c9bd0d19',
'v8/buildtools/third_party/libc++abi/trunk':
Var('chromium_url') + '/chromium/llvm-project/libcxxabi.git' + '@' + '0d529660e32d77d9111912d73f2c74fc5fa2a858',
Var('chromium_url') + '/chromium/llvm-project/libcxxabi.git' + '@' + 'ce3db128f9e4d6d19d1cdbe39bb45fcc64a5adb0',
'v8/buildtools/third_party/libunwind/trunk':
Var('chromium_url') + '/external/llvm.org/libunwind.git' + '@' + '69d9b84cca8354117b9fe9705a4430d789ee599b',
Var('chromium_url') + '/external/llvm.org/libunwind.git' + '@' + '3e6ec2ae9afaa3683269b690612f84d907943ea2',
'v8/buildtools/win': {
'packages': [
{
Expand Down Expand Up @@ -168,7 +176,7 @@ deps = {
'dep_type': 'cipd',
},
'v8/third_party/catapult': {
'url': Var('chromium_url') + '/catapult.git' + '@' + 'e7c719c3e85f76938bf4fef0ba37c27f89246f71',
'url': Var('chromium_url') + '/catapult.git' + '@' + 'f92a7636da65f28dad15bc524e6b681d1c311de0',
'condition': 'checkout_android',
},
'v8/third_party/colorama/src': {
Expand Down Expand Up @@ -216,7 +224,7 @@ deps = {
'dep_type': 'cipd',
},
'v8/tools/clang':
Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '2fef805e5b05b26a8c87c47865590b5f43218611',
Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'c72342ce992ebd9cc02c0d65f0af5941d29eb217',
'v8/tools/luci-go': {
'packages': [
{
Expand Down Expand Up @@ -246,7 +254,7 @@ deps = {
'dep_type': 'cipd',
},
'v8/third_party/perfetto':
Var('android_url') + '/platform/external/perfetto.git' + '@' + '01615892494a9a8dc84414962d0a817bf97de2c2',
Var('android_url') + '/platform/external/perfetto.git' + '@' + '7cdc44f903d3bcfd1d0f67188bfa797a24756868',
'v8/third_party/protobuf':
Var('chromium_url') + '/external/github.com/google/protobuf'+ '@' + 'b68a347f56137b4b1a746e8c7438495a6ac1bd91',
}
Expand Down
11 changes: 6 additions & 5 deletions deps/v8/gni/proto_library.gni
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ template("proto_library") {
assert(defined(invoker.sources))
proto_sources = invoker.sources

set_sources_assignment_filter([])

if (host_os == "win") {
host_executable_suffix = ".exe"
} else {
Expand Down Expand Up @@ -137,6 +135,12 @@ template("proto_library") {
]
}

if (defined(invoker.import_dirs)) {
foreach(path, invoker.import_dirs) {
args += [ "--import-dir=" + rebase_path(path, root_build_dir) ]
}
}

if (generate_with_plugin) {
plugin_path_rebased = rebase_path(plugin_path, root_build_dir)
plugin_out_args = ""
Expand Down Expand Up @@ -187,10 +191,7 @@ template("proto_library") {
"visibility",
])

# Exclude the config.descriptor file which is an output for some reason.
set_sources_assignment_filter([ "*.descriptor" ])
sources = get_target_outputs(":$action_name")
set_sources_assignment_filter(sources_assignment_filter)

# configs -= [ "//gn/standalone:extra_warnings" ]
if (defined(invoker.extra_configs)) {
Expand Down
78 changes: 78 additions & 0 deletions deps/v8/gni/split_static_library.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Copyright 2019 the V8 project authors. All rights reserved.
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/compiler/compiler.gni")

template("split_static_library") {
assert(defined(invoker.split_count),
"Must define split_count for split_static_library")

# In many conditions the number of inputs will be 1 (because the
# count will be conditional on platform or configuration) and for
# some build configurations it's unnecessary to split libraries
# since the tooling will never create files of a problematic size.
if (invoker.split_count == 1 || use_lld) {
static_library(target_name) {
forward_variables_from(invoker, "*")
}
} else {
group_name = target_name

generated_static_libraries = []
current_library_index = 0
foreach(current_sources, split_list(invoker.sources, invoker.split_count)) {
current_name = "${target_name}_$current_library_index"
assert(
current_sources != [],
"Your values for splitting a static library generate one that has no sources.")
generated_static_libraries += [ ":$current_name" ]

static_library(current_name) {
# Generated static library shard gets everything but sources (which
# we're redefining) and visibility (which is set to be the group
# below).
forward_variables_from(invoker,
"*",
[
"check_includes",
"sources",
"visibility",
])
sources = current_sources
visibility = [ ":$group_name" ]

# When splitting a target's sources up into a series of static
# libraries, those targets will naturally include headers from each
# other arbitrarily. We could theoretically generate a web of
# dependencies and allow_circular_includes_from between all pairs of
# targets, but that's very cumbersome. Typical usage in Chrome is that
# only official Windows builds use split static libraries due to the
# Visual Studio size limits, and this means we'll still get header
# checking coverage for the other configurations.
check_includes = false

# Uniquify the output name if one is specified.
if (defined(invoker.output_name)) {
output_name = "${invoker.output_name}_$current_library_index"
}
}

current_library_index = current_library_index + 1
}

group(group_name) {
public_deps = generated_static_libraries
forward_variables_from(invoker,
[
"testonly",
"visibility",
])
}
}
}

set_defaults("split_static_library") {
configs = default_compiler_configs
}
11 changes: 5 additions & 6 deletions deps/v8/gni/v8.gni
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/jumbo.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/v8_target_cpu.gni")
import("//build/split_static_library.gni")
import("split_static_library.gni")

declare_args() {
# Set flags for tracking code coverage. Uses gcov with gcc and sanitizer
Expand Down Expand Up @@ -80,7 +79,7 @@ if (v8_use_multi_snapshots) {
# build configuration. This allows us to set v8_use_multi_snapshots=true on
# all bots, and e.g. no-snapshot bots will automatically do the right thing.
v8_use_multi_snapshots =
v8_use_external_startup_data && !build_with_chromium && !use_jumbo_build
v8_use_external_startup_data && !build_with_chromium
}

if (v8_enable_backtrace == "") {
Expand Down Expand Up @@ -149,9 +148,9 @@ template("v8_source_set") {
defined(v8_static_library) && v8_static_library && is_win) {
link_target_type = "jumbo_split_static_library"
} else if (defined(v8_static_library) && v8_static_library) {
link_target_type = "jumbo_static_library"
link_target_type = "static_library"
} else {
link_target_type = "jumbo_source_set"
link_target_type = "source_set"
}
target(link_target_type, target_name) {
forward_variables_from(invoker,
Expand All @@ -170,7 +169,7 @@ template("v8_source_set") {
}

template("v8_header_set") {
jumbo_source_set(target_name) {
source_set(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
configs -= v8_remove_configs
configs += v8_add_configs
Expand Down