Lib_deps pointing to github library not resolving as expected

Hi

I am trying to reference a github project in my lib_deps using the following code:

lib_deps = https://github.com/UncleRus/esp-idf-lib.git

When bulding my project, the following folder is created containing only a small subset of the github project:

image

The same happens when trying to add the library manually using pio lib install https://github.com/UncleRus/esp-idf-lib.git. The following log appears:

PS C:\Users\simon\Documents\PlatformIO\Projects\210301-193138-espidf-hello-world> pio lib install GitHub - UncleRus/esp-idf-lib: Component library for ESP32-xx and ESP8266
Library Storage: C:\Users\simon\Documents\PlatformIO\Projects\210301-193138-espidf-hello-world.pio\libdeps\esp32dev
Library Manager: Installing git+https://github.com/UncleRus/esp-idf-lib.git
git version 2.30.1.windows.1
Cloning into ‘C:\Users\simon.platformio.cache\tmp\pkg-installing-mz9ggv2l’…
remote: Enumerating objects: 629, done.
remote: Counting objects: 100% (629/629), done.
remote: Compressing objects: 100% (510/510), done.
remote: Total 629 (delta 247), reused 225 (delta 110), pack-reused 0Receiving objects: 93% (585/629)
Receiving objects: 100% (629/629), 351.49 KiB | 6.39 MiB/s, done.
Resolving deltas: 100% (247/247), done.
Library Manager: esp-idf-lib @ 0.0.0+20210302221528.sha.c742b94 has been installed!

According to the log, the latest version of the github library has been found (c742b94 at the moment of writing), however still only the files shown above appear in the libdeps folder. What am I doing wrong?

Seems like PlatformIO is searching through the downloaded content to find the first folder that looks like actual library code – and finds it in the first subfolder of the first subfolder (components → ads111x).

Bug report to Issues · platformio/platformio-core · GitHub please.

However, even if PIO would download the whole repo as normal, it wouldn’t solve your problem – libraries installed via lib_deps cannot be ESP-IDF libraries, the components folder is ignored in them (refer [suggestion] ESP-IDF component as Platformio library · Issue #479 · platformio/platform-espressif32 · GitHub).

Hm actually this may be intended – you can add a single library via lib_deps. Not a collection. Per docs a valid ESP-IDF library is a folder which has a CMakeLists.txt file. PlatformIO seems to find the first available subfolder which meets this criteria.

In that case you must refer to the docs and to an example project – you have to copy the components folder into your project to use that repo.

Thanks a lot for your help! Now this behaviour makes sense to me…