Repository navigation
Description
Configuration
Operating system:
Windows 11
PlatformIO Version (platformio --version):
6.1.6
Description of the problem
Debug console uses an environment from default_envs rather than one containing build_type = debug and the whole thing builds twice
Steps to Reproduce
- Clone https://github.com/dzid26/StepperServoCAN/tree/40397a218978ff0f77b2964e72a9b1478b8d6af4/firmware
- Replace
platformio.iniwith the one provided here Debugger does not honor selected environment #4098 (comment) - Environment switcher is set to Default (Auto).
- Run debug (F5)
Actual Results
Terminal builds ServoCAN_debug env.
Debug console clears build folder and build ServoCAN env
Expected Results
Both terminal and debug console should build ServoCAN_debug env when debugging is run because ServoCAN_debug contains build_type = debug directive.
If problems with PlatformIO Build System:
Additional info
If I change the default env on the toolbar or modify "projectEnvName": to "ServoCAN_debug" manually then both terminal and debug_console build the same thing.
I used Python debugger to figure out what was going on.
So far I noticed that the terminal uses the following to determine the environment name,
platformio-core/platformio/debug/helpers.py
Lines 68 to 74 in 58a1d5d
| for env in default_envs: | |
| if config.get("env:" + env, "build_type") == "debug": | |
| return env | |
| for env in all_envs: | |
| if config.get("env:" + env, "build_type") == "debug": | |
| return env | |
| return default_envs[0] if default_envs else all_envs[0] |
while Debug console uses
platformio-core/platformio/run/cli.py
Lines 137 to 138 in 58a1d5d
| environment and env not in environment, | |
| not environment and default_envs and env not in default_envs, |
I think both should use the same determination logic.
Activity
ivankravets commentedon Apr 12, 2023
Thanks for the report. Please re-test with
pio upgrade --dev.Resolved an issue where the incorrect debugging environment was gener…