From 47bf1fa74c90623167b35848016ac2217c7c06b6 Mon Sep 17 00:00:00 2001 From: Joshua Villasenor Date: Tue, 21 Mar 2023 11:43:22 -0700 Subject: [PATCH] Add simulated app to python builder and update cert docker image (#25754) --- .../docker/images/chip-cert-bins/Dockerfile | 6 ++++-- scripts/build/build/targets.py | 2 ++ scripts/build/builders/host.py | 16 ++++++++++++++++ scripts/build/testdata/all_targets_linux_x64.txt | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/integrations/docker/images/chip-cert-bins/Dockerfile b/integrations/docker/images/chip-cert-bins/Dockerfile index 82e88a28b0df5e..215cf49e59a58c 100644 --- a/integrations/docker/images/chip-cert-bins/Dockerfile +++ b/integrations/docker/images/chip-cert-bins/Dockerfile @@ -231,6 +231,7 @@ RUN case ${TARGETPLATFORM} in \ --target linux-x64-ota-provider-ipv6only \ --target linux-x64-ota-requestor-ipv6only \ --target linux-x64-lock-ipv6only \ + --target linux-x64-simulated-app1-ipv6only \ build \ && mv out/linux-x64-all-clusters-ipv6only/chip-all-clusters-app out/chip-all-clusters-app \ && mv out/linux-x64-all-clusters-minimal-ipv6only/chip-all-clusters-minimal-app out/chip-all-clusters-minimal-app \ @@ -242,6 +243,7 @@ RUN case ${TARGETPLATFORM} in \ && mv out/linux-x64-ota-provider-ipv6only/chip-ota-provider-app out/chip-ota-provider-app \ && mv out/linux-x64-ota-requestor-ipv6only/chip-ota-requestor-app out/chip-ota-requestor-app \ && mv out/linux-x64-lock-ipv6only/chip-lock-app out/chip-lock-app \ + && mv out/linux-x64-simulated-app1-ipv6only/chip-app1 out/chip-app1 \ ;; \ "linux/arm64")\ set -x \ @@ -257,6 +259,7 @@ RUN case ${TARGETPLATFORM} in \ --target linux-arm64-ota-provider-ipv6only \ --target linux-arm64-ota-requestor-ipv6only \ --target linux-arm64-lock-ipv6only \ + --target linux-arm64-simulated-app1-ipv6only \ build \ && mv out/linux-arm64-all-clusters-ipv6only/chip-all-clusters-app out/chip-all-clusters-app \ && mv out/linux-arm64-all-clusters-minimal-ipv6only/chip-all-clusters-minimal-app out/chip-all-clusters-minimal-app \ @@ -268,12 +271,11 @@ RUN case ${TARGETPLATFORM} in \ && mv out/linux-arm64-ota-provider-ipv6only/chip-ota-provider-app out/chip-ota-provider-app \ && mv out/linux-arm64-ota-requestor-ipv6only/chip-ota-requestor-app out/chip-ota-requestor-app \ && mv out/linux-arm64-lock-ipv6only/chip-lock-app out/chip-lock-app \ + && mv out/linux-arm64-simulated-app1-ipv6only/chip-app1 out/chip-app1 \ ;; \ *) ;; \ esac -RUN scripts/examples/gn_build_test_example.sh app1 - RUN source scripts/activate.sh && scripts/build_python.sh -m platform -d true -i no # Stage 3: Copy relevant cert bins to a minimal image to reduce size. diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index fefec0aa9ec353..6073ffc8aeac6b 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -105,6 +105,8 @@ def BuildHostTarget(): TargetPart('shell', app=HostApp.SHELL), TargetPart('ota-provider', app=HostApp.OTA_PROVIDER, enable_ble=False), TargetPart('ota-requestor', app=HostApp.OTA_REQUESTOR, enable_ble=False), + TargetPart('simulated-app1', app=HostApp.SIMULATED_APP1, enable_ble=False), + TargetPart('simulated-app2', app=HostApp.SIMULATED_APP2, enable_ble=False), TargetPart('python-bindings', app=HostApp.PYTHON_BINDINGS), TargetPart('tv-app', app=HostApp.TV_APP), TargetPart('tv-casting-app', app=HostApp.TV_CASTING), diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index ad9f07cf98da61..91fa10d0c36693 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -53,6 +53,8 @@ class HostApp(Enum): CERT_TOOL = auto() OTA_PROVIDER = auto() OTA_REQUESTOR = auto() + SIMULATED_APP1 = auto() + SIMULATED_APP2 = auto() PYTHON_BINDINGS = auto() EFR32_TEST_RUNNER = auto() TV_CASTING = auto() @@ -88,6 +90,8 @@ def ExamplePath(self): return 'shell/standalone' elif self == HostApp.OTA_PROVIDER: return 'ota-provider-app/linux' + elif self in [HostApp.SIMULATED_APP1, HostApp.SIMULATED_APP2]: + return 'placeholder/linux/' elif self == HostApp.OTA_REQUESTOR: return 'ota-requestor-app/linux' elif self in [HostApp.ADDRESS_RESOLVE, HostApp.TESTS, HostApp.PYTHON_BINDINGS, HostApp.CERT_TOOL]: @@ -155,6 +159,12 @@ def OutputNames(self): elif self == HostApp.CERT_TOOL: yield 'chip-cert' yield 'chip-cert.map' + elif self == HostApp.SIMULATED_APP1: + yield 'chip-app1' + yield 'chip-app1.map' + elif self == HostApp.SIMULATED_APP2: + yield 'chip-app2' + yield 'chip-app2.map' elif self == HostApp.OTA_PROVIDER: yield 'chip-ota-provider-app' yield 'chip-ota-provider-app.map' @@ -351,6 +361,12 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, self.extra_gn_options.append('chip_project_config_include_dirs=["//config/python"]') self.build_command = 'chip-repl' + if self.app == HostApp.SIMULATED_APP1: + self.extra_gn_options.append('chip_tests_zap_config="app1"') + + if self.app == HostApp.SIMULATED_APP2: + self.extra_gn_options.append('chip_tests_zap_config="app2"') + def GnBuildArgs(self): if self.board == HostBoard.NATIVE: return self.extra_gn_options diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 61ded36b551dfc..a162653f1efc62 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -8,7 +8,7 @@ efr32-{brd4161a,brd4187c,brd4186c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,b esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-coverage][-dmalloc][-clang] -linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,python-bindings,tv-app,tv-casting-app,bridge,dynamic-bridge,tests,chip-cert,address-resolve-tool,contact-sensor}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui] +linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,dynamic-bridge,tests,chip-cert,address-resolve-tool,contact-sensor}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui] linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage]