Is it possible to run the dependency finder in silent mode?

I have a quite complicated project structure with several libraries that reference each other. Also, because of technical reasons, I neeed to run the dependency finder with lib_ldf_mode = deep+.
The result is that the output of LDF is extremely long, it needs 40+ seconds to scroll through the window. This is 70% of the full build time, and of course 99% of a differential build time.

I would like to run the LDF without visible output if possible. I expect that it would be ready in a few seconds. Is this possible?

Csaba

Maybe it’s just that the rendering in the terminal in VSCode is slow? Can you add PIO to your PATH so that it’s invocable in a normal shell / cmd.exe (docs) and run pio run there? Is building now significantly faster?

Yes, sure, it is waay faster.
It also gets faster when I make the build window very short so that only a few lines are visible…

Maybe you can try different render settings in VSCode? Terminal canvas renderer can be slow sometimes · Issue #72538 · microsoft/vscode · GitHub

Thanks, it really helps to speed up the build.

Nevertheless, I would suggest to add a silent option to the LDF. Over 2600 lines of unnecessary dependency graph makes it harder to see the important things. At least my output is such long.

Are pretty much all libraries cyclic regarding their dependencies? The graph repeats over and over again? Maybe a max-depth option or check-if-whole-cycle repeats thing would be good here?

You can post feature requests for silent-running or improving the LDF in these cases to to Issues · platformio/platformio-core · GitHub with maybe some info how the graph looks.

Actually, I could not analyze it before, because I could not find the setting to increase the terminal history…

For me it is strange that it handles the dependencies on the library level instead of on the include file level. This way, if a library has a unit test in the same folder that needs some infrastructure, its whole dependency gets added to the other ones depending on this library.

It was the library unit tests that also made it necessary to use deep+. I am somewhat reluctant to move the unit tests away from the libraries, but maybe I will need to.

For such cases you open a PIO CLI and use powershell commands to execute pio run and save everything to a file, with pio run 2>&1 >> pio_buid_log.txt. (2>&1 redirects stderr to stdout so that both are captured in the file).

As a follow-up:

In most cases the terminal output is fast enough, but sometimes terribly slow. When it is slow, it can be solved by making the terminal window only a few lines high. Seems to be a VSCode bug that is hard to catch.

In the meantime I managed to split some of my more complicated libraries in 2-3 parts in order to eliminate unwanted dependency transitivity. This helped a lot.