canonical / matter-pi-gpio-commander

Matter Raspberry Pi GPIO Commander - Turn your Pi into a Matter lighting device!
Apache License 2.0
90 stars 3 forks source link

SDK incompatibility with the application code #43

Closed farshidtz closed 5 months ago

farshidtz commented 5 months ago

The application code has become incompatible with the SDK some time between Jan 15 (when it was last built) and now.

The build fails with the following errors:

:: [318/602] c++ obj/third_party/connectedhomeip/src/app/clusters/scenes-server/lighting-common.scenes-server.cpp.o
:: FAILED: obj/third_party/connectedhomeip/src/app/clusters/scenes-server/lighting-common.scenes-server.cpp.o
:: aarch64-linux-gnu-g++ -MMD -MF obj/third_party/connectedhomeip/src/app/clusters/scenes-server/lighting-common.scenes-server.cpp.o.d -Wconversion -O0 -g2 -fno-common -ffunction-sections -fdata-sections -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -Wall -Werror -Wextra -Wshadow -Wunreachable-code -Wvla -Wformat -Wformat-nonliteral -Wformat-security -Wundef -Wno-deprecated-declarations -Wno-missing-field-initializers -Wno-unknown-warning-option -Wno-unused-parameter -Wno-cast-function-type -Wno-psabi -Wno-maybe-uninitialized -fdiagnostics-color -fno-strict-aliasing -fmacro-prefix-map=../../third_party/connectedhomeip/= -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -Wno-format-nonliteral -Wno-format-nonliteral -std=gnu++17 -fno-rtti -Wnon-virtual-dtor -DCHIP_HAVE_CONFIG_H=1 -DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=\<lib/address_resolve/AddressResolve_DefaultImpl.h\> -DCHIP_MINMDNS_USE_EPHEMERAL_UNICAST_PORT=1 -DCHIP_MINMDNS_HIGH_VERBOSITY=0 -DCHIP_MINMDNS_DEFAULT_POLICY=1 -I../../third_party/connectedhomeip/zzz_generated/lighting-app -Igen/third_party/connectedhomeip/examples/lighting-app/lighting-common -Igen/third_party/connectedhomeip/examples/lighting-app/lighting-common/zapgen -I../../third_party/connectedhomeip/src/include -I../../third_party/connectedhomeip/src -Igen/include -I../../third_party/connectedhomeip/zzz_generated/app-common -I../../third_party/connectedhomeip/examples/lighting-app/linux/include -I../../third_party/connectedhomeip/config/standalone -I../../third_party/connectedhomeip/third_party/nlassert/repo/include -I../../third_party/connectedhomeip/third_party/nlio/repo/include -I../../third_party/connectedhomeip/third_party/inipp/repo/inipp -I../../third_party/connectedhomeip/src/tracing/perfetto/include -I../../third_party/connectedhomeip/third_party/perfetto/repo/sdk -c ../../third_party/connectedhomeip/src/app/clusters/scenes-server/scenes-server.cpp -o obj/third_party/connectedhomeip/src/app/clusters/scenes-server/lighting-common.scenes-server.cpp.o
:: In file included from ../../third_party/connectedhomeip/src/app/clusters/scenes-server/scenes-server.cpp:19:
:: ../../third_party/connectedhomeip/src/app/clusters/scenes-server/scenes-server.h:38:9: error: ‘EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT’ was not declared in this scope; did you mean ‘EMBER_AF_SWITCH_CLUSTER_SERVER_ENDPOINT_COUNT’?
::    38 |         EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT;
::       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::       |         EMBER_AF_SWITCH_CLUSTER_SERVER_ENDPOINT_COUNT
:: ../../third_party/connectedhomeip/src/app/clusters/scenes-server/scenes-server.h:38:9: note: maximum limit of 1000 namespaces searched for ‘EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT’
:: ../../third_party/connectedhomeip/src/app/clusters/scenes-server/scenes-server.h:39:49: error: non-constant condition for static assertion
::    39 |     static_assert(kScenesServerMaxEndpointCount <= kEmberInvalidEndpointIndex, "Scenes endpoint count error");
::       |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: In file included from ../../third_party/connectedhomeip/src/app/clusters/scenes-server/scenes-server.cpp:19:
:: ../../third_party/connectedhomeip/src/app/clusters/scenes-server/scenes-server.h:69:58: error: size of array ‘mSceneInfoStructs’ is not an integral constant-expression
::    69 |         Structs::SceneInfoStruct::Type mSceneInfoStructs[kScenesServerMaxEndpointCount][kScenesServerMaxFabricCount];
::       |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: ../../third_party/connectedhomeip/src/app/clusters/scenes-server/scenes-server.h:70:40: error: size of array ‘mSceneInfoStructsCount’ is not an integral constant-expression
::    70 |         uint8_t mSceneInfoStructsCount[kScenesServerMaxEndpointCount] = { 0 };
::       |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: ../../third_party/connectedhomeip/src/app/clusters/scenes-server/scenes-server.cpp: In member function ‘CHIP_ERROR chip::app::Clusters::ScenesManagement::ScenesServer::FabricSceneInfo::FindFabricSceneInfoIndex(chip::EndpointId, size_t&)’:
:: ../../third_party/connectedhomeip/src/app/clusters/scenes-server/scenes-server.cpp:264:78: error: ‘EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT’ was not declared in this scope; did you mean ‘EMBER_AF_SWITCH_CLUSTER_SERVER_ENDPOINT_COUNT’?
::   264 |         emberAfGetClusterServerEndpointIndex(endpoint, ScenesManagement::Id, EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT);
::       |                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::       |                                                                              EMBER_AF_SWITCH_CLUSTER_SERVER_ENDPOINT_COUNT
:: ../../third_party/connectedhomeip/src/app/clusters/scenes-server/scenes-server.cpp:264:78: note: maximum limit of 1000 namespaces searched for ‘EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT’
:: At global scope:
:: cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
:: [319/602] c++ obj/BUILD_DIR/gen/third_party/connectedhomeip/examples/lighting-app/lighting-common/zapgen/zap-generated/lighting-common_zapgen.IMClusterCommandHandler.cpp.o
:: [320/602] c++ obj/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server/lighting-common.wifi-network-diagnostics-server.cpp.o
:: ninja: build stopped: subcommand failed.

Workaround:

$ git diff
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 776353f..10a3359 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -54,7 +54,7 @@ parts:
     plugin: nil
     source: https://github.com/project-chip/connectedhomeip.git
     source-depth: 1
-    source-tag: master
+    source-commit: 4676d277af113d6e07e0de235c8ca8b70237109a
     source-submodules: []
     override-pull: |
       craftctl default

Commit https://github.com/project-chip/connectedhomeip/commit/4676d277af113d6e07e0de235c8ca8b70237109a is the last one before Jan 15th, but there may be other working commits after that.

locnnil commented 5 months ago

The reason why it becomes incompatible was basically because we take the app/lighting-common/lighting-app.matter and app/lighting-common/lighting-app.zap and leave it freeze in time, meanwhile some of these configs were changed.