Sync popup during build makes the build fail

Many times I run a build and it fails. I run it again and it succeeds. I noticed that the VS Code project sync dialog flashes briefly when this occurs. I think a sync during the build breaks the build. Build failure looks like:

framework-arduinoespressif32/cores/esp32/main.cpp:72:1: fatal error: opening dependency file .pio/build/master/FrameworkArduino/main.cpp.d: No such file or directory

For example, if I edit platformio.ini and press ctrl+B,enter to build, a second or so into the build the project syncs and the build fails. ctrl+B,enter again and the build succeeds.

I think a sync should be done before a build and syncing should be disallowed during a build.

In case it matters, I’m using:

lib_ldf_mode = off
lib_compat_mode = off

I’m editing my platformio.ini to add a dependency to lib_deps.

A save of the platformio.ini asynchronously triggers a reload of the project. If you’re in the middle of a build while that happens it’s kaboom.

You can try opening an issue at Issues · platformio/platformio-vscode-ide · GitHub for that.

Weird the issue tracker has a bunch of junk duplicate issues.

I added an issue: