-
-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PIO compiles everything in MBED framework when RTOS is enabled #288
Comments
Related forum discussion : https://community.platformio.org/t/mbed-for-stm32-compiles-toooooo-long/9622 |
Hi @SuperBoss9 ! Thanks for reporting. I'm afraid that's default build logic for mbed framework, all suitable source files are collected based on the target configuration. Don't mbed tools (
Regarding |
Hello valeros!
PIO with VScode is a great thing but it is not usable with mbed RTOS functions due to the compilation issue. Regarding to .mbedignore it works with mbed Studio, where I can just put the file into a project root dir. In PIO I tested any projects dirs without any effect (and with any combinations of pathes). mbed ignore: Unfortunately I won't be able to provide PIO .mbedignore example until end of this week. |
Couldn't reproduce this behavior. In my case PlatformIO recompiles only changed files.
The reason why you need to specify a special flag is because we support both variations of mbed framework: I'm not familiar with
Where did you place this file? The paths are relative and we don't even have |
I've double check the behaviour at my i7:
I didn't change platformio.ini just add include of my own class to main and that caused mandatory clean build.
.mbedignore from above is from Mbed studio project where it works well. PS. I've checked mbed versions: |
That might be the case, but since the paths used are relative (not absolute), if not placed relative to the I noticed in another forum thread someone suggested that upgrading from python 2.7 to python 3 fixed what they referred to as 'random rebuilds'... maybe worth checking if that's the culprit? Maybe it was just a coincidence? |
@SuperBoss9 Could you please provide a minimal project to reproduce the spurious recompilation? |
Yes, sure It seems that I've found the exact place of the issue - adding a new class/.h via include forces recompilation of everything. Recompilation 1 Recompilation 2 Recompilation 3 No Recompilation |
I tried your project (Python 2&3) and didn't notice this issue. What is your OS, version of Python, version of PlatformIO? |
I have the same issue at at least 3 of my computers. All of them under Win10Prox64 |
Compiled your project on 2 different machines with Win10 (Python 2&3) and still can't reproduce the issue. Could you try another python version? |
I think that you need to create a fresh class after 1st build. Also will try the same at my other 2 PCs. Check Python version. |
@SuperBoss9 Thanks for the video, it helped me understand what we are talking about. So when you add new file it rebuilds the whole environment and at the moment this is expected behavior. As a workaround your can try build-cache-dir option, it should help you avoid recompilation of the entire framework. |
Thank you |
If I build my project, then click build again without changing anything that second build randomly takes either 15 seconds (OK) or 3 minutes (not OK). This can't possibly be expected behavior? Core 4.3.1, Home 3.1.1, ST STM32 6.0.0.
This is with the rtos_basic example. |
Hi @DesktopMan ! Could you please try to run |
I did a fresh Windows install and all the tools in a virtual machine to make sure the test is correct. Building the empty Mbed project twice takes 20 seconds each time, even without changes. It compiles the HAL and platform source every time. If I enable the OS with build_flags = -D PIO_FRAMEWORK_MBED_RTOS_PRESENT the initial build took 5 minutes and the next two 6 minutes, so same result there. Since this happens on a clean install and doesn't require hardware to test it should be possible to replicate. |
This issue should be reopened, since the problem is not solved by any of proposed workarounds. build_cache_dir does not help. .mbedignore could help to speed up the build as it could at least omit unused components and features (still does not help with repeatedly built components that we use and were not changed) With -D PIO_FRAMEWORK_MBED_RTOS_PRESENT every build (without any change) It takes :
The development with these timing constraints is very uneffective. |
With a big help of Valeros, I found a problem in my project. Firstly in file
This will reveal you the reason of recompile (during build). In my case it was:
There are some reasons for build action changed:
Hope this helps someone |
Hello everyone!
The problem is in mbed support in PIO. If I enable RTOS support via recommended macro then PIO recompiles everything that is in MBED framework (all features, all drives and everything). This operation takes a lot of resources even at a very powerful PC.
If PIO recompiles everything only once it is possible to survive. But it recompiles everything at the following situations:
That makes work non possible because every compilation takes from 400 (i7) sec to 20 minutes (i3).
One more thing that mbed supports called .mbedignore that can switch off non necessary features is not supported in PIO.
The text was updated successfully, but these errors were encountered: