From 085f022f1c9263e4d3f6d1ec18653a5029f16897 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 6 Jul 2022 13:06:34 -0400 Subject: [PATCH] Do not build linux-tests for fake platform with clang. Disable such tests in general in cloudbuild. (#20373) * Do not build fake-tests-clang The compiler platform for fake-tests is //build/toolchain/fake:fake_x64_gcc which is NOT a clang toolchain. * Add a comment about why the board check is done * Fix unit tests * Do not build tests (not even the clang version) for all build in cloudbuild * Do not build tests (not even the clang version) for all build in cloudbuild * Restyle * Revert "Restyle" This reverts commit 8bd2f67d2a70ab8939d390b3e540cbcb0cb12140. --- integrations/cloudbuild/build-all.yaml | 2 +- integrations/cloudbuild/smoke-test.yaml | 2 +- scripts/build/build/targets.py | 6 +++--- scripts/build/builders/host.py | 5 +++++ scripts/build/testdata/build_linux_on_x64.txt | 6 ------ 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index 169f18f921c242..f5f6608a2add91 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -19,7 +19,7 @@ steps: - >- ./scripts/build/build_examples.py --enable-flashbundle --target-glob '*' --skip-target-glob - '{tizen-*,*-tests,*-chip-test}' build --create-archives + '{tizen-*,*-tests*,*-chip-test}' build --create-archives /workspace/artifacts/ id: CompileAll waitFor: diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index 2101356729c7c5..da06941043bf75 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -69,7 +69,7 @@ steps: args: - >- ./scripts/build/build_examples.py --enable-flashbundle - --target-glob 'linux-*' --skip-target-glob '*-tests' build + --target-glob 'linux-*' --skip-target-glob '*-tests*' build --create-archives /workspace/artifacts/ waitFor: - Bootstrap diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 1c7e4789223f59..3c588beab98ed8 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -306,9 +306,9 @@ def HostTargets(): use_platform_mdns=True, enable_ipv4=False).GlobBlacklist("Reduce default build variants") test_target = Target(HostBoard.NATIVE.PlatformName(), HostBuilder) - for board in [HostBoard.NATIVE, HostBoard.FAKE]: - yield test_target.Extend(board.BoardName() + '-tests', board=board, app=HostApp.TESTS) - yield test_target.Extend(board.BoardName() + '-tests-clang', board=board, app=HostApp.TESTS, use_clang=True) + yield test_target.Extend(HostBoard.NATIVE.BoardName() + '-tests', board=HostBoard.NATIVE, app=HostApp.TESTS) + yield test_target.Extend(HostBoard.NATIVE.BoardName() + '-tests-clang', board=HostBoard.NATIVE, app=HostApp.TESTS, use_clang=True) + yield test_target.Extend(HostBoard.FAKE.BoardName() + '-tests', board=HostBoard.FAKE, app=HostApp.TESTS) def Esp32Targets(): diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 765e9bcb17e1d3..5e6a22aadf3379 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -234,6 +234,11 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_ip if use_clang: self.extra_gn_options.append('is_clang=true') + if self.board == HostBoard.FAKE: + # Fake uses "//build/toolchain/fake:fake_x64_gcc" + # so setting clang is not correct + raise Exception('Fake host board is always gcc (not clang)') + if use_platform_mdns: self.extra_gn_options.append('chip_mdns="platform"') diff --git a/scripts/build/testdata/build_linux_on_x64.txt b/scripts/build/testdata/build_linux_on_x64.txt index 5c02b32ff80cd1..8639b028349183 100644 --- a/scripts/build/testdata/build_linux_on_x64.txt +++ b/scripts/build/testdata/build_linux_on_x64.txt @@ -144,9 +144,6 @@ PKG_CONFIG_PATH="SYSROOT_AARCH64/lib/aarch64-linux-gnu/pkgconfig" \ # Generating linux-fake-tests gn gen --check --fail-on-unused-args --export-compile-commands --root={root} '--args=chip_build_tests=true custom_toolchain="//build/toolchain/fake:fake_x64_gcc" chip_link_tests=true chip_device_platform="fake" chip_fake_platform=true' {out}/linux-fake-tests -# Generating linux-fake-tests-clang -gn gen --check --fail-on-unused-args --export-compile-commands --root={root} '--args=is_clang=true chip_build_tests=true custom_toolchain="//build/toolchain/fake:fake_x64_gcc" chip_link_tests=true chip_device_platform="fake" chip_fake_platform=true' {out}/linux-fake-tests-clang - # Generating linux-x64-address-resolve-tool gn gen --check --fail-on-unused-args --export-compile-commands --root={root} {out}/linux-x64-address-resolve-tool @@ -342,9 +339,6 @@ ninja -C {out}/linux-arm64-tv-casting-app-ipv6only # Building linux-fake-tests ninja -C {out}/linux-fake-tests check -# Building linux-fake-tests-clang -ninja -C {out}/linux-fake-tests-clang check - # Building linux-x64-address-resolve-tool ninja -C {out}/linux-x64-address-resolve-tool src/lib/address_resolve:address-resolve-tool