From 35b5ce36f051b11dd13767bab4b5c5db6f23fd8f Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Wed, 16 Jun 2021 10:05:06 -0400 Subject: [PATCH] Fix path conflicts in chip_data_model in some projects (#7590) The chip_data_model template builds a library that contains 2 files named encoder.cpp and two files name attribute-size.cpp. While this is not a problem with pigweed's toolchain definitions because different directories are used, it can cause a path conflict if a project defines a toolchain that places all of a library's .o files in the same directory: ERROR at //third_party/connectedhomeip/repo/src/app/chip_data_model.gni:59:3: Duplicate object file source_set(_data_model_name) { ^----------------------------- The target //third_party/connectedhomeip/repo/src/controller/data_model:data_model generates two object files with the same name: obj/third_party/connectedhomeip/repo/src/controller/data_model/data_model/attribute-size.o Rename some files so that all files in the same library have distinct filenames, which should be compatible with most reasonable toolchain definitions. Change-Id: I75f755cd4231563a57eca1e5286527c9ea88149e --- examples/lighting-app/nrfconnect/CMakeLists.txt | 2 +- examples/lighting-app/telink/CMakeLists.txt | 2 +- examples/lock-app/nrfconnect/CMakeLists.txt | 2 +- examples/pump-app/nrfconnect/CMakeLists.txt | 2 +- examples/pump-controller-app/nrfconnect/CMakeLists.txt | 2 +- src/app/BUILD.gn | 2 +- src/app/chip_data_model.gni | 4 ++-- src/app/{encoder.cpp => encoder-common.cpp} | 0 src/app/util/{attribute-size.cpp => attribute-size-util.cpp} | 0 src/darwin/Framework/CHIP.xcodeproj/project.pbxproj | 2 +- 10 files changed, 9 insertions(+), 9 deletions(-) rename src/app/{encoder.cpp => encoder-common.cpp} (100%) rename src/app/util/{attribute-size.cpp => attribute-size-util.cpp} (100%) diff --git a/examples/lighting-app/nrfconnect/CMakeLists.txt b/examples/lighting-app/nrfconnect/CMakeLists.txt index 6ce4b8c9028e41..bb98ad9d4492c2 100644 --- a/examples/lighting-app/nrfconnect/CMakeLists.txt +++ b/examples/lighting-app/nrfconnect/CMakeLists.txt @@ -62,7 +62,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/util/af-event.cpp ${CHIP_ROOT}/src/app/util/af-main-common.cpp ${CHIP_ROOT}/src/app/util/attribute-list-byte-span.cpp - ${CHIP_ROOT}/src/app/util/attribute-size.cpp + ${CHIP_ROOT}/src/app/util/attribute-size-util.cpp ${CHIP_ROOT}/src/app/util/attribute-storage.cpp ${CHIP_ROOT}/src/app/util/attribute-table.cpp ${CHIP_ROOT}/src/app/util/binding-table.cpp diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 9cdbc8b64fcfa7..219eab853add8f 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -56,7 +56,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/util/af-event.cpp ${CHIP_ROOT}/src/app/util/af-main-common.cpp ${CHIP_ROOT}/src/app/util/attribute-list-byte-span.cpp - ${CHIP_ROOT}/src/app/util/attribute-size.cpp + ${CHIP_ROOT}/src/app/util/attribute-size-util.cpp ${CHIP_ROOT}/src/app/util/attribute-storage.cpp ${CHIP_ROOT}/src/app/util/attribute-table.cpp ${CHIP_ROOT}/src/app/util/binding-table.cpp diff --git a/examples/lock-app/nrfconnect/CMakeLists.txt b/examples/lock-app/nrfconnect/CMakeLists.txt index 13cbc7ef2e4278..3c73f243f59b7a 100644 --- a/examples/lock-app/nrfconnect/CMakeLists.txt +++ b/examples/lock-app/nrfconnect/CMakeLists.txt @@ -62,7 +62,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/util/af-event.cpp ${CHIP_ROOT}/src/app/util/af-main-common.cpp ${CHIP_ROOT}/src/app/util/attribute-list-byte-span.cpp - ${CHIP_ROOT}/src/app/util/attribute-size.cpp + ${CHIP_ROOT}/src/app/util/attribute-size-util.cpp ${CHIP_ROOT}/src/app/util/attribute-storage.cpp ${CHIP_ROOT}/src/app/util/attribute-table.cpp ${CHIP_ROOT}/src/app/util/binding-table.cpp diff --git a/examples/pump-app/nrfconnect/CMakeLists.txt b/examples/pump-app/nrfconnect/CMakeLists.txt index 08a7630531cf05..ccfeebd47f19f8 100644 --- a/examples/pump-app/nrfconnect/CMakeLists.txt +++ b/examples/pump-app/nrfconnect/CMakeLists.txt @@ -55,7 +55,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/util/af-event.cpp ${CHIP_ROOT}/src/app/util/af-main-common.cpp ${CHIP_ROOT}/src/app/util/attribute-list-byte-span.cpp - ${CHIP_ROOT}/src/app/util/attribute-size.cpp + ${CHIP_ROOT}/src/app/util/attribute-size-util.cpp ${CHIP_ROOT}/src/app/util/attribute-storage.cpp ${CHIP_ROOT}/src/app/util/attribute-table.cpp ${CHIP_ROOT}/src/app/util/binding-table.cpp diff --git a/examples/pump-controller-app/nrfconnect/CMakeLists.txt b/examples/pump-controller-app/nrfconnect/CMakeLists.txt index a25cf25fe52b14..ebc3d83c988860 100644 --- a/examples/pump-controller-app/nrfconnect/CMakeLists.txt +++ b/examples/pump-controller-app/nrfconnect/CMakeLists.txt @@ -55,7 +55,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/util/af-event.cpp ${CHIP_ROOT}/src/app/util/af-main-common.cpp ${CHIP_ROOT}/src/app/util/attribute-list-byte-span.cpp - ${CHIP_ROOT}/src/app/util/attribute-size.cpp + ${CHIP_ROOT}/src/app/util/attribute-size-util.cpp ${CHIP_ROOT}/src/app/util/attribute-storage.cpp ${CHIP_ROOT}/src/app/util/attribute-table.cpp ${CHIP_ROOT}/src/app/util/binding-table.cpp diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index 0952ff7ec5402b..199c996a73850a 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -91,7 +91,7 @@ static_library("app") { "ReadClient.cpp", "ReadHandler.cpp", "decoder.cpp", - "encoder.cpp", + "encoder-common.cpp", "reporting/Engine.cpp", "reporting/Engine.h", ] diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index a15483cf1b79f7..d35a180ef8845a 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -93,7 +93,7 @@ template("chip_data_model") { "${_app_root}/clusters/zll-level-control-server/zll-level-control-server.h", "${_app_root}/clusters/zll-on-off-server/zll-on-off-server.h", "${_app_root}/clusters/zll-scenes-server/zll-scenes-server.h", - "${_app_root}/encoder.cpp", + "${_app_root}/encoder-common.cpp", "${_app_root}/reporting/reporting-default-configuration.cpp", "${_app_root}/reporting/reporting-tokens.h", "${_app_root}/reporting/reporting.cpp", @@ -102,7 +102,7 @@ template("chip_data_model") { "${_app_root}/util/af-event.cpp", "${_app_root}/util/af-main-common.cpp", "${_app_root}/util/attribute-list-byte-span.cpp", - "${_app_root}/util/attribute-size.cpp", + "${_app_root}/util/attribute-size-util.cpp", "${_app_root}/util/attribute-storage.cpp", "${_app_root}/util/attribute-table.cpp", "${_app_root}/util/binding-table.cpp", diff --git a/src/app/encoder.cpp b/src/app/encoder-common.cpp similarity index 100% rename from src/app/encoder.cpp rename to src/app/encoder-common.cpp diff --git a/src/app/util/attribute-size.cpp b/src/app/util/attribute-size-util.cpp similarity index 100% rename from src/app/util/attribute-size.cpp rename to src/app/util/attribute-size-util.cpp diff --git a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj index b947b93ee5bcd2..ba634a4287e58a 100644 --- a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj @@ -98,7 +98,7 @@ 1E85731C26551A490050A4D9 /* DataModelHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataModelHandler.cpp; path = ../../../app/util/DataModelHandler.cpp; sourceTree = ""; }; 1E85731D26551A490050A4D9 /* util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = util.cpp; path = ../../../app/util/util.cpp; sourceTree = ""; }; 1E85731E26551A490050A4D9 /* ember-print.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "ember-print.cpp"; path = "../../../app/util/ember-print.cpp"; sourceTree = ""; }; - 1E85731F26551A490050A4D9 /* attribute-size.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "attribute-size.cpp"; path = "../../../app/util/attribute-size.cpp"; sourceTree = ""; }; + 1E85731F26551A490050A4D9 /* attribute-size.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "attribute-size-util.cpp"; path = "../../../app/util/attribute-size-util.cpp"; sourceTree = ""; }; 1E85732026551A490050A4D9 /* process-cluster-message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "process-cluster-message.cpp"; path = "../../../app/util/process-cluster-message.cpp"; sourceTree = ""; }; 1E85732126551A490050A4D9 /* chip-message-send.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "chip-message-send.cpp"; path = "../../../app/util/chip-message-send.cpp"; sourceTree = ""; }; 1E85733226551A700050A4D9 /* reporting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = reporting.cpp; path = ../../../app/reporting/reporting.cpp; sourceTree = ""; };