PlatformIO Community

6.1.0 LDF Dependencies Graph is Going Bananas

I have about 60 major private libraries that are dependent in layers. Those in turn have more libraries nested in them.

The dependency graph usually looks like:

main
|--lib 1
    |--lib 2
        |--lib 3
            | --lib 4
                 | --lib 5

The way I was doing this was main.h would #include “lib1.h”. lib1.h would #include lib2.h. On and on.

In this design, lib 1 has access to the lower levels.

Up until recently, that worked very well. Dependency graph would generate accurately in about a second.

However, (as of this morning, which I think it updated to 6.1.0 recently) now what I’m getting is that every library is linked as dependent to every library in a sort of explicit everything touches everything at every level, that is exponentially larger. It takes minutes to get through the dependency graph.

Everything ends up compiling fine, and the bin files don’t seem larger.

Below is an example of what it looks like. I think… It’s impossible to screen capture the top of it because it scrolls so fast. I have ~60 libraries so it appears to be exponentially longer.

main
|--lib 1
|   |--lib 2
|   |   |--lib 3
|   |   |   | --lib 4
|   |   |   |    |--lib 5
|   |   |-- lib 4
|   |   |   |--lib 5
|   |   |-- lib 5
|   |-- lib 3
|   |   |--lib 4
|   |   |   |-- lib 5
|   |-- lib 4
|   |   |-- lib 5
|   |-- lib 5
|--lib 2
|   |--lib 3
|   |   | --lib 4
|   |   |    |--lib 5
|   |-- lib 4
|   |   |--lib 5 
|   |-- lib 5
|-- lib 3
|   |--lib 4
|   |   |-- lib 5
|-- lib 4
|   |-- lib 5
|-- lib 5

It seems like if a library has access to another library, every library it has access to, is listed every single time.

PIO Crazy Dependency

I can confirm the cause is 6.1.0. I was able to get 6.0.2 installed via

pip install -U "platform<6.1"

Then changing the Platformio Extension Settings to a Custom install with “Platformio-ide: Custom PATH”, and turning off “Platformio-ide: Use Builtin PIOCore”

VSCode raises an error when I open it. But everything compiles quickly and the dependency graph is back to normal.

Normal Dependency Graph

My guess is whatever this Release Note is referring to, is the cause:

Fixed an issue with the LDF when recursively scanning dependencies in the chain mode

However, I have already tried all the different LDF modes, and they all do the same.

It looks like a bug. We are working on it

Great! Thank you. I see that now.

Could you re-test with pio upgrade --dev? It has been fixed in the latest development version. Thanks.