Title: platformio.ini advanced build configurations are not yet compatible with PlatformIO/SCons flag workflows
Summary
fbuild advertises compatibility with platformio.ini, but today that compatibility is mostly limited to flat config values like build_flags / build_src_flags and environment inheritance. Standard PlatformIO patterns for advanced build configurations are not modeled yet, so a project that uses normal PlatformIO debug/custom build techniques can silently build with different semantics under fbuild.
What this means in practice
A lot of PlatformIO projects define advanced build flavors by combining:
build_type = debug|release|test
debug_build_flags
build_unflags
extra_scripts that mutate SCons construction variables such as CPPDEFINES, CCFLAGS, CXXFLAGS, LINKFLAGS, or CPPPATH
That is the standard PlatformIO/SCons workflow for �advanced build types�: the INI selects the build flavor, and either declarative keys or SCons script hooks add/remove the actual compiler/linker flags.
Right now fbuild does not appear to implement that model. It reads ordinary build_flags / build_src_flags, has its own internal BuildProfile abstraction (release vs quick), and supports one-off caller-injected flags, but it does not map the PlatformIO build-type layer onto those internal profiles.
Repo evidence
PlatformIOConfig::get_build_flags() only reads build_flags, and get_build_src_flags() only reads build_src_flags: crates/fbuild-config/src/ini_parser.rs:123-143
BuildContext::new() only collects build_flags and build_src_flags before build orchestration: crates/fbuild-build/src/pipeline.rs:106-111
- Build orchestration has an internal profile system (
release, quick) rather than a platformio.ini-driven build_type model: crates/fbuild-build/src/compiler.rs:24-29, crates/fbuild-build/src/lib.rs:138-166
PLATFORMIO_BUILD_UNFLAGS is listed as a supported env override and has an accessor, but I could not find any point where it is applied to the effective flag set: crates/fbuild-config/src/pio_env.rs:15-21, crates/fbuild-config/src/pio_env.rs:111-121
PLATFORMIO_EXTRA_SCRIPTS is explicitly recognized as warn-only / no-op today: crates/fbuild-config/src/pio_env.rs:43-59
- I could not find any repo references to
build_type or debug_build_flags
Expected behavior
At minimum, fbuild should not silently accept a platformio.ini that depends on PlatformIO advanced build-type mechanics while producing a materially different build.
Preferred direction:
- Parse and honor
build_type, debug_build_flags, and build_unflags from platformio.ini
- Define a compatibility mapping from PlatformIO build types to fbuild build profiles, including a real debug-oriented path rather than only
release / quick
- Apply
build_unflags against framework/toolchain/default/user flags in the same stage where the final effective flag set is assembled
- Detect
extra_scripts / SCons flag mutation patterns and either:
- support a constrained compatibility subset, or
- fail fast with a clear diagnostic that advanced scripting is not yet supported
- Add tests with representative fixtures for:
- a plain
build_type = debug environment
- a
build_unflags override (for example removing a default -std= or warning flag)
- a project that depends on
extra_scripts to mutate CPPDEFINES / CCFLAGS / LINKFLAGS
Why this matters
Without this, �compatible with platformio.ini� is true for basic environments but not for a common class of real-world PlatformIO projects. Those projects often rely on advanced build types specifically to control optimization/debug info, remove framework defaults, or inject profile-specific compile/link behavior. If fbuild ignores that layer, migration can succeed syntactically while diverging semantically.
PlatformIO references
Title: platformio.ini advanced build configurations are not yet compatible with PlatformIO/SCons flag workflows
Summary
fbuild advertises compatibility with
platformio.ini, but today that compatibility is mostly limited to flat config values likebuild_flags/build_src_flagsand environment inheritance. Standard PlatformIO patterns for advanced build configurations are not modeled yet, so a project that uses normal PlatformIO debug/custom build techniques can silently build with different semantics under fbuild.What this means in practice
A lot of PlatformIO projects define advanced build flavors by combining:
build_type = debug|release|testdebug_build_flagsbuild_unflagsextra_scriptsthat mutate SCons construction variables such asCPPDEFINES,CCFLAGS,CXXFLAGS,LINKFLAGS, orCPPPATHThat is the standard PlatformIO/SCons workflow for �advanced build types�: the INI selects the build flavor, and either declarative keys or SCons script hooks add/remove the actual compiler/linker flags.
Right now fbuild does not appear to implement that model. It reads ordinary
build_flags/build_src_flags, has its own internalBuildProfileabstraction (releasevsquick), and supports one-off caller-injected flags, but it does not map the PlatformIO build-type layer onto those internal profiles.Repo evidence
PlatformIOConfig::get_build_flags()only readsbuild_flags, andget_build_src_flags()only readsbuild_src_flags:crates/fbuild-config/src/ini_parser.rs:123-143BuildContext::new()only collectsbuild_flagsandbuild_src_flagsbefore build orchestration:crates/fbuild-build/src/pipeline.rs:106-111release,quick) rather than aplatformio.ini-drivenbuild_typemodel:crates/fbuild-build/src/compiler.rs:24-29,crates/fbuild-build/src/lib.rs:138-166PLATFORMIO_BUILD_UNFLAGSis listed as a supported env override and has an accessor, but I could not find any point where it is applied to the effective flag set:crates/fbuild-config/src/pio_env.rs:15-21,crates/fbuild-config/src/pio_env.rs:111-121PLATFORMIO_EXTRA_SCRIPTSis explicitly recognized as warn-only / no-op today:crates/fbuild-config/src/pio_env.rs:43-59build_typeordebug_build_flagsExpected behavior
At minimum, fbuild should not silently accept a
platformio.inithat depends on PlatformIO advanced build-type mechanics while producing a materially different build.Preferred direction:
build_type,debug_build_flags, andbuild_unflagsfromplatformio.inirelease/quickbuild_unflagsagainst framework/toolchain/default/user flags in the same stage where the final effective flag set is assembledextra_scripts/ SCons flag mutation patterns and either:build_type = debugenvironmentbuild_unflagsoverride (for example removing a default-std=or warning flag)extra_scriptsto mutateCPPDEFINES/CCFLAGS/LINKFLAGSWhy this matters
Without this, �compatible with platformio.ini� is true for basic environments but not for a common class of real-world PlatformIO projects. Those projects often rely on advanced build types specifically to control optimization/debug info, remove framework defaults, or inject profile-specific compile/link behavior. If fbuild ignores that layer, migration can succeed syntactically while diverging semantically.
PlatformIO references
build_type,debug_build_flags): https://docs.platformio.org/en/stable/projectconf/build_configurations.htmlbuild_flagsSCons scopes and dynamic flags: https://docs.platformio.org/en/stable/projectconf/sections/env/options/build/build_flags.htmlSection [env]includesbuild_type,build_flags,build_src_flags,build_unflags,build_src_filter: https://docs.platformio.org/en/latest/projectconf/sections/env/index.htmlextra_scriptsmutatingenvandprojenv: https://docs.platformio.org/en/latest/scripting/construction_environments.html