Repository navigation
Conversation
Agents that read AGENTS.md now get the same instructions as Claude. A relative symlink (not a copy) so the two can never drift.
…escape extra_flags) Two independent failures when building an empty sketch for board = arduino_nano_esp32 (#1760): 1. The bundled snapshot carried -DBOARD_HAS_PIN_REMAP, so the Arduino core's variants/arduino_nano_nora/io_pin_remap.cpp tripped `#error This build system is not supported. Please rebuild without BOARD_HAS_PIN_REMAP`. That define is only legal alongside -DARDUINO_CORE_BUILD on core TUs, which fbuild does not set. Upstream pioarduino now ships -DBOARD_USES_HW_GPIO_NUMBERS instead; match it. 2. extra_flags string defines kept their escape backslashes. Board JSON stores -DUSB_PRODUCT=\"NanoESP32\"; PlatformIO feeds extra_flags through shlex so the macro body is the literal "NanoESP32", but get_defines() tokenized with shell_split, which strips the quotes as delimiters yet keeps the backslashes -> GCC saw -DUSB_PRODUCT=\NanoESP32\ and reported `stray '\\' in program`. Route through the same INI shell-quote consumer as build_flags (#947). Tests: fbuild-config 233 pass; fbuild-build-esp + fbuild-build-arm green; workspace clippy -D warnings and rustfmt clean.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
…e generation The board snapshot must mirror upstream PlatformIO verbatim — the validate_boards CI gate (ci/validate_boards.py) enforces it, so editing arduino_nano_esp32.json to match a newer pioarduino release fails CI. Handle the flag at the derive step instead: BoardConfig::get_defines() now drops BOARD_HAS_PIN_REMAP. Why: the flag is only legal alongside -DARDUINO_CORE_BUILD on the Arduino core's own TUs (Arduino platform.txt adds it there). fbuild does not define ARDUINO_CORE_BUILD, so passing it through makes variants/<board>/io_pin_remap.cpp trip `#error ... rebuild without BOARD_HAS_PIN_REMAP` (#1760). Dropping it matches the #error's own instruction and Arduino's default board menu (PinNumbers=byGPIONumber => -UBOARD_HAS_PIN_REMAP).
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1760.
A blank sketch for
board = arduino_nano_esp32failed twice. Both failures are in how fbuild ingests the board'sextra_flags; PlatformIO builds the same project with the same platform zip.Error 1 — stale
-DBOARD_HAS_PIN_REMAPin the bundled snapshotcrates/fbuild-config/assets/boards/json/arduino_nano_esp32.jsonshipped-DBOARD_HAS_PIN_REMAP, sovariants/arduino_nano_nora/io_pin_remap.cpptripped itsguard. That define is only legal paired with
-DARDUINO_CORE_BUILDon core translationunits (Arduino's
platform.txt), which fbuild does not set. Upstream pioarduino replacedthe flag with
-DBOARD_USES_HW_GPIO_NUMBERS; the snapshot now matches upstream exactly.Error 2 —
extra_flagsstring defines kept their escape backslashesBoard JSON stores
-DUSB_PRODUCT=\"NanoESP32\". PlatformIO feedsextra_flagsthroughPython
shlex, so\"is an escaped literal quote and the macro body reaches GCC as"NanoESP32".BoardConfig::get_defines()tokenized withshell_split, which strips thequotes as delimiters but keeps the backslashes — yielding a define value of
\NanoESP32\and GCC'sget_defines()now routesextra_flagsthrough the same INI shell-quote consumer usedfor
build_flags(the#947dequoting path,ini_parser::parse_flags), so escaped quotessurvive as a literal string define. Only this board ships escaped quotes in its
extra_flags, and the change is a no-op for flags without quotes.Tests
fbuild-config: 233 passed, 0 failed (adds two regressions: the board definesBOARD_USES_HW_GPIO_NUMBERSand notBOARD_HAS_PIN_REMAP; escaped quotes survive thedefines map).
fbuild-build-esp(248) +fbuild-build-arm(171): green.cargo fmt --all --checkclean;cargo clippy --workspace --all-targets -- -D warningsclean.I could not exercise the full Windows build here (this host has no esp32 framework cache);
the unit tests pin the two ingestion behaviours that the reported errors trace to.