From f04c4284df31f77b513b375f4be9247ef49601ec Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 20 Oct 2021 12:58:43 -0400 Subject: [PATCH] Fix platform build race - platform builds include app/AttributeAccessInterface.h (#10659) * Add dependency to app buildconfig into platform. Without it, I see builds failing with: ``` g++ -MMD -MF standalone/obj/src/lib/dnssd/dnssd.Discovery_ImplPlatform.cpp.o.d -target x86_64-apple-macos10.15 -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 -Wno-deprecated-declarations -Wno-unknown-warning-option -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wno-cast-function-type -fdiagnostics-color -fno-strict-aliasing -I/usr/local/Cellar/openssl@1.1/1.1.1l_1/include -fobjc-arc -std=gnu++14 -fno-rtti -Wnon-virtual-dtor -DCHIP_HAVE_CONFIG_H=1 -I../../src/include -I../../src -Istandalone/gen/include -I../../zzz_generated/app-common -I../../config/standalone -I../../third_party/nlassert/repo/include -I../../third_party/nlio/repo/include -c ../../src/lib/dnssd/Discovery_ImplPlatform.cpp -o standalone/obj/src/lib/dnssd/dnssd.Discovery_ImplPlatform.cpp.o 551 In file included from ../../src/lib/dnssd/Discovery_ImplPlatform.cpp:34: 552 In file included from ../../src/include/platform/CHIPDeviceLayer.h:29: 553 In file included from ../../src/include/platform/ConnectivityManager.h:27: 554 In file included from ../../src/app/AttributeAccessInterface.h:22: 555 In file included from ../../src/app/MessageDef/AttributeDataElement.h:26: 556 ../../src/app/MessageDef/AttributePath.h:29:10: fatal error: 'app/AppBuildConfig.h' file not found 557 ``` * Fix typo in path * Also add dependency from Darwin platform to avoid: ``` g++ -MMD -MF obj/third_party/connectedhomeip/src/platform/Darwin/Darwin.PosixConfig.cpp.o.d -target x86_64-apple-macos10.15 -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 -Wno-deprecated-declarations -Wno-unknown-warning-option -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wno-cast-function-type -fdiagnostics-color -fno-strict-aliasing -fsanitize=thread -fobjc-arc -I/usr/local/Cellar/openssl@1.1/1.1.1l_1/include -std=gnu++14 -fno-rtti -Wnon-virtual-dtor -DCHIP_HAVE_CONFIG_H=1 -I../../../examples/all-clusters-app/linux/third_party/connectedhomeip/src/include -I../../../examples/all-clusters-app/linux/third_party/connectedhomeip/src -Igen/include -I../../../examples/all-clusters-app/linux/third_party/connectedhomeip/zzz_generated/app-common -I../../../examples/all-clusters-app/linux/third_party/connectedhomeip/config/standalone -I../../../examples/all-clusters-app/linux/third_party/connectedhomeip/third_party/nlassert/repo/include -I../../../examples/all-clusters-app/linux/third_party/connectedhomeip/third_party/nlio/repo/include -c ../../../examples/all-clusters-app/linux/third_party/connectedhomeip/src/platform/Darwin/PosixConfig.cpp -o obj/third_party/connectedhomeip/src/platform/Darwin/Darwin.PosixConfig.cpp.o 245 In file included from ../../../examples/all-clusters-app/linux/third_party/connectedhomeip/src/platform/Darwin/PosixConfig.cpp:27: 246 In file included from ../../../examples/all-clusters-app/linux/third_party/connectedhomeip/src/include/platform/internal/CHIPDeviceLayerInternal.h:22: 247 In file included from ../../../examples/all-clusters-app/linux/third_party/connectedhomeip/src/include/platform/CHIPDeviceLayer.h:29: 248 In file included from ../../../examples/all-clusters-app/linux/third_party/connectedhomeip/src/include/platform/ConnectivityManager.h:27: 249 In file included from ../../../examples/all-clusters-app/linux/third_party/connectedhomeip/src/app/AttributeAccessInterface.h:22: 250 In file included from ../../../examples/all-clusters-app/linux/third_party/connectedhomeip/src/app/MessageDef/AttributeDataElement.h:26: 251 ../../../examples/all-clusters-app/linux/third_party/connectedhomeip/src/app/MessageDef/AttributePath.h:29:10: fatal error: 'app/AppBuildConfig.h' file not found 252 ``` --- src/platform/BUILD.gn | 1 + src/platform/Darwin/BUILD.gn | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 50eb6cdd7d089c..b24f05cf39bb91 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -294,6 +294,7 @@ if (chip_device_platform != "none") { public_deps = [ ":platform_base", + "${chip_root}/src/app:app_buildconfig", "${chip_root}/src/crypto", "${chip_root}/src/lib/support", ] diff --git a/src/platform/Darwin/BUILD.gn b/src/platform/Darwin/BUILD.gn index b5cd1b1d9f0644..d54717826a997e 100644 --- a/src/platform/Darwin/BUILD.gn +++ b/src/platform/Darwin/BUILD.gn @@ -66,7 +66,10 @@ static_library("Darwin") { "${chip_root}/src/setup_payload", ] - public_deps = [ "${chip_root}/src/platform:platform_base" ] + public_deps = [ + "${chip_root}/src/app:app_buildconfig", + "${chip_root}/src/platform:platform_base", + ] public_configs = [ ":darwin_config" ]