You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(build): escaped quotes in build_flags defines are mangled before reaching gcc (ESP32 sketch compile) #947
NightDriverStrip env:demo sets build_src_flags = ... -DPROJECT_NAME="\"Demo\"" (standard PlatformIO idiom for a string-valued define — SCons passes flags through a shell layer, so gcc receives the argv element -DPROJECT_NAME="Demo").
Under fbuild (Rust, ESP32 orchestrator, compile-sketch phase), every use of PROJECT_NAME fails with:
<command-line>: error: unable to find string literal operator 'operator""Demo' with 'const char [1]', 'unsigned int' arguments
src/effectmanager_persistence.cpp:262:31: note: in expansion of macro 'PROJECT_NAME'
i.e. the macro value reaching gcc is ""Demo""-shaped — backslashes stripped, literal quotes kept. fbuild-config's parse_flags preserves the token verbatim, so the corruption happens downstream in flag re-tokenization (fbuild_core::shell_split::split deliberately treats \ as literal and strips quote chars — correct for Windows paths, wrong for escaped-quote defines) or in the compile-command assembly.
Reproduced in the #942 Docker profiling harness: cold fbuild build /tmp/nds -e demo (NightDriverStrip @ 5911331) fails after ~11.5 min in compile-sketch. This blocks the #942 Phase 1 baseline (and any real project using string-valued defines, which is a very common PlatformIO pattern).
Acceptance criteria
-DNAME="\"Value\"" in build_flags/build_src_flags reaches the compiler as the argv element -DNAME="Value" (direct-exec semantics), on the ESP32 path at minimum.
Unit test covering escaped-quote defines through the flag pipeline (INI → argv).
Audit of the other orchestrators' (esp8266, rp2040, stm32) use of shell_split for the same hazard — fix or file follow-ups.
Severity: HIGH — user-facing build failure on a very common flag idiom.
Fix shape: make the flag tokenizer shell-unescape \" inside double-quoted regions (or bypass re-tokenization for already-tokenized flags) while keeping backslashes literal outside quotes so Windows paths stay safe. Exact location pending trace.
Activity
fix(config): consume INI shell-quoting layer in parse_flags
fix(config): consume INI shell-quoting layer in parse_flags (#949)