Force use vpython3 for some scripts: add third_party/perfetto to NOEXPORT

Remove third_party/perfetto subrepo
This commit is contained in:
Carmelo Messina
2025-10-02 11:31:25 +02:00
parent 97edd08128
commit b2824377c3
2 changed files with 34 additions and 1 deletions
@@ -12,11 +12,12 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
build/config/python.gni | 7 ++++++-
.../metrics/generate_expired_histograms_array.gni | 7 +++++--
components/variations/field_trial_config/BUILD.gn | 4 +++-
third_party/perfetto/gn/BUILD.gn | 5 ++++-
tools/grit/grit_rule.gni | 4 +++-
tools/json_schema_compiler/json_schema_api.gni | 12 +++++++++---
tools/json_to_struct/json_to_struct.gni | 4 +++-
.../generate_allowlist_from_histograms_file.gni | 5 +++--
8 files changed, 36 insertions(+), 12 deletions(-)
9 files changed, 40 insertions(+), 13 deletions(-)
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
--- a/build/config/android/internal_rules.gni
@@ -107,6 +108,28 @@ diff --git a/components/variations/field_trial_config/BUILD.gn b/components/vari
rebase_path(source, root_build_dir),
"--destbase=" + rebase_path(target_gen_dir, root_build_dir),
"--namespace=variations",
diff --git a/third_party/perfetto/gn/BUILD.gn b/third_party/perfetto/gn/BUILD.gn
--- a/third_party/perfetto/gn/BUILD.gn
+++ b/third_party/perfetto/gn/BUILD.gn
@@ -36,7 +36,8 @@ if (perfetto_root_path == "//") {
# pattern #if PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
buildflag_gen_dir_ = "$root_gen_dir/$perfetto_root_path/build_config"
action("gen_buildflags") {
- script = "write_buildflag_header.py"
+ script = "//build/gn_run_binary.py"
+ original_script = "write_buildflag_header.py"
gen_header_path = "$buildflag_gen_dir_/perfetto_build_flags.h"
perfetto_component_build = false
@@ -111,6 +112,8 @@ action("gen_buildflags") {
rel_out_path = rebase_path(gen_header_path, "$root_build_dir")
args = [
+ rebase_path("//third_party/depot_tools/vpython3"),
+ rebase_path(original_script),
"--out",
rel_out_path,
"--rsp",
diff --git a/tools/grit/grit_rule.gni b/tools/grit/grit_rule.gni
--- a/tools/grit/grit_rule.gni
+++ b/tools/grit/grit_rule.gni
@@ -36,6 +36,16 @@ mv third_party/skia-bis third_party/skia
git add -f third_party/skia >/dev/null
git commit -m ":NOEXPORT: third_party/skia repo" >/dev/null
echo -e ${RED} ------- remove third_party/perfetto subrepo ${NC}
rm -rf third_party/perfetto/.git
cp -r third_party/perfetto third_party/perfetto-bis
git rm -rf third_party/perfetto || true
git submodule deinit -f third_party/perfetto || true
rm -rf third_party/perfetto
mv third_party/perfetto-bis third_party/perfetto
git add -f third_party/perfetto >/dev/null
git commit -m ":NOEXPORT: third_party/perfetto repo" >/dev/null
git prune
echo -e ${RED} ------- patches ${NC}