-
-
Notifications
You must be signed in to change notification settings - Fork 827
Description
I'm on PlatformIO 6.1.18 on Linux, latest version at the time. This is a bug report.
When using -U in build_flags and running a build with --verbose, they're shown in the opening line:
Processing WHY2025_badge_companion_radio_ble (extends: WHY2025_badge; build_flags: -w [...] -D LORA_TX_POWER=27, -U LORA_TX_POWER, -D MAX_CONTACTS=100, [...])
but when gcc is being called, only -U is given to gcc (which incidentally also breaks my build):
[...] -DARDUINO_PARTITION_default_8MB -U -I.pio/libdeps/WHY2025_badge_companion_rad[...]
I confirmed this by sneaking in some print debugging to platformio/builder/tools/piobuild.py
's ProcessFlags
:
]
print("undefines found", undefines)
if undefines:
outputs:
undefines found ['-U']
Removing the space workarounds the issue, but including a space is in the default examples of both gcc and platformio, so I think it's confusing:
- https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html
- https://docs.platformio.org/en/stable/projectconf/sections/env/options/build/build_flags.html
I think this is something that is also a problem for other flags normally, but ParseFlagsExtended
explicitly fixes it for those classified as CPPDEFINES
through use of functions like Util.is_Sequence
.
I think scons.ParseFlags does not explicitly support -U
(like it does -D
) and as such is falling back to CCFLAGS
for it, the corrective code on ParseFlagsExtended
for CPPDEFINES
isn't fixing it. Could be escalated to scons, or could be solved in ParseFlagsExtended
the same way CPPDEFINES
are fixed.