fix(config): consume INI shell-quoting layer in parse_flags#949
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Changesparse_flags quoting fix
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)Not applicable — the change is a single-function tokenizer fix without multi-component interaction flow. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PlatformIO feeds build_flags through Python shlex, so the standard string-valued define idiom -DNAME="\"Demo\"" must be dequoted at INI parse time: quote delimiters group-and-strip, and \" (outside single quotes) is an escaped literal quote. Previously the outer quotes survived into the token and prepare_flags_for_exec's \"->" collapse turned the macro value into ""Demo"", failing every use site with 'unable to find string literal operator'. Backslashes not escaping a double quote stay literal so Windows paths are untouched. Reproduced with NightDriverStrip env:demo (build_src_flags -DPROJECT_NAME="\"Demo\"") in the #942 profiling harness. Closes #947 Part of #942 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
54e44c3 to
e1e55f8
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
PlatformIO feeds
build_flags/build_src_flagsthrough Pythonshlex, so the standard string-valued define idiom-DNAME="\"Demo\""must be dequoted at INI parse time.parse_flagspreviously preserved the quoting layer verbatim; downstream,prepare_flags_for_exec's\"→"collapse (correct for the internal-DNAME=\"...\"convention used by board/SDK defines) then turned the macro value into""Demo"", and every use site failed withunable to find string literal operator 'operator""Demo'.Fix in
parse_flags(single-pass tokenizer): quote delimiters group-and-strip, and\"outside single quotes is an escaped literal". Backslashes not escaping a double quote stay literal, so Windows paths are untouched — the one deliberate divergence from POSIX shlex, now documented. All platforms that build user flags through the shared pipeline benefit (esp32/esp8266/rp2040/stm32).Validation
test_parse_flags_dequotes_shell_layercovering: outer-quoted escaped form, bare escaped form, quoted values with spaces, quoted Windows paths, single-quoted literals.fbuild-configsuite: 180 passed.fbuild-build --lib: 714 passed (Linux container, soldr cargo).env:demo(build_src_flags -DPROJECT_NAME="\"Demo\"") previously failed everyPROJECT_NAMEuse site ~11.5 min into a cold build in the meta: profiling-driven build performance burndown (Docker Linux, NightDriverStrip, cold vs hot cache) #942 Docker harness; with this fix the full compile and link succeed (compile-sketch=100.8s, firmware.elf produced — remaining harness failure is just esptool missing from the container image).Closes #947
Part of #942
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation