PlatformIO Community

Build compiles all source files every time


I’m using PlatformIO IDE with the mbed framework.
Everytime I run a build command, every files get compiled, even if I change nothing. All the mbed framework is compiled everytime.
If I run two times the compile command, both will compile everything, without any editing in the meantime.

What do I miss?

My platformio.ini files look like that:

platform = ststm32
board = disco_f746ng
framework = mbed
debug_tool = stlink
debug_load_mode = always
upload_protocol = stlink
build_flags =
    -I src
    -I drivers
lib_deps =
src_filter = +<*> +<../drivers>

Thanks for your help

By looking at the Debug Console, I found the following error:

*** [.pio/build/disco_f746ng/FrameworkMbed/targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_cryp_ex.o] /Users/username/src/projectname/gsboard-v2/.pio/build/disco_f746ng/FrameworkMbed/targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_cryp_ex.o: No such file or directory
FileNotFoundError: [Errno 2] No such file or directory: '/Users/username/src/projectname/gsboard-v2/.pio/build/disco_f746ng/.sconsign.py37.dblite':
  File "/Users/username/.platformio/packages/tool-scons/script/../engine/SCons/Script/", line 1374:
    _exec_main(parser, values)

And that could refer to this anomaly, as my project is quite big:

But I don’t know how to apply this config to platformIo

So I found the file I needed to modify.

I modified the line 144 of the file .platformio/penv/lib/python3.7/site-packages/platformio/builder/
And I replaced:
env.SConsignFile( join("$BUILD_DIR", "" % (sys.version_info[0], sys.version_info[1])) )
env.SConsignFile( join("$BUILD_DIR", ".sconsign.dblite") )

And now it’s working.
I think this is a bug because the mbed framework contains many many files.

Please post this exact thing to as the file originates from there (source ), and @ivankravets can have a look at it :slight_smile: