Name conflicts between user and esp-idf components

Xavi92
Posts: 45
Joined: Thu Mar 28, 2019 2:26 pm

Name conflicts between user and esp-idf components

Postby Xavi92 » Tue Apr 14, 2020 9:06 am

As of esp-idf v4.1, the idf_component_register macro is one of the preferred ways to register components into CMakeLists.txt. However, if folder name matches between a user and an esp-idf component (common names e.g.: "log" or "bt"), CMake chooses the first folder it finds and adds it to the include directory list, ignoring the other.

Is there any solution to this problem, other than renaming the user component? Are namespaces possible on the esp-idf build system?

Thank you very much,
Xavi

Xavi92
Posts: 45
Joined: Thu Mar 28, 2019 2:26 pm

Re: Name conflicts between user and esp-idf components

Postby Xavi92 » Mon Apr 20, 2020 7:14 am

From esp-idf build system documentation:
If two or more of these directories contain component sub-directories with the same name, the component in the last place searched is used. This allows, for example, overriding ESP-IDF components with a modified version by copying that component from the ESP-IDF components directory to the project components directory and then modifying it there. If used in this way, the ESP-IDF directory itself can remain untouched.
Does that mean it is not possible to have two components with the same name, one on esp-idf and one on the project, but different purposes by design?

ESP_Sprite
Posts: 9025
Joined: Thu Nov 26, 2015 4:08 am

Re: Name conflicts between user and esp-idf components

Postby ESP_Sprite » Mon Apr 20, 2020 2:59 pm

Sorry for not seeing this earlier. Yes, this is true and by design.

Xavi92
Posts: 45
Joined: Thu Mar 28, 2019 2:26 pm

Re: Name conflicts between user and esp-idf components

Postby Xavi92 » Tue Apr 21, 2020 7:40 am

Thanks, Sprite! Then we will rename our components to something else.

Who is online

Users browsing this forum: Google [Bot] and 86 guests