-
-
Notifications
You must be signed in to change notification settings - Fork 795
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
Implement "release" and "debug" folder per build environment #1833
Comments
Thanks for the issue! Please open PlatformIO IDE > Activity Bar (alien icon) > Updates > Upgrade PlatformIO Core. See updated docs: https://docs.platformio.org/en/latest/projectconf/section_env_general.html#targets Does it work now? |
@ivankravets no, unfortunately it didn't work for me. even if I add "targets = debug" in platform.ini, when I repeat the steps 1 to 5 I have always the same problem, it recompile ! platform.ini: [env:esp wrover kit]
platform = espressif32
framework = arduino
board = esp-wrover-kit
monitor_speed = 115200
debug_tool = ftdi
targets = debug However, I suggested that this feature to be implemented by default in the system as well as many other IDE like visual studio, eclipse etc... so that, the debug firmware is always separated from the run/release one. If this is implemented don't forget that clean project should clean all of debug and release binaries. |
I've just added a separate page with detailed explanation http://docs.platformio.org/en/latest/projectconf/build_configurations.html I checked it and it works for me. Be sure that you use PlatformIO Core 3.6.1a2 |
Ok I'll make some tests. Test A: ini file: [env:esp_wrover_kit]
platform = espressif32
framework = espidf
board = esp-wrover-kit
monitor_speed = 115200
debug_tool = ftdi
[env:debug]
platform = espressif32
framework = espidf
board = esp-wrover-kit
monitor_speed = 115200
debug_tool = ftdi
targets = debug Step 1: Build result: it compiles the two environnements at once !!
Step 2: Debug session results he recompiled esp_wrover_kit environnement and skept debug environnement
Step 3: Normal Uploading: It recompile and upload both
going to Test B: (same steps) |
Test B: I did the same test just as the example in the documentationbut same results. [env:release]
platform = espressif32
framework = espidf
board = esp-wrover-kit
monitor_speed = 115200
debug_tool = ftdi
[env:debug]
platform = espressif32
framework = espidf
board = esp-wrover-kit
monitor_speed = 115200
debug_tool = ftdi
targets = debug now Test C : I'll see platformio/platformio-docs@5fde995and do this instead [platformio]
env_default = esp wrover kit
[env:esp_wrover_kit]
platform = espressif32
framework = espidf
board = esp-wrover-kit
monitor_speed = 115200
debug_tool = ftdi
[env:debug]
platform = espressif32
framework = espidf
board = esp-wrover-kit
monitor_speed = 115200
debug_tool = ftdi
targets = debug (test takes some time with ESP-IDF) |
Test C:
Step 2: The test C fails here since it compile the release instead "esp wrover kit environnement of debug one
Step 3: Fails also since it recompiles the default environnement
|
@ivankravets I've just detected another issue while doing some tests with my STM32 board about incremental compilation. Steps to reproduce: [env:disco_l475vg_iot01a]
platform = ststm32
board = disco_l475vg_iot01a
framework = stm32cube
debug_tool = stlink
test_transport = custom |
Oh, you totally strayed me. It seems that I should revert all changes and back default debug configuration to "Debug with Pre-Debug Task". This task checks a project for changes. Previous "Debug (Skip Pre-Debug)" means that "start debugging" without project building and checking. It is super fast but a developer is responsible to rebuild project and reflash board. I'm not sure that it's good. Need to think on better solution. |
http://docs.platformio.org/en/latest/projectconf/section_env_debug.html#debug-load-mode It seems that we should CHECK project for changes for "always" and "modified" modes. The only in "manual" debug_load_mode we should not pre-process project. What do you think? Is this "Pre-Debug" task useful? I mean, when we run it firstly in Terminal, then you need back manually to debug console. |
This is what I suggested you from the beginning: to go for a simpler and better solution.
Notice that the documentation does not mention this explanation sould be added. The documentation says, that the pre-debug add a task to prompt errors in the terminal, and not skipping pre-checking ("without project building and checking")
I didn't even have a clue until today of what is pre-debug and this is why i openned a documentation issue here: platformio/platformio-docs#36 (comment)
Yes this is what it should be, with Pre-Debug by default, because the Pre-Debug always check the code if it is modified.
LoL but you're developping too fast hahaha, this was an enhancement not a bug, I though that I would take you a little bit more time to think about it and to implement. I declared this issue just one day ago.
Personnaly, I don't use this "manual" option I find it too risky and not so useful, since the rechecking files does not take too much time for me, so I let default options. In the contrary "always" and "modified" can be usefu.l The manual option can be useful just for some very particular usage. |
Thanks! I reverted back all changes and updated docs. Please run "Upgrade PlatformIO Core" again. I reopened this issue and changed a title. These changes will affect existing projects/users who depend on the current structure of build artifacts. See related issue #1778 So, after these changes, the artifacts will be located in PROJECT DIR > BUILD_DIR > ENV_NAME > RELEASE | DEBUG > ... Will that resolve this issue? |
I don't know how platformIO is functionning, but my suggestion will affect only binary .a .o and output directories which will not be harmful for the majority of users. But it can affect for example those who use automation in code generation with platformIO cli. If you fear that it will affect these users you can reserve this enhancement for a future massive release (for example 4.x) in which you will indicate how to migrate from 3.x to 4.x as you've done with 2.x.
And so that, the "clean" functionality will clean all files and directories under ENV_NAME What about test ? Will it have its own directory also ? Like this
I don't know how PlatformIO works, but I can guess that it will resolve it, and even if I will not resolve it, it will install the mechanisms to resolve it ! Because the only additionnal thing after that, is to ensure that checks for modifications are made separately and for each of debug, release and unit_test firmware. |
@ivankravets |
Duplicate of #2184 |
@ivankravets I didn't understand what happenned but the problem is still occuring in my ancient project. [env:disco_l475vg_iot01a]
platform = ststm32
board = disco_l475vg_iot01a
framework = mbed
debug_tool = stlink
build_flags = -D PIO_FRAMEWORK_MBED_RTOS_PRESENT |
|
I've already upgraded to 4.0 |
I ll do a test |
@ivankravets So after adding so how to switch easily from debug to release mode ? |
There is good docs for this case http://docs.platformio.org/en/latest/projectconf/build_configurations.html Please read. |
OK i did this, as on the documentation: [env]
platform = ststm32
board = disco_l475vg_iot01a
framework = mbed
debug_tool = stlink
build_flags = -D PIO_FRAMEWORK_MBED_RTOS_PRESENT
[env:my__release]
[env:my__debug]
build_type = debug but the result are not what I expected, the compilation take more times than before. If I click on build it will build both of my__release in release mode and my__debug in debug mode. So for any change every time we will build it will build both of them. However, if I click on pre-debug it only (incremental) builds the my__debug environnement, and ignores my__realease environnement. So what I understood is that when doing pre-debug mode, if it finds one or more "debug mode" environnement it ignores environnement in release mode isn't it ? |
You need to build As for the debugging, PlatformIO will automatically use |
Left Activity Bar > PlatformIO > Tasks > .... |
Ahh, sorry, PlatformIO IDE for VSCode currently does not support templating for A temporary solution is to do full old-style declaration:
|
OK I will retry the whole test now with this configuration. |
Look, if I click on build it still compile both of my_release and my_debug version it is unfortunate that you've abandonned the initial solution of "Implement "release" and "debug" folder per build environment" that could be simpler. |
You need to use env:my__release group... see below under Pre-Debug task |
Ok I see |
Please follow this steps:
And I think it's the same for PIO unit testing.
Suggestion:
I suggest the solution that PIO treats Debug builds, Realase builds and Unit test builds as different buids in different directories, in order to not recompiling the whole code each time. See by yourself
The text was updated successfully, but these errors were encountered: