From 80cb5b1260148ac674bb94697621d0887a4e8001 Mon Sep 17 00:00:00 2001 From: Wyatt Hepler Date: Mon, 16 Oct 2023 19:16:52 +0000 Subject: [PATCH] build: Fix pw_BUILD_BROKEN_GROUPS - Avoid duplicate groups when pw_BUILD_BROKEN_GROUPS is enabled. - Enable pw_BUILD_BROKEN_GROUPS in presubmit to more thoroughly test the GN build. Change-Id: I55991f16980f199f6afa57e137d6be85173755ae Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/176114 Pigweed-Auto-Submit: Wyatt Hepler Presubmit-Verified: CQ Bot Account Reviewed-by: Armando Montanez Commit-Queue: Auto-Submit --- BUILD.gn | 25 ++++++++++--------- .../py/pw_presubmit/pigweed_presubmit.py | 5 +++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 0262cb1f36..a96f77d1f6 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -311,18 +311,19 @@ if (pw_BUILD_BROKEN_GROUPS) { toolchain_prefix = "$dir_pigweed/targets/lm3s6965evb_qemu:lm3s6965evb_qemu_clang_" } -} -group("qemu_gcc_size_optimized") { - deps = [ ":pigweed_default($dir_pigweed/targets/lm3s6965evb_qemu:lm3s6965evb_qemu_gcc_size_optimized)" ] -} -group("qemu_gcc") { - deps = [ ":qemu_gcc_size_optimized" ] -} -group("qemu_clang_size_optimized") { - deps = [ ":pigweed_default($dir_pigweed/targets/lm3s6965evb_qemu:lm3s6965evb_qemu_clang_size_optimized)" ] -} -group("qemu_clang") { - deps = [ ":qemu_clang_size_optimized" ] +} else { + group("qemu_gcc_size_optimized") { + deps = [ ":pigweed_default($dir_pigweed/targets/lm3s6965evb_qemu:lm3s6965evb_qemu_gcc_size_optimized)" ] + } + group("qemu_gcc") { + deps = [ ":qemu_gcc_size_optimized" ] + } + group("qemu_clang_size_optimized") { + deps = [ ":pigweed_default($dir_pigweed/targets/lm3s6965evb_qemu:lm3s6965evb_qemu_clang_size_optimized)" ] + } + group("qemu_clang") { + deps = [ ":qemu_clang_size_optimized" ] + } } # Run clang-tidy on pigweed_default with pw_strict_host_clang_debug toolchain options. diff --git a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py index 050865518f..f626008756 100755 --- a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py +++ b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py @@ -202,7 +202,10 @@ def _gn_combined_build_check_targets() -> Sequence[str]: name='gn_combined_build_check', doc='Run most host and device (QEMU) tests.', path_filter=_BUILD_FILE_FILTER, - gn_args=dict(pw_C_OPTIMIZATION_LEVELS=_OPTIMIZATION_LEVELS), + gn_args=dict( + pw_C_OPTIMIZATION_LEVELS=_OPTIMIZATION_LEVELS, + pw_BUILD_BROKEN_GROUPS=True, # Enable to fully test the GN build + ), ninja_targets=_gn_combined_build_check_targets(), )