Potential Bug? PlatformIO triggers a full build when using dynamic flags


I’m using PlatformIO 5.2.2 to build an ESP8266 project.
Using dynamic flags in platformio.ini, example:

build_flags = !echo -Wno-deprecated-declarations -D_BUILD_VERSION=$(git describe --dirty --always --tags --long) -D_BUILD_ISO=$(date +"%%Y-%%m-%%d_%%H-%%M-%%S")

… triggers a full build the next time (expected, because I’ve changed platformio.ini), but also every single time onwards, even when nothing has changed.

The behaviour stands until I change platformio.ini removing the dynamic flags, e.g.

build_flags = -Wno-deprecated-declarations -D_BUILD_VERSION=1 -D_BUILD_ISO=1

Is this the expected behaviour? If not: can you point me to the bug reporting guidelines? I’m not sure if this should be reported at GitHub - platformio/platformio-vscode-ide: PlatformIO IDE for VSCode: The next generation integrated development environment for IoT or GitHub - platformio/platformio-core: A professional collaborative platform for embedded development.



Pretty sure with this dynamic call into date that has a second modifier that macro changes upon every build, which always takes at least a second. PlatformIO is correct to do a full rebuild.

1 Like