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:
_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
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[0], sys.version_info[1])) )
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.
Windows 10 (up to date)
I don’t know the exact version of Mbed, it was packaged with PIO (version 5 at least)
New PC installation (had the same problem on the old PC)
Could you provide a remote session under tour control to debug this issue on your machine? If yes, please write directly to @valeros and he will provide further instructions.
I just noticed that I had “Platformio-ide: Use Development PIOCore” checked in my settings, and with it unchecked the problem with building has not yet reoccurred!
Unfortunately, the option is already unchecked in my settings. And I still have the problem.
@ivankravets I’m on MacOS, using the latest version PlatformIO 4.3.1 too, and all my source files are compiled every time, even when I don’t make any change in the project.
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.
I have 2 installations of PIO + VScode , on Win8 and kubuntu 19.10. Both suffering from issue. On Linux I noticed startup warning Running Visual Studio Code on Linux
… and after fixing watch limits issue gone.
I’m curious how to implement same fix on Windows.