From 12bb012592b2bd82f52cd86ff60e8fa794ee6d3e Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Mon, 10 Jan 2022 06:37:59 -0800 Subject: [PATCH] [bazel] Don't use source files from external dependencies. This allows other Bazel projects to fetch those dependencies without relying on a full "gclient" checkout. Added "com_googlesource_chromium" prefix to repository names to indicate that those are Chromium forks and not official releases. Signed-off-by: Piotr Sikora Change-Id: I87272c3e8c28d14d8974cea144e457713c59d994 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3375478 Reviewed-by: Victor Gomes Cr-Commit-Position: refs/heads/main@{#78550} --- BUILD.bazel | 14 ++++---------- WORKSPACE | 10 ++++++++-- bazel/BUILD.trace_event_common | 10 ++++++++++ 3 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 bazel/BUILD.trace_event_common diff --git a/BUILD.bazel b/BUILD.bazel index 4c6c8740db..e65bdbf098 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -658,7 +658,6 @@ filegroup( filegroup( name = "v8_libplatform_files", srcs = [ - "base/trace_event/common/trace_event_common.h", "include/libplatform/libplatform.h", "include/libplatform/libplatform-export.h", "include/libplatform/v8-tracing.h", @@ -986,7 +985,6 @@ filegroup( ":v8_cppgc_shared_files", ":v8_bigint", ":generated_bytecode_builtins_list", - "base/trace_event/common/trace_event_common.h", "include/cppgc/common.h", "include/v8-inspector-protocol.h", "include/v8-inspector.h", @@ -1971,8 +1969,6 @@ filegroup( "src/snapshot/shared-heap-serializer.cc", "src/snapshot/snapshot-compression.cc", "src/snapshot/snapshot-compression.h", - "third_party/zlib/google/compression_utils_portable.h", - "third_party/zlib/google/compression_utils_portable.cc", "src/snapshot/snapshot-data.cc", "src/snapshot/snapshot-data.h", "src/snapshot/snapshot-source-sink.cc", @@ -2319,9 +2315,6 @@ filegroup( "src/trap-handler/handler-inside-win.cc", "src/trap-handler/handler-outside-win.cc", "src/trap-handler/handler-inside-win.h", - # Needed on windows to work around https://github.com/bazelbuild/bazel/issues/6337 - "third_party/zlib/zlib.h", - "third_party/zlib/zconf.h", ], "//conditions:default": [], }) + select({ @@ -3373,7 +3366,7 @@ v8_library( ], icu_deps = [ ":icu/generated_torque_headers", - "@icu", + "@com_googlesource_chromium_icu//:icu", ], icu_srcs = [ ":generated_regexp_special_case", @@ -3388,7 +3381,8 @@ v8_library( ], deps = [ ":v8_libbase", - "@zlib", + "@com_googlesource_chromium_base_trace_event_common//:trace_event_common", + "@com_googlesource_chromium_zlib//:zlib", ], ) @@ -3456,7 +3450,7 @@ v8_binary( "UNISTR_FROM_CHAR_EXPLICIT=", ], deps = [ - "@icu", + "@com_googlesource_chromium_icu//:icu", ], ) diff --git a/WORKSPACE b/WORKSPACE index 283acbd1d8..411fa475a6 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -32,13 +32,19 @@ pip_install( ) new_local_repository( - name = "zlib", + name = "com_googlesource_chromium_zlib", path = "third_party/zlib", build_file = "bazel/BUILD.zlib", ) new_local_repository( - name = "icu", + name = "com_googlesource_chromium_icu", path = "third_party/icu", build_file = "bazel/BUILD.icu", ) + +new_local_repository( + name = "com_googlesource_chromium_base_trace_event_common", + path = "base/trace_event/common", + build_file = "bazel/BUILD.trace_event_common", +) diff --git a/bazel/BUILD.trace_event_common b/bazel/BUILD.trace_event_common new file mode 100644 index 0000000000..685b284071 --- /dev/null +++ b/bazel/BUILD.trace_event_common @@ -0,0 +1,10 @@ +# Copyright 2021 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +cc_library( + name = "trace_event_common", + hdrs = ["trace_event_common.h"], + include_prefix = "base/trace_event/common", + visibility = ["//visibility:public"], +)