Skip to content

Commit

Permalink
Do not build linux-tests for fake platform with clang. Disable such t…
Browse files Browse the repository at this point in the history
…ests 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 8bd2f67.
  • Loading branch information
andy31415 authored and pull[bot] committed Feb 6, 2024
1 parent c30fa7b commit 085f022
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion integrations/cloudbuild/build-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion integrations/cloudbuild/smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
5 changes: 5 additions & 0 deletions scripts/build/builders/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"')

Expand Down
6 changes: 0 additions & 6 deletions scripts/build/testdata/build_linux_on_x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 085f022

Please sign in to comment.