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.
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/Main.py", line 1374:
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
Please check that you use THE SAME Python interpreter for IDE and CLI. If you are on Windows, remove multiple Pythons from a system and use the latest Python 3.7. See instruction Redirecting...
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/main.py
And I replaced: env.SConsignFile( join("$BUILD_DIR", ".sconsign.py%d%d" % (sys.version_info, sys.version_info)) )
by 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.
@ivankravetsprint(sys.version) gives 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit (AMD64)]
But I am not seeing the same error, the system was creating a file .sconsign.py37.dblite, no obvious error message
Why do you need a fix by @nmathon? If you see the same Python every build you should not have any problems. Please try again to repeat multiple times build process and check print(sys.version). Do yo use PlatformIO IDE for VSCode? Maybe, it uses different Python that you use in CLI.
Sorry, we don’t have more ideas how to reproduce this issue on our testing machines. We would be thankful if someone can provide as a remote session under your control where we can debug this issue on your machine. We can use for this non-commercial purpose https://anydesk.com.
If someone willing to help us, please contact me privately here in on the forum via private message @ivankravets.