From b2da1b043c4cd6b7140d6373655c03bdaff502ae Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 22 Feb 2024 13:44:16 -0500 Subject: [PATCH 01/10] Move CommandSender and PendingResponseTracker to IM. (#32227) * Move CommandSender and PendingResponseTracker to IM. Previous location of these files was `app` however this created apparent circular dependencies for includes. * Restyle * CommandSender is now tracked * Move read and write clients to interactionmodel as well * Also pull in interactionmodelhelper .... this is a very poorly named file --------- Co-authored-by: Andrei Litvin --- .github/workflows/lint.yml | 4 ---- src/app/BUILD.gn | 30 ++++++++++++++++-------------- src/app/CommandSender.cpp | 8 +------- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 66405b9e615b6d..69613217033e8b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -95,14 +95,11 @@ jobs: --known-failure app/att-storage.h \ --known-failure app/CommandHandler.h \ --known-failure app/CommandHandlerInterface.h \ - --known-failure app/CommandSender.h \ --known-failure app/CommandSenderLegacyCallback.h \ --known-failure app/CompatEnumNames.h \ --known-failure app/data-model/ListLargeSystemExtensions.h \ --known-failure app/EventHeader.h \ --known-failure app/EventLoggingTypes.h \ - --known-failure app/InteractionModelHelper.h \ - --known-failure app/ReadClient.h \ --known-failure app/ReadHandler.h \ --known-failure app/ReadPrepareParams.h \ --known-failure app/reporting/tests/MockReportScheduler.cpp \ @@ -132,7 +129,6 @@ jobs: --known-failure app/util/odd-sized-integers.h \ --known-failure app/util/util.cpp \ --known-failure app/util/util.h \ - --known-failure app/WriteClient.h \ --known-failure app/WriteHandler.h \ --known-failure lib/core/CHIPVendorIdentifiers.hpp \ --known-failure platform/DeviceSafeQueue.cpp \ diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index ec520e005b0d80..f714560afc15cb 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -140,16 +140,24 @@ static_library("interaction-model") { "CASEClientPool.h", "CASESessionManager.cpp", "CASESessionManager.h", + "CommandSender.cpp", + "CommandSender.h", "DeviceProxy.cpp", "DeviceProxy.h", "InteractionModelDelegatePointers.cpp", "InteractionModelDelegatePointers.h", "InteractionModelEngine.cpp", "InteractionModelEngine.h", + "InteractionModelHelper.h", "InteractionModelTimeout.h", "OperationalSessionSetup.cpp", "OperationalSessionSetup.h", "OperationalSessionSetupPool.h", + "PendingResponseTracker.h", + "PendingResponseTrackerImpl.cpp", + "PendingResponseTrackerImpl.h", + "ReadClient.h", # TODO: cpp is only included conditionally. Needs logic + # fixing "RequiredPrivilege.cpp", "RequiredPrivilege.h", "StatusResponse.cpp", @@ -157,6 +165,10 @@ static_library("interaction-model") { "SubscriptionResumptionStorage.h", "TimedHandler.cpp", "TimedHandler.h", + "TimedRequest.cpp", + "TimedRequest.h", + "WriteClient.cpp", + "WriteClient.h", "reporting/Engine.cpp", "reporting/Engine.h", "reporting/ReportScheduler.h", @@ -184,6 +196,10 @@ static_library("interaction-model") { public_configs = [ "${chip_root}/src:includes" ] + if (chip_enable_read_client) { + sources += [ "ReadClient.cpp" ] + } + if (chip_persist_subscriptions) { sources += [ "SimpleSubscriptionResumptionStorage.cpp", @@ -228,7 +244,6 @@ static_library("app") { "CommandResponseHelper.h", "CommandResponseSender.cpp", "CommandResponseSender.h", - "CommandSender.cpp", "DefaultAttributePersistenceProvider.cpp", "DefaultAttributePersistenceProvider.h", "DeferredAttributePersistenceProvider.cpp", @@ -240,26 +255,17 @@ static_library("app") { "FailSafeContext.cpp", "FailSafeContext.h", "OTAUserConsentCommon.h", - "PendingResponseTracker.h", - "PendingResponseTrackerImpl.cpp", - "PendingResponseTrackerImpl.h", "ReadHandler.cpp", "SafeAttributePersistenceProvider.h", - "TimedRequest.cpp", - "TimedRequest.h", "TimerDelegates.cpp", "TimerDelegates.h", - "WriteClient.cpp", "WriteHandler.cpp", # TODO: the following items cannot be included due to interaction-model circularity # (app depending on im and im including these headers): # Name with _ so that linter does not recognize it # "CommandHandler._h" - # "CommandSender._h", - # "ReadClient._h", # "ReadHandler._h", - # "WriteClient._h", # "WriteHandler._h" # TODO: the following items cannot be included due to platform includes not being @@ -288,10 +294,6 @@ static_library("app") { "BufferedReadCallback.h", "ClusterStateCache.cpp", "ClusterStateCache.h", - "ReadClient.cpp", - - # TODO: cannot include "ReadClient._h" because interaction-model backreference - # Name with _ so that linter does not recognize it ] } diff --git a/src/app/CommandSender.cpp b/src/app/CommandSender.cpp index 03ce2786b93d8d..18f4e755835076 100644 --- a/src/app/CommandSender.cpp +++ b/src/app/CommandSender.cpp @@ -16,15 +16,9 @@ * limitations under the License. */ -/** - * @file - * This file defines objects for a CHIP IM Invoke Command Sender - * - */ - #include "CommandSender.h" -#include "InteractionModelEngine.h" #include "StatusResponse.h" +#include #include #include #include From 091ee228cc453c7f2f45ee1f1eb4a10933b35d94 Mon Sep 17 00:00:00 2001 From: Kai Liao <140431279+kliao-csa@users.noreply.github.com> Date: Thu, 22 Feb 2024 10:47:31 -0800 Subject: [PATCH 02/10] Update spell.yml (#32132) * Update spell.yml Update the spell checker used * Update .wordlist.txt Remove defaultValue, an example of the camelcase we are working around, to trigger test on PR * Update .spellcheck.yml camelcase true * Update spell.yml * Wordlist camelcase removal * Update .wordlist.txt --- .github/.wordlist.txt | 32 +------------------------------- .github/workflows/spell.yml | 21 +++++++++++---------- .spellcheck.yml | 1 + 3 files changed, 13 insertions(+), 41 deletions(-) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 155e909a43f526..d92158e3277bc1 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -14,29 +14,19 @@ abfb ABI ABIs ables -AccessControl -AccessControlEntry +accesscontrol accessor Accessors -AccountLogin acdbc ack ACKed ACL ACLs actdiag -AdapterAddress -AdapterName adb AddNOC -AddOrUpdateThreadNetwork -AddOrUpdateWiFiNetwork addr -AddResponse -AddThreadNetwork -AddStatus adk -AdministratorCommissioning adoc adr AdvAutonomous @@ -48,7 +38,6 @@ AE aef AES AIDL -AlarmCode algs alloc Ameba @@ -61,15 +50,12 @@ AnnounceOTAProvider AnnounceOTAProviderRequest APIs apk -AppConfig AppImpl AppleTV appliable -ApplianceControl applianceeventsandalert ApplianceIdentification appliancestatistics -ApplicationBasic ApplicationId ApplicationIdentifier ApplicationLauncher @@ -171,7 +157,6 @@ BRD breakpoint bredr BridgedDeviceBasicInformation -bridgedLightEndpoint bringup BroadcastReceiver BromateConcentrationMeasurement @@ -259,9 +244,6 @@ CLIs cloudbuild CLRF clusterAttrs -clusterId -clusterList -clusterListName ClusterName ClusterObjectTests ClusterRevision @@ -315,7 +297,6 @@ ContentApp's ContentAppPlatform ContentLaunch ContentLauncher -continuousHinting contrib controllee conv @@ -382,7 +363,6 @@ DefaultOTARequestor DefaultOTARequestorDriver DefaultOTARequestorStorage DefaultSuccess -defaultValue definedValue DehumidificationControl DelayedActionTime @@ -415,9 +395,7 @@ DeviceLayer DeviceNetworkProvisioningDelegate DeviceNetworkProvisioningDelegateImpl DevicePairingDelegate -deviceSoftwareVersionModel DeviceTemperatureConfiguration -deviceType DevKitC DevKitM devtype @@ -511,8 +489,6 @@ EnableNetwork EnableWiFiNetwork endian EndpointId -endpointName -endsWith eno entrypoint enum @@ -580,7 +556,6 @@ FlowMeasurement FluorideConcentrationMeasurement focusable forkpty -formatOnSave FOTA FreeRTOS FreeRTOSConfig @@ -614,7 +589,6 @@ GetIP getManualTests GetSafeAttributePersistenceProvider getstarted -getTests GH ghcr ghp @@ -639,8 +613,6 @@ graphviz Groupcast GroupId GroupKeyManagement -groupKeySecurityPolicy -groupKeySetID groupsettings gsdk gtk @@ -694,8 +666,6 @@ ifconfig ifdef ifdefs IGMP -ignoreApplyUpdate -ignoreQueryImage ihex IlluminanceMeasurement IM diff --git a/.github/workflows/spell.yml b/.github/workflows/spell.yml index 57593372543079..1e8194a9a2075f 100644 --- a/.github/workflows/spell.yml +++ b/.github/workflows/spell.yml @@ -25,19 +25,20 @@ on: - ".github/.wordlist.txt" jobs: - check-reviewdog: - name: Check Spelling - reviewdog - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - uses: reviewdog/action-misspell@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} +# Seems redundant; removed as pyspelling is customized while this is not +# check-reviewdog: +# name: Check Spelling - reviewdog +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - uses: reviewdog/action-misspell@v1 +# with: +# github_token: ${{ secrets.GITHUB_TOKEN }} check-spellcheck: name: Check Spelling - pyspelling runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - uses: igsekor/pyspelling-any@v1.0.4 + - uses: rojopolis/spellcheck-github-actions@0.36.0 diff --git a/.spellcheck.yml b/.spellcheck.yml index c04880827addba..27a48c7de8e174 100644 --- a/.spellcheck.yml +++ b/.spellcheck.yml @@ -68,3 +68,4 @@ matrix: - '**/*.md|!third_party/**|!examples/common/**/repo/**|!docs/ERROR_CODES.md|!docs/clusters.md|!docs/testing/yaml_schema.md|!docs/testing/yaml_pseudocluster.md' aspell: ignore-case: true + camel-case: true From 3edfb9c77181822f6c92b92bf47ca8684f88984d Mon Sep 17 00:00:00 2001 From: Curtis Rahman <111998767+CuRahman@users.noreply.github.com> Date: Thu, 22 Feb 2024 14:44:43 -0500 Subject: [PATCH 03/10] Changed #if statement to #ifdef for SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT (#32268) --- examples/platform/silabs/FreeRTOSConfig.h | 2 +- src/platform/silabs/platformAbstraction/GsdkSpam.cpp | 4 ++-- third_party/silabs/efr32_sdk.gni | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/platform/silabs/FreeRTOSConfig.h b/examples/platform/silabs/FreeRTOSConfig.h index 93c7ee36444715..478dfa10be547f 100644 --- a/examples/platform/silabs/FreeRTOSConfig.h +++ b/examples/platform/silabs/FreeRTOSConfig.h @@ -122,7 +122,7 @@ extern uint32_t SystemCoreClock; #include "sl_component_catalog.h" #endif -#if SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT +#ifdef SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT #include "SEGGER_SYSVIEW_FreeRTOS.h" #endif diff --git a/src/platform/silabs/platformAbstraction/GsdkSpam.cpp b/src/platform/silabs/platformAbstraction/GsdkSpam.cpp index dda1b7e0e19dac..5527fbfe90d73d 100644 --- a/src/platform/silabs/platformAbstraction/GsdkSpam.cpp +++ b/src/platform/silabs/platformAbstraction/GsdkSpam.cpp @@ -49,7 +49,7 @@ extern "C" { #include "uart.h" #endif -#if SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT +#ifdef SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT #include "SEGGER_SYSVIEW.h" #endif } @@ -78,7 +78,7 @@ CHIP_ERROR SilabsPlatform::Init(void) sl_ot_sys_init(); #endif -#if SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT +#ifdef SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT SEGGER_SYSVIEW_Conf(); SEGGER_SYSVIEW_Start(); #endif diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 9868b47efb8a8d..8510295bf7c2e0 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -401,7 +401,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/util/third_party/segger/systemview/profiles/freertos_v10/", ] - defines += [ "SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT=1" ] + defines += [ "SL_CATALOG_SYSTEMVIEW_TRACE_PRESENT" ] } defines += board_defines From f2bdd1fc34b6b09ac9fe1d8a18e6c6b6b5001a31 Mon Sep 17 00:00:00 2001 From: Robert Szewczyk Date: Thu, 22 Feb 2024 20:58:26 +0000 Subject: [PATCH 04/10] EnergyPreference: Simplify logic around interaction with delegate (#32271) `Optional` is directly constructible from `Optional` --- .../energy-preference-server/energy-preference-server.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/app/clusters/energy-preference-server/energy-preference-server.cpp b/src/app/clusters/energy-preference-server/energy-preference-server.cpp index 7cb377a7221ba1..c3c645f3108982 100644 --- a/src/app/clusters/energy-preference-server/energy-preference-server.cpp +++ b/src/app/clusters/energy-preference-server/energy-preference-server.cpp @@ -78,9 +78,7 @@ CHIP_ERROR EnergyPrefAttrAccess::Read(const ConcreteReadAttributePath & aPath, A Optional label{ MutableCharSpan(buffer) }; if ((err = gsDelegate->GetEnergyBalanceAtIndex(endpoint, index, step, label)) == CHIP_NO_ERROR) { - BalanceStruct::Type balance = { step, - label.HasValue() ? Optional(label.Value()) - : Optional() }; + BalanceStruct::Type balance = { step, Optional(label) }; ReturnErrorOnFailure(encoder.Encode(balance)); index++; } @@ -137,9 +135,7 @@ CHIP_ERROR EnergyPrefAttrAccess::Read(const ConcreteReadAttributePath & aPath, A Optional label{ MutableCharSpan(buffer) }; if ((err = gsDelegate->GetLowPowerModeSensitivityAtIndex(endpoint, index, step, label)) == CHIP_NO_ERROR) { - BalanceStruct::Type balance = { step, - label.HasValue() ? Optional(label.Value()) - : Optional() }; + BalanceStruct::Type balance = { step, Optional(label) }; ReturnErrorOnFailure(encoder.Encode(balance)); index++; } From 7e3774e7c7bbb2cb949437b960a95a4589c8d1dc Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 22 Feb 2024 16:38:21 -0500 Subject: [PATCH 05/10] zap pregenerated dir does not exist anymore at all. zzz_generated is mostly empty (#32272) Co-authored-by: Andrei Litvin --- .../air-purifier-common/BUILD.gn | 3 -- .../air-quality-sensor-common/BUILD.gn | 3 -- .../all-clusters-common/BUILD.gn | 3 -- .../all-clusters-common/BUILD.gn | 3 -- examples/bridge-app/bridge-common/BUILD.gn | 1 - examples/chef/linux/BUILD.gn | 2 -- examples/chef/silabs/BUILD.gn | 2 -- .../contact-sensor-common/BUILD.gn | 3 -- .../contact-sensor-app/nxp/zap-lit/BUILD.gn | 3 -- .../contact-sensor-app/nxp/zap-sit/BUILD.gn | 3 -- .../dishwasher-app/dishwasher-common/BUILD.gn | 3 -- .../energy-management-common/BUILD.gn | 3 -- .../light-switch-common/BUILD.gn | 4 --- examples/light-switch-app/qpg/zap/BUILD.gn | 3 -- .../lighting-app/bouffalolab/bl602/BUILD.gn | 2 -- .../lighting-app/bouffalolab/bl702/BUILD.gn | 2 -- .../lighting-app/bouffalolab/bl702l/BUILD.gn | 2 -- .../lighting-app/lighting-common/BUILD.gn | 2 -- examples/lighting-app/nxp/zap/BUILD.gn | 3 -- examples/lighting-app/qpg/zap/BUILD.gn | 3 -- .../lighting-app/silabs/data_model/BUILD.gn | 2 -- examples/lit-icd-app/lit-icd-common/BUILD.gn | 3 -- examples/lock-app/lock-common/BUILD.gn | 2 -- examples/lock-app/nxp/zap/BUILD.gn | 2 -- examples/lock-app/qpg/zap/BUILD.gn | 2 -- .../log-source-app/log-source-common/BUILD.gn | 3 -- .../microwave-oven-common/BUILD.gn | 3 -- .../network-manager-common/BUILD.gn | 3 -- .../ota-provider-common/BUILD.gn | 3 -- .../ota-requestor-common/BUILD.gn | 3 -- examples/placeholder/linux/apps/app1/BUILD.gn | 3 -- examples/placeholder/linux/apps/app2/BUILD.gn | 3 -- examples/pump-app/pump-common/BUILD.gn | 2 -- examples/pump-app/silabs/data_model/BUILD.gn | 2 -- .../pump-controller-common/BUILD.gn | 3 -- .../refrigerator-common/BUILD.gn | 3 -- examples/rvc-app/rvc-common/BUILD.gn | 2 -- .../smoke-co-alarm-common/BUILD.gn | 3 -- .../temperature-measurement-common/BUILD.gn | 3 -- examples/thermostat/nxp/zap/BUILD.gn | 2 -- examples/thermostat/qpg/zap/BUILD.gn | 3 -- .../thermostat/thermostat-common/BUILD.gn | 2 -- examples/tv-app/tv-common/BUILD.gn | 2 -- .../tv-casting-app/tv-casting-common/BUILD.gn | 3 -- .../virtual-device-common/BUILD.gn | 3 -- examples/window-app/common/BUILD.gn | 2 -- src/app/chip_data_model.gni | 35 +------------------ src/controller/data_model/BUILD.gn | 4 --- 48 files changed, 1 insertion(+), 158 deletions(-) diff --git a/examples/air-purifier-app/air-purifier-common/BUILD.gn b/examples/air-purifier-app/air-purifier-common/BUILD.gn index 9715f88e65f2b3..aaf01bf29b7ba0 100755 --- a/examples/air-purifier-app/air-purifier-common/BUILD.gn +++ b/examples/air-purifier-app/air-purifier-common/BUILD.gn @@ -17,8 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("air-purifier-common") { zap_file = "air-purifier-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/air-purifier-app/zap-generated" is_server = true } diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/BUILD.gn b/examples/air-quality-sensor-app/air-quality-sensor-common/BUILD.gn index 6ca5be5ba634db..5cdba00ee78fc0 100755 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/BUILD.gn +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/BUILD.gn @@ -17,8 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("air-quality-sensor-common") { zap_file = "air-quality-sensor-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/air-quality-sensor-app/zap-generated" is_server = true } diff --git a/examples/all-clusters-app/all-clusters-common/BUILD.gn b/examples/all-clusters-app/all-clusters-common/BUILD.gn index 0210fcedb2c646..1b29a9c2775353 100644 --- a/examples/all-clusters-app/all-clusters-common/BUILD.gn +++ b/examples/all-clusters-app/all-clusters-common/BUILD.gn @@ -18,8 +18,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("all-clusters-common") { zap_file = "all-clusters-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/all-clusters-app/zap-generated" is_server = true } diff --git a/examples/all-clusters-minimal-app/all-clusters-common/BUILD.gn b/examples/all-clusters-minimal-app/all-clusters-common/BUILD.gn index 9991df1e8274ea..cd518cb42fe388 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/BUILD.gn +++ b/examples/all-clusters-minimal-app/all-clusters-common/BUILD.gn @@ -18,8 +18,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("all-clusters-common") { zap_file = "all-clusters-minimal-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/all-clusters-minimal-app/zap-generated" is_server = true } diff --git a/examples/bridge-app/bridge-common/BUILD.gn b/examples/bridge-app/bridge-common/BUILD.gn index ac3aa414ae3791..e833d33429567e 100644 --- a/examples/bridge-app/bridge-common/BUILD.gn +++ b/examples/bridge-app/bridge-common/BUILD.gn @@ -19,7 +19,6 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("bridge-common") { zap_file = "bridge-app.zap" - zap_pregenerated_dir = "${chip_root}/zzz_generated/bridge-app/zap-generated" is_server = true # TODO: the definition of DYNAMIC_ENDPOINT_COUNT needs find a common home! diff --git a/examples/chef/linux/BUILD.gn b/examples/chef/linux/BUILD.gn index a119f832e051db..02fa77dac864e5 100644 --- a/examples/chef/linux/BUILD.gn +++ b/examples/chef/linux/BUILD.gn @@ -35,8 +35,6 @@ project_dir = "./.." chip_data_model("chef-data-model") { zap_file = "${project_dir}/devices/${sample_zap_file}" - zap_pregenerated_dir = - "${chip_root}/examples/chef/out/${sample_name}/zap-generated/" is_server = true } diff --git a/examples/chef/silabs/BUILD.gn b/examples/chef/silabs/BUILD.gn index 3f74106f9f54c2..528fe2f2cfc50a 100644 --- a/examples/chef/silabs/BUILD.gn +++ b/examples/chef/silabs/BUILD.gn @@ -48,8 +48,6 @@ declare_args() { chip_data_model("chef-common") { zap_file = "${chef_project_dir}/devices/${sample_name}.zap" - - zap_pregenerated_dir = "${chef_project_dir}/out/${sample_name}/zap-generated/" is_server = true } diff --git a/examples/contact-sensor-app/contact-sensor-common/BUILD.gn b/examples/contact-sensor-app/contact-sensor-common/BUILD.gn index d95af40a21a3ff..b95b549f746cb6 100755 --- a/examples/contact-sensor-app/contact-sensor-common/BUILD.gn +++ b/examples/contact-sensor-app/contact-sensor-common/BUILD.gn @@ -17,8 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("contact-sensor-common") { zap_file = "contact-sensor-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/contact-sensor-app/zap-generated" is_server = true } diff --git a/examples/contact-sensor-app/nxp/zap-lit/BUILD.gn b/examples/contact-sensor-app/nxp/zap-lit/BUILD.gn index 7adfcbb7790a35..3baf5c4f59f105 100644 --- a/examples/contact-sensor-app/nxp/zap-lit/BUILD.gn +++ b/examples/contact-sensor-app/nxp/zap-lit/BUILD.gn @@ -18,8 +18,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("zap-lit") { zap_file = "contact-sensor-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/contact-sensor-app/nxp/zap-generated" is_server = true } diff --git a/examples/contact-sensor-app/nxp/zap-sit/BUILD.gn b/examples/contact-sensor-app/nxp/zap-sit/BUILD.gn index e9a20db41208d3..55fed097d333c8 100644 --- a/examples/contact-sensor-app/nxp/zap-sit/BUILD.gn +++ b/examples/contact-sensor-app/nxp/zap-sit/BUILD.gn @@ -18,8 +18,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("zap-sit") { zap_file = "contact-sensor-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/contact-sensor-app/nxp/zap-generated" is_server = true } diff --git a/examples/dishwasher-app/dishwasher-common/BUILD.gn b/examples/dishwasher-app/dishwasher-common/BUILD.gn index 01b634362098cd..73debf8ce3cbe1 100644 --- a/examples/dishwasher-app/dishwasher-common/BUILD.gn +++ b/examples/dishwasher-app/dishwasher-common/BUILD.gn @@ -21,8 +21,5 @@ config("config") { chip_data_model("dishwasher-common") { zap_file = "dishwasher-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/dishwasher-app/zap-generated" is_server = true } diff --git a/examples/energy-management-app/energy-management-common/BUILD.gn b/examples/energy-management-app/energy-management-common/BUILD.gn index 7c2040c1a4dc37..937aca9f1746d0 100644 --- a/examples/energy-management-app/energy-management-common/BUILD.gn +++ b/examples/energy-management-app/energy-management-common/BUILD.gn @@ -22,8 +22,5 @@ config("config") { chip_data_model("energy-management-common") { zap_file = "energy-management-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/energy-management-app/zap-generated" is_server = true } diff --git a/examples/light-switch-app/light-switch-common/BUILD.gn b/examples/light-switch-app/light-switch-common/BUILD.gn index 163e841678101a..8ec49aac0fa870 100644 --- a/examples/light-switch-app/light-switch-common/BUILD.gn +++ b/examples/light-switch-app/light-switch-common/BUILD.gn @@ -17,9 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("light-switch-common") { zap_file = "light-switch-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/light-switch-app/zap-generated" - is_server = true } diff --git a/examples/light-switch-app/qpg/zap/BUILD.gn b/examples/light-switch-app/qpg/zap/BUILD.gn index 35ac7ff5f28346..87282159a25ab3 100644 --- a/examples/light-switch-app/qpg/zap/BUILD.gn +++ b/examples/light-switch-app/qpg/zap/BUILD.gn @@ -17,8 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("zap") { zap_file = "switch.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/light-switch-app/qpg/zap-generated" is_server = true } diff --git a/examples/lighting-app/bouffalolab/bl602/BUILD.gn b/examples/lighting-app/bouffalolab/bl602/BUILD.gn index ab89ae3f3bdb63..7a4d4545e5ef28 100644 --- a/examples/lighting-app/bouffalolab/bl602/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl602/BUILD.gn @@ -90,8 +90,6 @@ bl_iot_sdk("sdk") { chip_data_model("bouffalolab-lighting") { zap_file = "${example_dir}/data_model/lighting-app-wifi.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" is_server = true } diff --git a/examples/lighting-app/bouffalolab/bl702/BUILD.gn b/examples/lighting-app/bouffalolab/bl702/BUILD.gn index f923e3bad6ffe9..05526ff9563e58 100644 --- a/examples/lighting-app/bouffalolab/bl702/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702/BUILD.gn @@ -122,8 +122,6 @@ chip_data_model("bouffalolab-lighting") { } else { zap_file = "${example_dir}/data_model/lighting-app-ethernet.zap" } - - zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" is_server = true } diff --git a/examples/lighting-app/bouffalolab/bl702l/BUILD.gn b/examples/lighting-app/bouffalolab/bl702l/BUILD.gn index 24fad9ffa1897d..ea06cfa41ac001 100644 --- a/examples/lighting-app/bouffalolab/bl702l/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702l/BUILD.gn @@ -99,8 +99,6 @@ bl_iot_sdk("sdk") { chip_data_model("bouffalolab-lighting") { zap_file = "${example_dir}/data_model/lighting-app-thread.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" is_server = true } diff --git a/examples/lighting-app/lighting-common/BUILD.gn b/examples/lighting-app/lighting-common/BUILD.gn index e983b3e0e0f11c..eb24b69dd214e1 100644 --- a/examples/lighting-app/lighting-common/BUILD.gn +++ b/examples/lighting-app/lighting-common/BUILD.gn @@ -21,8 +21,6 @@ config("config") { chip_data_model("lighting-common") { zap_file = "lighting-app.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" is_server = true } diff --git a/examples/lighting-app/nxp/zap/BUILD.gn b/examples/lighting-app/nxp/zap/BUILD.gn index fd4026e2b9dbf7..4280629a03cc3a 100644 --- a/examples/lighting-app/nxp/zap/BUILD.gn +++ b/examples/lighting-app/nxp/zap/BUILD.gn @@ -18,8 +18,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("zap") { zap_file = "lighting-on-off.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/lighting-app/nxp/zap-generated" is_server = true } diff --git a/examples/lighting-app/qpg/zap/BUILD.gn b/examples/lighting-app/qpg/zap/BUILD.gn index ec69db0b412a8c..c9de674a2bf8c8 100644 --- a/examples/lighting-app/qpg/zap/BUILD.gn +++ b/examples/lighting-app/qpg/zap/BUILD.gn @@ -17,8 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("zap") { zap_file = "light.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/lighting-app/qpg/zap-generated" is_server = true } diff --git a/examples/lighting-app/silabs/data_model/BUILD.gn b/examples/lighting-app/silabs/data_model/BUILD.gn index 9f1ee0d2aee78e..45062169315f03 100644 --- a/examples/lighting-app/silabs/data_model/BUILD.gn +++ b/examples/lighting-app/silabs/data_model/BUILD.gn @@ -22,7 +22,5 @@ chip_data_model("silabs-lighting") { } else { zap_file = "lighting-thread-app.zap" } - - zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" is_server = true } diff --git a/examples/lit-icd-app/lit-icd-common/BUILD.gn b/examples/lit-icd-app/lit-icd-common/BUILD.gn index a20d519c1cd7fa..28aa29a3981a69 100644 --- a/examples/lit-icd-app/lit-icd-common/BUILD.gn +++ b/examples/lit-icd-app/lit-icd-common/BUILD.gn @@ -17,8 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("lit-icd-common") { zap_file = "lit-icd-server-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/lit-icd-server-app/zap-generated" is_server = true } diff --git a/examples/lock-app/lock-common/BUILD.gn b/examples/lock-app/lock-common/BUILD.gn index bb01a5185f80f7..1312ec49bd134f 100644 --- a/examples/lock-app/lock-common/BUILD.gn +++ b/examples/lock-app/lock-common/BUILD.gn @@ -17,8 +17,6 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("lock-common") { zap_file = "lock-app.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/lock-app/zap-generated" is_server = true } diff --git a/examples/lock-app/nxp/zap/BUILD.gn b/examples/lock-app/nxp/zap/BUILD.gn index cc5fe9361c32a3..a21a2d57a57212 100644 --- a/examples/lock-app/nxp/zap/BUILD.gn +++ b/examples/lock-app/nxp/zap/BUILD.gn @@ -17,7 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("zap") { zap_file = "lock-app.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/lock-app/nxp/zap-generated" is_server = true } diff --git a/examples/lock-app/qpg/zap/BUILD.gn b/examples/lock-app/qpg/zap/BUILD.gn index 67e29db5f3f249..8560b5249ca5c9 100644 --- a/examples/lock-app/qpg/zap/BUILD.gn +++ b/examples/lock-app/qpg/zap/BUILD.gn @@ -17,7 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("zap") { zap_file = "lock.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/lock-app/qpg/zap-generated" is_server = true } diff --git a/examples/log-source-app/log-source-common/BUILD.gn b/examples/log-source-app/log-source-common/BUILD.gn index 1c434c209fb057..9aa178c078ed82 100644 --- a/examples/log-source-app/log-source-common/BUILD.gn +++ b/examples/log-source-app/log-source-common/BUILD.gn @@ -23,9 +23,6 @@ config("config") { chip_data_model("log-source-common") { zap_file = "log-source-app.zap" - zap_pregenerated_dir = - "${chip_root}/zzz_generated/log-source-app/zap-generated" - deps = [ "${chip_root}/src/protocols/bdx" ] is_server = true diff --git a/examples/microwave-oven-app/microwave-oven-common/BUILD.gn b/examples/microwave-oven-app/microwave-oven-common/BUILD.gn index 121f067a6a7d75..dd91ce23a30eed 100644 --- a/examples/microwave-oven-app/microwave-oven-common/BUILD.gn +++ b/examples/microwave-oven-app/microwave-oven-common/BUILD.gn @@ -21,8 +21,5 @@ config("config") { chip_data_model("microwave-oven-common") { zap_file = "microwave-oven-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/microwave-oven-app/zap-generated" is_server = true } diff --git a/examples/network-manager-app/network-manager-common/BUILD.gn b/examples/network-manager-app/network-manager-common/BUILD.gn index eced7ddbbbff7a..e220377a7963cb 100644 --- a/examples/network-manager-app/network-manager-common/BUILD.gn +++ b/examples/network-manager-app/network-manager-common/BUILD.gn @@ -17,8 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("network-manager-common") { zap_file = "network-manager-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/network-manager-app/zap-generated" is_server = true } diff --git a/examples/ota-provider-app/ota-provider-common/BUILD.gn b/examples/ota-provider-app/ota-provider-common/BUILD.gn index 63c5f2d1de5083..c13b1e1e73254c 100644 --- a/examples/ota-provider-app/ota-provider-common/BUILD.gn +++ b/examples/ota-provider-app/ota-provider-common/BUILD.gn @@ -23,9 +23,6 @@ config("config") { chip_data_model("ota-provider-common") { zap_file = "ota-provider-app.zap" - zap_pregenerated_dir = - "${chip_root}/zzz_generated/ota-provider-app/zap-generated" - sources = [ "BdxOtaSender.cpp", "BdxOtaSender.h", diff --git a/examples/ota-requestor-app/ota-requestor-common/BUILD.gn b/examples/ota-requestor-app/ota-requestor-common/BUILD.gn index edce1324ea7e1f..550d4c09aeb968 100644 --- a/examples/ota-requestor-app/ota-requestor-common/BUILD.gn +++ b/examples/ota-requestor-app/ota-requestor-common/BUILD.gn @@ -23,9 +23,6 @@ config("config") { chip_data_model("ota-requestor-common") { zap_file = "ota-requestor-app.zap" - zap_pregenerated_dir = - "${chip_root}/zzz_generated/ota-requestor-app/zap-generated" - deps = [ "${chip_root}/src/lib" ] public_configs = [ ":config" ] diff --git a/examples/placeholder/linux/apps/app1/BUILD.gn b/examples/placeholder/linux/apps/app1/BUILD.gn index ef7c277ec7f663..f16b9301ce3a90 100644 --- a/examples/placeholder/linux/apps/app1/BUILD.gn +++ b/examples/placeholder/linux/apps/app1/BUILD.gn @@ -17,9 +17,6 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("configuration") { zap_file = "config.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/placeholder/app1/zap-generated" is_server = true } diff --git a/examples/placeholder/linux/apps/app2/BUILD.gn b/examples/placeholder/linux/apps/app2/BUILD.gn index 5c18b7d2dc0914..2bea36611ffb37 100644 --- a/examples/placeholder/linux/apps/app2/BUILD.gn +++ b/examples/placeholder/linux/apps/app2/BUILD.gn @@ -17,9 +17,6 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("configuration") { zap_file = "config.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/placeholder/app2/zap-generated" is_server = true } diff --git a/examples/pump-app/pump-common/BUILD.gn b/examples/pump-app/pump-common/BUILD.gn index 58508f60af8adb..1e7280f5190079 100644 --- a/examples/pump-app/pump-common/BUILD.gn +++ b/examples/pump-app/pump-common/BUILD.gn @@ -18,7 +18,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("pump-common") { zap_file = "pump-app.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/pump-app/zap-generated" is_server = true } diff --git a/examples/pump-app/silabs/data_model/BUILD.gn b/examples/pump-app/silabs/data_model/BUILD.gn index 35d878aedcb90f..230ba5406364e3 100644 --- a/examples/pump-app/silabs/data_model/BUILD.gn +++ b/examples/pump-app/silabs/data_model/BUILD.gn @@ -22,7 +22,5 @@ chip_data_model("silabs-pump") { } else { zap_file = "pump-thread-app.zap" } - - zap_pregenerated_dir = "${chip_root}/zzz_generated/pump-app/zap-generated" is_server = true } diff --git a/examples/pump-controller-app/pump-controller-common/BUILD.gn b/examples/pump-controller-app/pump-controller-common/BUILD.gn index e62de422b08097..82e222e43ff4e1 100644 --- a/examples/pump-controller-app/pump-controller-common/BUILD.gn +++ b/examples/pump-controller-app/pump-controller-common/BUILD.gn @@ -18,8 +18,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("pump-controller-common") { zap_file = "pump-controller-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/pump-controller-app/zap-generated" is_server = true } diff --git a/examples/refrigerator-app/refrigerator-common/BUILD.gn b/examples/refrigerator-app/refrigerator-common/BUILD.gn index c747755e86c598..4e8e72bb343ff3 100644 --- a/examples/refrigerator-app/refrigerator-common/BUILD.gn +++ b/examples/refrigerator-app/refrigerator-common/BUILD.gn @@ -21,8 +21,5 @@ config("config") { chip_data_model("refrigerator-common") { zap_file = "refrigerator-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/refrigerator-app/zap-generated" is_server = true } diff --git a/examples/rvc-app/rvc-common/BUILD.gn b/examples/rvc-app/rvc-common/BUILD.gn index d567043f3ee346..2491f97d9b9809 100644 --- a/examples/rvc-app/rvc-common/BUILD.gn +++ b/examples/rvc-app/rvc-common/BUILD.gn @@ -21,7 +21,5 @@ config("config") { chip_data_model("rvc-common") { zap_file = "rvc-app.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/rvc-app/zap-generated" is_server = true } diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/BUILD.gn b/examples/smoke-co-alarm-app/smoke-co-alarm-common/BUILD.gn index 16e5328c1ba01c..6e78dcbf5c4f92 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/BUILD.gn +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/BUILD.gn @@ -17,8 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("smoke-co-alarm-common") { zap_file = "smoke-co-alarm-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/smoke-co-alarm-app/zap-generated" is_server = true } diff --git a/examples/temperature-measurement-app/temperature-measurement-common/BUILD.gn b/examples/temperature-measurement-app/temperature-measurement-common/BUILD.gn index 0430c288a90354..1f0f2daea65c76 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/BUILD.gn +++ b/examples/temperature-measurement-app/temperature-measurement-common/BUILD.gn @@ -18,8 +18,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("temperature-measurement-common") { zap_file = "temperature-measurement.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/temperature-measurement/zap-generated" is_server = true } diff --git a/examples/thermostat/nxp/zap/BUILD.gn b/examples/thermostat/nxp/zap/BUILD.gn index 976cd78f2e1a79..c3a3df7bd6729e 100644 --- a/examples/thermostat/nxp/zap/BUILD.gn +++ b/examples/thermostat/nxp/zap/BUILD.gn @@ -28,7 +28,5 @@ chip_data_model("zap") { zap_file = "thermostat_matter_thread.zap" } - # Defining zap_pregenerated_dir is required by chip_data_model.gni in order to build IMClusterCommandHandler.cpp - zap_pregenerated_dir = "" is_server = true } diff --git a/examples/thermostat/qpg/zap/BUILD.gn b/examples/thermostat/qpg/zap/BUILD.gn index 38074c904f32eb..3ea8a750459afc 100644 --- a/examples/thermostat/qpg/zap/BUILD.gn +++ b/examples/thermostat/qpg/zap/BUILD.gn @@ -17,8 +17,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("zap") { zap_file = "thermostaticRadiatorValve.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/thermostat/qpg/zap-generated" is_server = true } diff --git a/examples/thermostat/thermostat-common/BUILD.gn b/examples/thermostat/thermostat-common/BUILD.gn index 7f35acfdf371ad..93a0c7540fb93a 100644 --- a/examples/thermostat/thermostat-common/BUILD.gn +++ b/examples/thermostat/thermostat-common/BUILD.gn @@ -18,7 +18,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("thermostat-common") { zap_file = "thermostat.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/thermostat/zap-generated" is_server = true } diff --git a/examples/tv-app/tv-common/BUILD.gn b/examples/tv-app/tv-common/BUILD.gn index 699a13a20ec6e0..c253459d177caa 100644 --- a/examples/tv-app/tv-common/BUILD.gn +++ b/examples/tv-app/tv-common/BUILD.gn @@ -19,8 +19,6 @@ import("${chip_root}/src/lib/lib.gni") chip_data_model("tv-common") { zap_file = "tv-app.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/tv-app/zap-generated" is_server = true } diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index 38b983485c1800..ea6607a724b5cb 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -34,9 +34,6 @@ config("config") { chip_data_model("tv-casting-common") { zap_file = "tv-casting-app.zap" - zap_pregenerated_dir = - "${chip_root}/zzz_generated/tv-casting-app/zap-generated" - sources = [ "${chip_root}/examples/chip-tool/commands/clusters/ModelCommand.h", "${chip_root}/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.cpp", diff --git a/examples/virtual-device-app/virtual-device-common/BUILD.gn b/examples/virtual-device-app/virtual-device-common/BUILD.gn index 73be6ac9628be1..82eaf78d8f63e6 100644 --- a/examples/virtual-device-app/virtual-device-common/BUILD.gn +++ b/examples/virtual-device-app/virtual-device-common/BUILD.gn @@ -19,8 +19,5 @@ import("${chip_root}/src/lib/lib.gni") chip_data_model("virtual-device-common") { zap_file = "virtual-device-app.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/virtual-device-app/zap-generated" is_server = true } diff --git a/examples/window-app/common/BUILD.gn b/examples/window-app/common/BUILD.gn index 42941ee10d38d5..62fbc3aa3da4cf 100644 --- a/examples/window-app/common/BUILD.gn +++ b/examples/window-app/common/BUILD.gn @@ -18,7 +18,5 @@ import("${chip_root}/src/app/chip_data_model.gni") chip_data_model("window-common") { zap_file = "window-app.zap" - - zap_pregenerated_dir = "${chip_root}/zzz_generated/window-app/zap-generated" is_server = true } diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 85f5224ada7d37..3763243e404407 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -23,9 +23,6 @@ _app_root = get_path_info(".", "abspath") # Defines a source_set for CHIP data model. # # Arguments: -# zap_pregenerated_dir -# Path to the ZAP "gen" dir. -# # zap_file # Path to the ZAP input file. # @@ -54,14 +51,6 @@ template("chip_data_model") { _idl = string_replace(invoker.zap_file, ".zap", ".matter") } - config("${_data_model_name}_config") { - include_dirs = [] - - if (defined(invoker.zap_pregenerated_dir)) { - include_dirs += [ "${invoker.zap_pregenerated_dir}/.." ] - } - } - chip_zapgen("${_data_model_name}_zapgen") { input = rebase_path(invoker.zap_file) generator = "app-templates" @@ -82,18 +71,7 @@ template("chip_data_model") { prune_outputs = [] } - # TODO: It is unclear here why `zap_pregenerated_dir` has any relevance - # in including IMClusterCommandHandler or not. - # - # This logic has been carried over from previous code during compile - # time codegen addition, however the rationale of why pregenerated - # dir controls IMClusterCommandHandler needs to be explained and - # potentially controlled by a clearer variable (is this for controllers? - # is this during app compile but not others? I am unclear what - # zap_pregenerated_dir is supposed to convey. Existence of a directory - # does not obviously map to "need command handler cpp compiled in"). - if (defined(invoker.zap_pregenerated_dir) && - !chip_build_controller_dynamic_server) { + if (!chip_build_controller_dynamic_server) { outputs += [ "zap-generated/IMClusterCommandHandler.cpp" ] } else { if (defined(prune_outputs)) { @@ -101,8 +79,6 @@ template("chip_data_model") { } } - public_configs = [ ":${_data_model_name}_config" ] - if (!defined(deps)) { deps = [] } @@ -120,8 +96,6 @@ template("chip_data_model") { "app/cluster-init-callback.cpp", ] - public_configs = [ ":${_data_model_name}_config" ] - if (!defined(deps)) { deps = [] } @@ -136,7 +110,6 @@ template("chip_data_model") { forward_variables_from(invoker, "*", [ - "zap_pregenerated_dir", "zap_file", "is_server", "external_clusters", @@ -390,11 +363,5 @@ template("chip_data_model") { if (non_spec_compliant_ota_action_delay_floor >= 0) { cflags += [ "-DNON_SPEC_COMPLIANT_OTA_ACTION_DELAY_FLOOR=${non_spec_compliant_ota_action_delay_floor}" ] } - - if (!defined(public_configs)) { - public_configs = [] - } - - public_configs += [ ":${_data_model_name}_config" ] } } diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index 3b66d026699908..a0b57e7b91fc1e 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -42,9 +42,5 @@ chip_codegen("cluster-tlv-metadata") { chip_data_model("data_model") { zap_file = "controller-clusters.zap" - - zap_pregenerated_dir = - "${chip_root}/zzz_generated/controller-clusters/zap-generated" - allow_circular_includes_from = [ "${chip_root}/src/controller" ] } From 1cac17326c5c8e01fcdaa5b1808fa441ebea312c Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 22 Feb 2024 17:15:02 -0500 Subject: [PATCH 06/10] Bump pigweed to latest version (#32264) * Bump pigweed * Remove EnumCastOutOfRange check - todo to enable it later * zap-regen: apparently clang-format version changed * Minor updates based on clang-tidy feedback * Update size_t for RecordWriter.cpp * Restore pigweed update --------- Co-authored-by: Andrei Litvin --- .clang-tidy | 1 + .../app-templates/endpoint_config.h | 34 +++++++++---------- .../dnssd/minimal_mdns/core/RecordWriter.cpp | 2 +- src/lib/shell/commands/Dns.cpp | 2 +- src/lib/support/tests/TestIniEscaping.cpp | 1 - third_party/pigweed/repo | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index b494558e513460..fcb62d5d505d32 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -35,6 +35,7 @@ Checks: > -clang-analyzer-cplusplus.Move, -clang-analyzer-deadcode.DeadStores, -clang-analyzer-nullability.NullablePassedToNonnull, + -clang-analyzer-optin.core.EnumCastOutOfRange, -clang-analyzer-optin.cplusplus.UninitializedObject, -clang-analyzer-optin.cplusplus.VirtualCall, -clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker, diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index 6985b44ac27da5..38f04fbfea5857 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -302,15 +302,15 @@ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x7 }, /* ControlMode */ \ \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ - { (uint16_t) 0xA28, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* OccupiedCoolingSetpoint */ \ - { (uint16_t) 0x7D0, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* OccupiedHeatingSetpoint */ \ - { (uint16_t) 0x2BC, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MinHeatSetpointLimit */ \ - { (uint16_t) 0xBB8, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MaxHeatSetpointLimit */ \ - { (uint16_t) 0x640, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MinCoolSetpointLimit */ \ - { (uint16_t) 0xC80, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MaxCoolSetpointLimit */ \ - { (uint16_t) 0x19, (uint16_t) 0x0, (uint16_t) 0x19 }, /* MinSetpointDeadBand */ \ - { (uint16_t) 0x4, (uint16_t) 0x0, (uint16_t) 0x5 }, /* ControlSequenceOfOperation */ \ - { (uint16_t) 0x1, (uint16_t) 0x0, (uint16_t) 0x9 }, /* SystemMode */ \ + { (uint16_t) 0xA28, (uint16_t) - 0x6AB3, (uint16_t) 0x7FFF }, /* OccupiedCoolingSetpoint */ \ + { (uint16_t) 0x7D0, (uint16_t) - 0x6AB3, (uint16_t) 0x7FFF }, /* OccupiedHeatingSetpoint */ \ + { (uint16_t) 0x2BC, (uint16_t) - 0x6AB3, (uint16_t) 0x7FFF }, /* MinHeatSetpointLimit */ \ + { (uint16_t) 0xBB8, (uint16_t) - 0x6AB3, (uint16_t) 0x7FFF }, /* MaxHeatSetpointLimit */ \ + { (uint16_t) 0x640, (uint16_t) - 0x6AB3, (uint16_t) 0x7FFF }, /* MinCoolSetpointLimit */ \ + { (uint16_t) 0xC80, (uint16_t) - 0x6AB3, (uint16_t) 0x7FFF }, /* MaxCoolSetpointLimit */ \ + { (uint16_t) 0x19, (uint16_t) 0x0, (uint16_t) 0x19 }, /* MinSetpointDeadBand */ \ + { (uint16_t) 0x4, (uint16_t) 0x0, (uint16_t) 0x5 }, /* ControlSequenceOfOperation */ \ + { (uint16_t) 0x1, (uint16_t) 0x0, (uint16_t) 0x9 }, /* SystemMode */ \ \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x6 }, /* FanMode */ \ @@ -334,14 +334,14 @@ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* StartUpColorTemperatureMireds */ \ \ /* Endpoint: 1, Cluster: Unit Testing (server) */ \ - { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* range_restricted_int8u */ \ - { (uint16_t) -0x14, (uint16_t) -0x28, (uint16_t) 0x32 }, /* range_restricted_int8s */ \ - { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* range_restricted_int16u */ \ - { (uint16_t) -0x64, (uint16_t) -0x96, (uint16_t) 0xC8 }, /* range_restricted_int16s */ \ - { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* nullable_range_restricted_int8u */ \ - { (uint16_t) -0x14, (uint16_t) -0x28, (uint16_t) 0x32 }, /* nullable_range_restricted_int8s */ \ - { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* nullable_range_restricted_int16u */ \ - { (uint16_t) -0x64, (uint16_t) -0x96, (uint16_t) 0xC8 }, /* nullable_range_restricted_int16s */ \ + { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* range_restricted_int8u */ \ + { (uint16_t) - 0x14, (uint16_t) - 0x28, (uint16_t) 0x32 }, /* range_restricted_int8s */ \ + { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* range_restricted_int16u */ \ + { (uint16_t) - 0x64, (uint16_t) - 0x96, (uint16_t) 0xC8 }, /* range_restricted_int16s */ \ + { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* nullable_range_restricted_int8u */ \ + { (uint16_t) - 0x14, (uint16_t) - 0x28, (uint16_t) 0x32 }, /* nullable_range_restricted_int8s */ \ + { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* nullable_range_restricted_int16u */ \ + { (uint16_t) - 0x64, (uint16_t) - 0x96, (uint16_t) 0xC8 }, /* nullable_range_restricted_int16s */ \ \ /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ diff --git a/src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp b/src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp index 0249d80d6e35ff..41e9985687ad81 100644 --- a/src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp +++ b/src/lib/dnssd/minimal_mdns/core/RecordWriter.cpp @@ -41,7 +41,7 @@ RecordWriter & RecordWriter::WriteQName(const FullQName & qname) size_t qNameWriteStart = mOutput->WritePos(); bool isFullyCompressed = true; - for (uint16_t i = 0; i < qname.nameCount; i++) + for (size_t i = 0; i < qname.nameCount; i++) { // find out if the record part remaining already is located somewhere diff --git a/src/lib/shell/commands/Dns.cpp b/src/lib/shell/commands/Dns.cpp index badd6681fceec3..6abb2dc0393fec 100644 --- a/src/lib/shell/commands/Dns.cpp +++ b/src/lib/shell/commands/Dns.cpp @@ -131,7 +131,7 @@ class DnsShellResolverDelegate : public Dnssd::CommissioningResolveDelegate, pub nodeData.resolutionData.isICDOperatingAsLIT.Value() ? "LIT" : "SIT"); } streamer_printf(streamer_get(), " IP addresses:\r\n"); - for (uint8_t i = 0; i < nodeData.resolutionData.numIPs; i++) + for (size_t i = 0; i < nodeData.resolutionData.numIPs; i++) { streamer_printf(streamer_get(), " %s\r\n", nodeData.resolutionData.ipAddress[i].ToString(ipAddressBuf)); } diff --git a/src/lib/support/tests/TestIniEscaping.cpp b/src/lib/support/tests/TestIniEscaping.cpp index 44f8b37058b3cb..784a8fffdcb156 100644 --- a/src/lib/support/tests/TestIniEscaping.cpp +++ b/src/lib/support/tests/TestIniEscaping.cpp @@ -45,7 +45,6 @@ void TestUnescaping(nlTestSuite * inSuite, void * inContext) // Test valid cases NL_TEST_ASSERT(inSuite, UnescapeKey("") == ""); NL_TEST_ASSERT(inSuite, UnescapeKey("abcd1234,!") == "abcd1234,!"); - std::string out = UnescapeKey("abcd1234,!"); NL_TEST_ASSERT(inSuite, UnescapeKey("ab\\x0acd\\x20\\x3d12\\x5c34\\x7f") == "ab\ncd =12\\34\x7f"); NL_TEST_ASSERT(inSuite, UnescapeKey("\\x20") == " "); NL_TEST_ASSERT(inSuite, UnescapeKey("\\x3d\\x3d\\x3d") == "==="); diff --git a/third_party/pigweed/repo b/third_party/pigweed/repo index 0380161bd68c21..5165b9c17a9933 160000 --- a/third_party/pigweed/repo +++ b/third_party/pigweed/repo @@ -1 +1 @@ -Subproject commit 0380161bd68c216a590230f0cc49d26add7eef8a +Subproject commit 5165b9c17a9933b8d0714ef701421bf065d5d66a From 6af0d149bfd850ce5a89d1f73a5a92b17f385097 Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Thu, 22 Feb 2024 17:44:52 -0500 Subject: [PATCH 07/10] Set extended default advertising to be 1285ms (#32277) * Set extended default advertising to be 1285ms - 1285ms is more reliable than 1200ms in general (https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/8965) - Update TC-DD-2.1 script to match (https://github.com/CHIP-Specifications/chip-test-plans/pull/4020) - Update EFR32 platform to be tolerant of min==max for advertising rate Issue #32274 Fixes #32275 Testing done: - Linux builds, still discoverable, extended rate 1285ms - Tested with nRFConnect - EFR32 builds, still discoverable, extended rate 1285ms +/- 2ms - Tested with nRFConnect and xG24 Explorer kit * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../suites/certification/Test_TC_DD_2_1.yaml | 5 +++-- src/include/platform/CHIPDeviceConfig.h | 18 ++++++++---------- src/platform/silabs/efr32/BLEManagerImpl.cpp | 7 +++++++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_DD_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DD_2_1.yaml index 07533321325728..94888631f6a143 100644 --- a/src/app/tests/suites/certification/Test_TC_DD_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DD_2_1.yaml @@ -123,8 +123,9 @@ tests: Try NRF Connect app (https://www.nordicsemi.com/Products/Development-tools/nrf-connect-for-desktop) OR HCIDump (https://ubuntu.com/core/docs/bluez/reference/commands) - ->For T0 and 30s we have to get advertisement range between 20ms to 60ms - ->For 30s and 15mins we have to get advertisement range between 150ms to 1200ms + ->Between [0 .. 30s[ expect advertisement range between 20ms to 60ms. + ->Between [30s .. 900s[ expect advertisement range between 150ms to 1285ms. Allow +/- 10ms margin on the measured value. + ->Starting at 900s expect advertisement range larger or equal to 1200ms. disabled: true - label: "Step 6: TH does not respond to DUT. User power cycles the DUT" diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h index 6ee7d9c9634999..88ef78d1005314 100644 --- a/src/include/platform/CHIPDeviceConfig.h +++ b/src/include/platform/CHIPDeviceConfig.h @@ -647,28 +647,26 @@ * CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN * * The minimum interval (in units of 0.625ms) at which the device will send BLE advertisements while - * in the extended advertising mode. The minimum interval shall not be smaller than the default value - * and should not be equal to the CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX. + * in the extended advertising mode. The minimum interval shall not be smaller than the default value. * - * Defaults to 1920 (1200 ms). + * Defaults to 2056 (1285 ms). */ -#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN 1920 +#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN 2056 /** * CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX * * The maximum interval (in units of 0.625ms) at which the device will send BLE advertisements while - * in the extended advertising mode. The maximum interval should be greater and not equal to the - * CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN. + * in the extended advertising mode. The maximum interval should be greater. * - * Defaults to 1936 (1210 ms). + * Defaults to 2056 (1285 ms). */ #ifndef CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX -#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX 1936 +#define CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX 2056 #endif -static_assert(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN < CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX, - "Max Extended Advertising Interval cannot be smaller or equal to the Min Extended Advertising Interval"); +static_assert(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MIN <= CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_MAX, + "Max Extended Advertising Interval cannot be larger to the Min Extended Advertising Interval"); #endif diff --git a/src/platform/silabs/efr32/BLEManagerImpl.cpp b/src/platform/silabs/efr32/BLEManagerImpl.cpp index bd4aee39cf8160..4df91ad23368bb 100644 --- a/src/platform/silabs/efr32/BLEManagerImpl.cpp +++ b/src/platform/silabs/efr32/BLEManagerImpl.cpp @@ -582,6 +582,13 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) #endif } + // TODO(#32274): Explain why we cannot have interval_min == interval_max. + if (interval_min == interval_max) + { + ++interval_max; + } + ChipLogProgress(DeviceLayer, "Starting advertising with interval_min=%u, intverval_max=%u (units of 625us)", + static_cast(interval_min), static_cast(interval_max)); ret = sl_bt_advertiser_set_timing(advertising_set_handle, interval_min, interval_max, 0, 0); err = MapBLEError(ret); SuccessOrExit(err); From 524b8a8734b0a4cf9997a4c2988047e2c2d75342 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Thu, 22 Feb 2024 20:16:00 -0500 Subject: [PATCH 08/10] comment removed (#32261) --- src/app/CommandSender.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/CommandSender.cpp b/src/app/CommandSender.cpp index 18f4e755835076..7a03985b61b365 100644 --- a/src/app/CommandSender.cpp +++ b/src/app/CommandSender.cpp @@ -325,10 +325,7 @@ void CommandSender::OnResponseTimeout(Messaging::ExchangeContext * apExchangeCon ChipLogProgress(DataManagement, "Time out! failed to receive invoke command response from Exchange: " ChipLogFormatExchange, ChipLogValueExchange(apExchangeContext)); - // TODO(#30453) When timeout occurs for batch commands what should be done? Should all individual - // commands have a path specific error of timeout, or do we give or NoCommandResponse. OnErrorCallback(CHIP_ERROR_TIMEOUT); - Close(); } From 7f8c40bdaf984f8f11fe6aedc91c165e7e524eeb Mon Sep 17 00:00:00 2001 From: joonhaengHeo <85541460+joonhaengHeo@users.noreply.github.com> Date: Fri, 23 Feb 2024 13:34:42 +0900 Subject: [PATCH 09/10] Fix crash in Wi-Fi Connect Network (#32253) * Fix crash in Wi-Fi Connect Network * Update from comment * Restyled by clang-format --------- Co-authored-by: Restyled.io --- src/controller/CHIPDeviceController.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 57c75cd0d813ae..69e95244dcce01 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -3040,8 +3040,10 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio request.breadcrumb.Emplace(breadcrumb); CHIP_ERROR err = CHIP_NO_ERROR; - ChipLogProgress(Controller, "SendCommand kWiFiNetworkEnable, supportsConcurrentConnection=%d", - params.GetSupportsConcurrentConnection().Value()); + ChipLogProgress(Controller, "SendCommand kWiFiNetworkEnable, supportsConcurrentConnection=%s", + params.GetSupportsConcurrentConnection().HasValue() + ? (params.GetSupportsConcurrentConnection().Value() ? "true" : "false") + : "missing"); err = SendCommand(proxy, request, OnConnectNetworkResponse, OnBasicFailure, endpoint, timeout); if (err != CHIP_NO_ERROR) From 233c1777a12416be68b8c27b2fb7464dbfc94dac Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Fri, 23 Feb 2024 19:49:06 +1300 Subject: [PATCH 10/10] Darwin: Propagate sanitizer flags from Xcode into GN build (#32278) * Darwin: Propagate sanitizer flags from Xcode into GN build When ASAN, TSAN, or UBSAN are enabled from Xcode, turn on the corresponding setting in the GN build. * Set _LIBCPP_HAS_NO_ASAN for ASAN builds to match Xcodebuild --- .github/workflows/darwin.yaml | 18 +++++++----------- build/config/compiler/BUILD.gn | 5 +++++ .../Framework/chip_xcode_build_connector.sh | 6 +++--- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index 2d7443f9e9758c..a58617131a035d 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -105,19 +105,15 @@ jobs: mkdir -p /tmp/darwin/framework-tests ../../../out/debug/chip-all-clusters-app --interface-id -1 > >(tee /tmp/darwin/framework-tests/all-cluster-app.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-err.log >&2) & ../../../out/debug/chip-all-clusters-app --interface-id -1 --dac_provider ../../../credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json --product-id 32768 --discriminator 3839 --secured-device-port 5539 --KVS /tmp/chip-all-clusters-app-kvs2 > >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid.log) 2> >(tee /tmp/darwin/framework-tests/all-cluster-app-origin-vid-err.log >&2) & - # Disable BLE because the app does not have the permission to use - # it and that may crash the CI. - # - # -enableUndefinedBehaviorSanitizer instruments the code in Matter.framework, - # but to instrument the code in the underlying libCHIP we need to pass CHIP_IS_UBSAN=YES - TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'> >(tee /tmp/darwin/framework-tests/darwin-tests-asan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-err.log >&2) + # Disable BLE (CHIP_IS_BLE=NO) because the app does not have the permission to use it and that may crash the CI. + + TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'> >(tee /tmp/darwin/framework-tests/darwin-tests-asan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-err.log >&2) # And the same thing, but with MTR_PER_CONTROLLER_STORAGE_ENABLED turned off, so we test that it does not break for now. - TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 MTR_PER_CONTROLLER_STORAGE_ENABLED=0' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage-err.log >&2) + TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 MTR_PER_CONTROLLER_STORAGE_ENABLED=0' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage-err.log >&2) # And the same thing, but with MTR_NO_AVAILABILITY not turned on. This requires -Wno-unguarded-availability-new to avoid availability errors. - TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited}' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations-err.log >&2) - # -enableThreadSanitizer instruments the code in Matter.framework, - # but to instrument the code in the underlying libCHIP we need to pass CHIP_IS_TSAN=YES - xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableThreadSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_TSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-tsan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-tsan-err.log >&2) + TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited}' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations-err.log >&2) + + xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableThreadSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-tsan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-tsan-err.log >&2) working-directory: src/darwin/Framework - name: Build Matter TV Casting Bridge run: | diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index b6ad67a64944fd..7ada1348f797b4 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -395,11 +395,16 @@ declare_args() { } config("sanitize_address") { + defines = [] cflags = [ "-fsanitize=address", "-fno-omit-frame-pointer", ] ldflags = cflags + + if (target_os == "mac" || target_os == "ios") { + defines += [ "_LIBCPP_HAS_NO_ASAN" ] + } } config("sanitize_thread") { diff --git a/src/darwin/Framework/chip_xcode_build_connector.sh b/src/darwin/Framework/chip_xcode_build_connector.sh index 3ab0464bb79482..e802e99cd0cfcd 100755 --- a/src/darwin/Framework/chip_xcode_build_connector.sh +++ b/src/darwin/Framework/chip_xcode_build_connector.sh @@ -132,19 +132,19 @@ esac ) } -[[ $CHIP_IS_ASAN == YES ]] && { +[[ $CHIP_IS_ASAN == YES || $ENABLE_ADDRESS_SANITIZER == YES ]] && { args+=( 'is_asan=true' ) } -[[ $CHIP_IS_UBSAN == YES ]] && { +[[ $CHIP_IS_UBSAN == YES || $ENABLE_UNDEFINED_BEHAVIOR_SANITIZER == YES ]] && { args+=( 'is_ubsan=true' ) } -[[ $CHIP_IS_TSAN == YES ]] && { +[[ $CHIP_IS_TSAN == YES || $ENABLE_THREAD_SANITIZER == YES ]] && { args+=( 'is_tsan=true' # The system stats stuff races on the stats in various ways,