PlatformIO Community

Lib dependancies and lib_extra_dirs strange behavior

Hi guys,

I’m working on an example for the Luos_engine lib using esp32.

My dependency graph for this one is big and I have A LOT of strange things happening :

Found 17 compatible libraries
Scanning dependencies...
Dependency Graph
|-- luos_engine @ 2.5.3
|-- Gate @ 1.3.4
|   |-- luos_engine @ 2.5.3
|-- Pipe @ 1.1.5
|   |-- luos_engine @ 2.5.3
|-- ESPAsync_WiFiManager @ 1.12.2
|   |-- AsyncTCP @ 1.1.1
|   |   |-- luos_engine @ 2.5.3
|   |-- ESP Async WebServer @ 1.2.3
|   |   |-- AsyncTCP @ 1.1.1
|   |   |   |-- luos_engine @ 2.5.3
|   |   |-- luos_engine @ 2.5.3
|   |-- ESP_DoubleResetDetector @ 1.3.1
|   |   |-- LittleFS_esp32 @ 1.0.6
|   |   |   |-- luos_engine @ 2.5.3
|   |-- LittleFS_esp32 @ 1.0.6

1. Multiple luos_engine @ 2.5.3

I don’t know why but luos_engine @ 2.5.3 is on almost every dependency and sub-dependency.
Normally this lib is only used by main, Gate and Pipe. There is no #include <luos_engine.h> on any dependency of ESPAsync_WiFiManager.

If I turn off lib_ldf_mode : lib_ldf_mode =off
The dependency graph becomes clean.

Found 17 compatible libraries
Scanning dependencies...
Dependency Graph
|-- luos_engine @ 2.5.3
|-- Gate @ 1.3.4
|   |-- luos_engine @ 2.5.3
|-- Pipe @ 1.1.5
|   |-- luos_engine @ 2.5.3
|-- ESPAsync_WiFiManager @ 1.12.2
|   |-- AsyncTCP @ 1.1.1
|   |-- ESP Async WebServer @ 1.2.3
|   |   |-- AsyncTCP @ 1.1.1
|   |-- ESP_DoubleResetDetector @ 1.3.1
|   |   |-- LittleFS_esp32 @ 1.0.6
|   |-- LittleFS_esp32 @ 1.0.6

2. multiple lib compilation with different revisions

Because this example is a lib example, we use the actual lib source to compile it using :

lib_extra_dirs =
    ../../../../tool_services/
    ../../../../../

With relative lib_extra_dirs like that Gate, Pipe, and Luos_engine pre-build scripts will be executed, then another version of all those libs will be downloaded, then the news downloaded version pre-build script will be executed.
I don’t have any dependency graph at all.
After that, I don’t have any file compilation but a compilation success.

Reading CMake configuration...

Gate build configuration:
        * TinyJSON translation format selected.

Pipe build configuration:
        * WS mode selected.
        * ESP HAL selected.

Luos engine build configuration:
/Users/nicolasrabault/.platformio/penv/bin/python -m pip install pyluos --upgrade --quiet
        * Pyluos revision 2.2.3 ready.
        * ESP32 HAL selected for Luos and Robus.
        * Telemetry enabled.

Generating assembly for certificate bundle...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ off, Compatibility ~ soft
Library Manager: Installing luos_engine @ ^2.5.3
Warning! Could not find the package with 'luos_engine @ ^2.5.3' requirements for your system 'darwin_x86_64'
Library Manager: Installing Gate

[...]
Unpacking  [####################################]  100%
Library Manager: Gate@1.3.3 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing luos/luos_engine @ ^2.5.2

[...]
Unpacking  [####################################]  100%
Library Manager: luos_engine@2.5.2 has been installed!
Library Manager: Installing Pipe

[...]
Unpacking  [####################################]  100%
Library Manager: Pipe@1.1.3 has been installed!
Library Manager: Resolving dependencies...

Gate build configuration:
        * TinyJSON translation format selected.

Pipe build configuration:
        * WS mode not found. "<==== Previous revision doesn't have WS mode..."

Luos engine build configuration:
/Users/nicolasrabault/.platformio/penv/bin/python -m pip install pyluos --upgrade --quiet
        * Pyluos revision 2.2.3 ready.
        * ESP32 HAL selected for Luos and Robus.
        * Telemetry enabled.
================================================================================ [SUCCESS] Took 69.67 seconds ================================================================================

Environment    Status    Duration
-------------  --------  ------------
esp32dev       SUCCESS   00:01:09.673
================================================================================ 1 succeeded in 00:01:09.673 ================================================================================

3. Using absolute paths to make it work

To make it work, I have to set up lib_extra_dirs with absolute paths :

lib_ldf_mode =off
lib_extra_dirs =
    /Users/nicolasrabault/Projects/luos/luos_engine/tool_services
    /Users/nicolasrabault/Projects/luos/

This way, Platformio finds the good libs (but steel executes it twice) and then compiles actual files.

Reading CMake configuration...

Gate build configuration:
        * TinyJSON translation format selected.

Pipe build configuration:
        * WS mode selected.
        * ESP HAL selected.

Luos engine build configuration:
/Users/nicolasrabault/.platformio/penv/bin/python -m pip install pyluos --upgrade --quiet
        * Pyluos revision 2.2.3 ready.
        * ESP32 HAL selected for Luos and Robus.
        * Telemetry enabled.

Generating assembly for certificate bundle...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ off, Compatibility ~ soft

Gate build configuration:
        * TinyJSON translation format selected.

Pipe build configuration:
        * WS mode selected.
        * ESP HAL selected.

Luos engine build configuration:
/Users/nicolasrabault/.platformio/penv/bin/python -m pip install pyluos --upgrade --quiet
        * Pyluos revision 2.2.3 ready.
        * ESP32 HAL selected for Luos and Robus.
        * Telemetry enabled.
Found 17 compatible libraries
Scanning dependencies...
Dependency Graph
|-- luos_engine @ 2.5.3
|-- Gate @ 1.3.4
|   |-- luos_engine @ 2.5.3
|-- Pipe @ 1.1.5
|   |-- luos_engine @ 2.5.3
|-- ESPAsync_WiFiManager @ 1.12.2
|   |-- AsyncTCP @ 1.1.1
|   |-- ESP Async WebServer @ 1.2.3
|   |   |-- AsyncTCP @ 1.1.1
|   |-- ESP_DoubleResetDetector @ 1.3.1
|   |   |-- LittleFS_esp32 @ 1.0.6
|   |-- LittleFS_esp32 @ 1.0.6

[Project compilation]

Did anyone have any tips to make this compilation work as expected?

Do you use the latest version of PlatformIO Core? It was a known issue a few versions before.

I’m using Platformio Core 6.1.4b1

Please file an issue at Issues · platformio/platformio-core · GitHub and provide a simple project to reproduce it. Thanks!

1 Like