From 6f09cf90949984394949d85c56765b2a1043e78e Mon Sep 17 00:00:00 2001 From: Derek Xu Date: Thu, 26 Jan 2023 16:07:22 +0000 Subject: [PATCH] [VM] Add dependencies needed to generate protozero code This adds dependencies on the perfetto, protobuf, and protobuf-gn repos on fuchsia.googlesource.com. Change-Id: Ib196587e4cacb7e95c5ca284539fcd578d09d16b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278200 Commit-Queue: Derek Xu Reviewed-by: Ben Konyi Reviewed-by: Siva Annamalai --- DEPS | 16 ++++++++++++++++ build/config/BUILDCONFIG.gn | 4 ++++ build/config/sanitizers/sanitizers.gni | 4 ++++ build/secondary/build/test.gni | 11 +++++++++++ build/secondary/build_overrides/build.gni | 8 ++++++++ build/secondary/testing/gmock/BUILD.gn | 8 ++++++++ build/secondary/testing/gtest/BUILD.gn | 11 +++++++++++ build/secondary/third_party/.gitignore | 2 ++ third_party/.gitignore | 11 +++++++++-- .../protobuf/src/test/custom_options.proto | 12 ++++++++++++ 10 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 build/secondary/build/test.gni create mode 100644 build/secondary/build_overrides/build.gni create mode 100644 build/secondary/testing/gmock/BUILD.gn create mode 100644 build/secondary/testing/gtest/BUILD.gn create mode 100644 build/secondary/third_party/.gitignore create mode 100644 third_party/protobuf/src/test/custom_options.proto diff --git a/DEPS b/DEPS index ec4baf3e316..8622335bb96 100644 --- a/DEPS +++ b/DEPS @@ -97,8 +97,11 @@ vars = { "gperftools_revision": "bf8b714bf5075d0a6f2f28504b43095e2b1e11c5", "icu_rev": "81d656878ec611cb0b42d52c82e9dae93920d9ba", "jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1", + "libprotobuf_rev": "24487dd1045c7f3d64a21f38a3f0c06cc4cf2edb", "markupsafe_rev": "8f45f5cfa0009d2a70589bcda0349b8cb2b72783", + "perfetto_rev": "b8da07095979310818f0efde2ef3c69ea70d62c5", "ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93", + "protobuf_gn_rev": "b9517855b24624ec4edf4a11c1b7060f4ef237e6", "root_certificates_rev": "692f6d6488af68e0121317a9c2c9eb393eb0ee50", "WebCore_rev": "bcb10901266c884e7b3740abc597ab95373ab55c", "zlib_rev": "27c2f474b71d0d20764f86f60ef8b00da1a16cda", @@ -301,10 +304,23 @@ deps = { Var("chromium_git") + "/chromium/src/third_party/jinja2.git" + "@" + Var("jinja2_rev"), + Var("dart_root") + "/third_party/perfetto": + Var("fuchsia_git") + + "/third_party/android.googlesource.com/platform/external/perfetto" + + "@" + Var("perfetto_rev"), + Var("dart_root") + "/third_party/ply": Var("chromium_git") + "/chromium/src/third_party/ply.git" + "@" + Var("ply_rev"), + Var("dart_root") + "/build/secondary/third_party/protobuf": + Var("fuchsia_git") + "/protobuf-gn" + + "@" + Var("protobuf_gn_rev"), + + Var("dart_root") + "/third_party/protobuf": + Var("fuchsia_git") + "/third_party/protobuf" + + "@" + Var("libprotobuf_rev"), + Var("dart_root") + "/third_party/icu": Var("chromium_git") + "/chromium/deps/icu.git" + "@" + Var("icu_rev"), diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index c649f543bec..739b935642f 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -136,6 +136,10 @@ declare_args() { # Compile for execution in user-mode QEMU. is_qemu = false + + # protobuf-gn fails to build if this argument isn't defined. This should never + # be set to true, becuase we never build within the Fuchsia tree. + is_fuchsia_tree = false } # ============================================================================= diff --git a/build/config/sanitizers/sanitizers.gni b/build/config/sanitizers/sanitizers.gni index c7da74b09fe..bf4741b6e10 100644 --- a/build/config/sanitizers/sanitizers.gni +++ b/build/config/sanitizers/sanitizers.gni @@ -18,4 +18,8 @@ declare_args() { # standard system libraries. Set this flag to download prebuilt binaries from # GCS. use_prebuilt_instrumented_libraries = false + + # Perfetto targets fail to build if this argument isn't defined. When true, + # the preprocessor macro ADDRESS_SANITIZER_WITHOUT_INSTRUMENTATION is defined. + use_sanitizer_configs_without_instrumentation = false } diff --git a/build/secondary/build/test.gni b/build/secondary/build/test.gni new file mode 100644 index 00000000000..90ab6db3ae9 --- /dev/null +++ b/build/secondary/build/test.gni @@ -0,0 +1,11 @@ +# Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file for +# details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +# protobuf-gn fails to build without this stub. +template("test") { + group(target_name) { + not_needed(invoker, "*") + testonly = true + } +} diff --git a/build/secondary/build_overrides/build.gni b/build/secondary/build_overrides/build.gni new file mode 100644 index 00000000000..166dcbd1e7b --- /dev/null +++ b/build/secondary/build_overrides/build.gni @@ -0,0 +1,8 @@ +# Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file for +# details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +# Perfetto targets fail to build without this variable. It is used by Perfetto +# targets to distinguish embedder builds from Perfetto standalone builds, and +# builds in the Android tree. +perfetto_build_with_embedder = true diff --git a/build/secondary/testing/gmock/BUILD.gn b/build/secondary/testing/gmock/BUILD.gn new file mode 100644 index 00000000000..b38295240ec --- /dev/null +++ b/build/secondary/testing/gmock/BUILD.gn @@ -0,0 +1,8 @@ +# Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file for +# details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +# Perfetto targets fail to build without this stub. +group("gmock") { + testonly = true +} diff --git a/build/secondary/testing/gtest/BUILD.gn b/build/secondary/testing/gtest/BUILD.gn new file mode 100644 index 00000000000..851dd6066e5 --- /dev/null +++ b/build/secondary/testing/gtest/BUILD.gn @@ -0,0 +1,11 @@ +# Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file for +# details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +# Perfetto targets fail to build without these two stubs. +group("gtest") { + testonly = true +} +group("gtest_main") { + testonly = true +} diff --git a/build/secondary/third_party/.gitignore b/build/secondary/third_party/.gitignore new file mode 100644 index 00000000000..cbac2877711 --- /dev/null +++ b/build/secondary/third_party/.gitignore @@ -0,0 +1,2 @@ +# Ignore protobuf directory because it is retrieved by gclient sync. +protobuf/ diff --git a/third_party/.gitignore b/third_party/.gitignore index 9207a95beba..62dffae4797 100644 --- a/third_party/.gitignore +++ b/third_party/.gitignore @@ -1,7 +1,6 @@ # ignore everything * -# except for items in the pkg directory and self. -# except for our files in boringssl. The checkout is in boringssl/src. +# except for the following files and directories: !.gitignore !pkg !/tcmalloc @@ -13,3 +12,11 @@ !/wasmer # but ignore a subfolder of tcmalloc (some client ignores /tcmalloc/.gitignore) /tcmalloc/gperftools +# custom_options.proto needs to be checked in because it is a stub we define +# ourselves to prevent the "all" ninja target from breaking. +!protobuf/ +protobuf/* +!protobuf/src/ +protobuf/src/* +!protobuf/src/test/ +!protobuf/src/test/custom_options.proto diff --git a/third_party/protobuf/src/test/custom_options.proto b/third_party/protobuf/src/test/custom_options.proto new file mode 100644 index 00000000000..254581c4419 --- /dev/null +++ b/third_party/protobuf/src/test/custom_options.proto @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2023, the Dart project authors. Please see the AUTHORS + * file for details. All rights reserved. Use of this source code is + * governed by a BSD-style license that can be found in the LICENSE + * file. + */ + +// protobuf-gn defines a "custom_options_proto" target that references +// this file, so this stub is required to prevent the "all" Ninja target +// from breaking. + +syntax = "proto3";