From b2824377c30847f42e00c6ace66d91fa516b5f51 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Thu, 2 Oct 2025 11:31:25 +0200 Subject: [PATCH] Force use vpython3 for some scripts: add third_party/perfetto to NOEXPORT Remove third_party/perfetto subrepo --- .../Force-use-vpython3-for-some-scripts.patch | 25 ++++++++++++++++++- .../cromite-source/apply-cromite-patches.sh | 10 ++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/build/patches/Force-use-vpython3-for-some-scripts.patch b/build/patches/Force-use-vpython3-for-some-scripts.patch index b0628c2a..925f6a31 100644 --- a/build/patches/Force-use-vpython3-for-some-scripts.patch +++ b/build/patches/Force-use-vpython3-for-some-scripts.patch @@ -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 diff --git a/tools/images/cromite-source/apply-cromite-patches.sh b/tools/images/cromite-source/apply-cromite-patches.sh index 12662db3..f1ea838c 100644 --- a/tools/images/cromite-source/apply-cromite-patches.sh +++ b/tools/images/cromite-source/apply-cromite-patches.sh @@ -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}