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

[v14.x] Backport V8 changes to remove set_sources_assignment_filter #39244

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,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.67',
'v8_embedder_string': '-node.72',

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

Expand Down
12 changes: 8 additions & 4 deletions deps/v8/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,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 = [ "./*" ]

configs = [ ":v8_tracing_config" ]

Expand All @@ -321,7 +322,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 @@ -429,7 +431,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 @@ -559,7 +562,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
12 changes: 6 additions & 6 deletions deps/v8/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ vars = {

deps = {
'v8/build':
Var('chromium_url') + '/chromium/src/build.git' + '@' + '1b904cc30093c25d5fd48389bd58e3f7409bcf80',
Var('chromium_url') + '/chromium/src/build.git' + '@' + 'c854b8178a7e0a20b168ffded4f2d2cb1e136e42',
'v8/third_party/depot_tools':
Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '454f4ba4b3a69feb03c73f93d789062033433b4c',
Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'd4e6fb6573e0955110a2c69be29557f6626d9ae6',
'v8/third_party/icu':
Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'f2223961702f00a8833874b0560d615a2cc42738',
'v8/third_party/instrumented_libraries':
Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + 'bb3f1802c237dd19105dd0f7919f99e536a39d10',
'v8/buildtools':
Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '204a35a2a64f7179f8b76d7a0385653690839e21',
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 Down Expand Up @@ -168,7 +168,7 @@ deps = {
'dep_type': 'cipd',
},
'v8/third_party/catapult': {
'url': Var('chromium_url') + '/catapult.git' + '@' + 'e9a8d378c950ee44beec5dd5207e151f48e5b5be',
'url': Var('chromium_url') + '/catapult.git' + '@' + 'f92a7636da65f28dad15bc524e6b681d1c311de0',
'condition': 'checkout_android',
},
'v8/third_party/colorama/src': {
Expand Down Expand Up @@ -236,7 +236,7 @@ deps = {
'dep_type': 'cipd',
},
'v8/tools/clang':
Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'de3e20662b84f0ee361a5ae11c99a9513df7c8e8',
Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'c72342ce992ebd9cc02c0d65f0af5941d29eb217',
'v8/tools/luci-go': {
'packages': [
{
Expand Down Expand Up @@ -266,7 +266,7 @@ deps = {
'dep_type': 'cipd',
},
'v8/third_party/perfetto':
Var('android_url') + '/platform/external/perfetto.git' + '@' + 'ff70e0d273ed10995866c803f23e11250eb3dc52',
Var('android_url') + '/platform/external/perfetto.git' + '@' + '7cdc44f903d3bcfd1d0f67188bfa797a24756868',
'v8/third_party/protobuf':
Var('chromium_url') + '/external/github.com/google/protobuf'+ '@' + 'b68a347f56137b4b1a746e8c7438495a6ac1bd91',
'v8/third_party/zlib':
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 @@ -141,6 +139,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
4 changes: 2 additions & 2 deletions deps/v8/src/base/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,14 @@ inline T RoundDown(T x, intptr_t m) {
STATIC_ASSERT(std::is_integral<T>::value);
// m must be a power of two.
DCHECK(m != 0 && ((m & (m - 1)) == 0));
return x & -m;
return x & static_cast<T>(-m);
}
template <intptr_t m, typename T>
constexpr inline T RoundDown(T x) {
STATIC_ASSERT(std::is_integral<T>::value);
// m must be a power of two.
STATIC_ASSERT(m != 0 && ((m & (m - 1)) == 0));
return x & -m;
return x & static_cast<T>(-m);
}

// Return the smallest multiple of m which is >= x.
Expand Down
7 changes: 7 additions & 0 deletions deps/v8/test/cctest/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ v8_header_set("cctest_headers") {
sources = [ "cctest.h" ]
}

config("cctest_sources_config") {
if (is_clang) {
cflags = [ "-Wno-string-concatenation" ]
}
}

v8_source_set("cctest_sources") {
testonly = true

Expand Down Expand Up @@ -398,6 +404,7 @@ v8_source_set("cctest_sources") {
"../..:external_config",
"../..:internal_config_base",
"../..:v8_tracing_config",
":cctest_sources_config",
]

public_deps = [
Expand Down
9 changes: 5 additions & 4 deletions deps/v8/test/cctest/libplatform/test-tracing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,11 @@ TEST(JsonIntegrationTest) {
std::vector<std::string> all_args;
GetJSONStrings(&all_args, json, "\"args\"", "{", "}");

CHECK_EQ("\"1\":1e+100", all_args[0]);
CHECK_EQ("\"2\":\"NaN\"", all_args[1]);
CHECK_EQ("\"3\":\"Infinity\"", all_args[2]);
CHECK_EQ("\"4\":\"-Infinity\"", all_args[3]);
// Ignore the first metadata event.
CHECK_EQ("\"1\":1e+100", all_args[1]);
CHECK_EQ("\"2\":\"NaN\"", all_args[2]);
CHECK_EQ("\"3\":\"Infinity\"", all_args[3]);
CHECK_EQ("\"4\":\"-Infinity\"", all_args[4]);
}

#endif // V8_USE_PERFETTO
Expand Down
18 changes: 4 additions & 14 deletions deps/v8/testing/gtest/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import("//build_overrides/gtest.gni")
if (is_ios) {
import("//build/buildflag_header.gni")
import("//build/config/coverage/coverage.gni")
import("//build/config/ios/ios_sdk.gni")
import("//build/buildflag_header.gni")
}

config("gtest_direct_config") {
Expand Down Expand Up @@ -40,9 +40,7 @@ static_library("gtest") {
# Android. https://codereview.chromium.org/2852613002/#ps20001
"empty.cc",
]
public_deps = [
"//third_party/googletest:gtest",
]
public_deps = [ "//third_party/googletest:gtest" ]

public_configs = [ ":gtest_direct_config" ]

Expand All @@ -58,27 +56,21 @@ static_library("gtest") {
}

if ((is_mac || is_ios) && gtest_include_objc_support) {
if (is_ios) {
set_sources_assignment_filter([])
}
sources += [
"../gtest_mac.h",
"../gtest_mac.mm",
]
if (gtest_include_platform_test) {
sources += [ "../platform_test_mac.mm" ]
}
set_sources_assignment_filter(sources_assignment_filter)
}

if (is_ios && gtest_include_ios_coverage) {
sources += [
"../coverage_util_ios.h",
"../coverage_util_ios.mm",
]
deps = [
":ios_enable_coverage",
]
deps = [ ":ios_enable_coverage" ]
}
}

Expand All @@ -87,9 +79,7 @@ static_library("gtest") {
# into //third_party/googletest.
source_set("gtest_main") {
testonly = true
deps = [
"//third_party/googletest:gtest_main",
]
deps = [ "//third_party/googletest:gtest_main" ]
}

if (is_ios) {
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/third_party/inspector_protocol/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import("../../gni/v8.gni")

config("crdtp_config") {
visibility = [ "../../src/inspector:*" ]
visibility = [ "../../src/inspector:*", ":*" ]
configs = [ "../../:internal_config" ]
include_dirs = [ "../../include" ]
}
Expand Down