After yesterday's PlatformIO update, ESP-IDF projects compile very slowly

Yesterday and today PlatformIO was updated on three computers. On one, everything is fine, everything works as before.
But on two - compilation became terribly, terribly slow, for the same project.
The process first gets stuck on “Reading CMake configuration…”, hangs for several minutes, then displays a dependency tree, hangs even longer, and only after a long pause does the normal build begin.
I tried to remove and reinstall everything - platforms, libraries and pio itself. What’s most interesting is that on the last computer at work there is no such slowdown.

[SUCCESS] Took 729.51 seconds, Karl!

Usually this project is assembled in a minute or two maximum

@valeros, do we have a compilation degradation between PlatormIO Core 6.1.13 and 6.1.14?

Probably. I can only associate this with this transition. Now even PIO: Loading tasks takes much longer to complete.
Can I somehow rollback Core to check?

Sorry, I realized that the question was not addressed to me

Yes, you can revert to the 6.1.13. Please open the PlatformIO Core CLI and type

python -m pip install "platformio==6.1.13"

Did it improve the situation?

PS C:\Projects\PlatformIO\village_greenhouse> python -m pip install “platformio==6.1.13”
C:\Users\kotyara12.platformio\python3\python.exe: No module named pip

Hi @kotyara12, is your project publicly available? I’ll need it to reproduce the issue.

I think I understand the source of the problem. The problem is on projects that use esp_modbus. I still can’t understand why, but I’m figuring it out. On those projects where rs485 was not used, everything is fine.

This doesn’t seem to be related to platformio.
I apologize for the false alarm and concern. I needed to check out another project before writing.

1 Like

Eat. This is also where compilation slows down: GitHub - kotyara12/telemeter_dzen: Термостат + охранно-пожарная сигнализация

Good afternoon I’m sorry, I’m bringing up the same topic.

I noticed here that if there are less than ~30 libraries in a project (32???), then the project is assembled quite quickly.
If there are more of them (and in some I have 40 or more), then it gets stuck in the process of checking dependencies, as I described above.

Could this be due to some kind of buffering during compilation?

Hi @kotyara12, sorry for the late reply. I was able to reproduce the issue and it seems that PlatformIO LDF in the "+" mode is not able to process all your libraries in reasonable time. The issue is not ESP-IDF specific, the same behavior is reproducible with other frameworks. In a nutshell, the latest PlatformIO release brought a new version of the underlying build system which in turn contained some changes related to the C/C++ preprocessing we use for finding dependencies. As a workaround, I can recommend two options: You can restructure your project so that it works with default LDF in chain mode or you can explicitly declare your dependencies in lib_deps option (In this case the internal dependecies for each library should also be declared in manifest.json files.)

Thank you! The proposed solution (replacing chain+ with chain) really helped. In addition, the fact that you have reproduced the problem inspires optimism that it will be fixed. Thank you again