Skip to content

research: evaluate Arduino FQBN resolution as a native build input #1298

Open

Description

@zackees

Context

Reproducing FastLED/FastLED#3876 required the exact Arduino board identity Seeeduino:mbed:xiaonRF52840Plus from Seeed's Seeeduino:[email protected] package. Arduino CLI could install that vendor package from Seeed's package index and compile the sketch directly from the FQBN:

arduino-cli core install Seeeduino:[email protected] \
  --additional-urls https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
arduino-cli compile \
  --fqbn Seeeduino:mbed:xiaonRF52840Plus \
  --library /path/to/FastLED examples/Blink

The nearest fbuild reproduction had to go through a PlatformIO board/platform definition. The official Seeed PlatformIO platform URL was rejected before board resolution with unsupported platform: https://github.com/Seeed-Studio/platform-seeedboards.git#..., even though the FQBN and Arduino package describe the target precisely.

The current codebase already contains useful pieces:

  • fbuild_config::BoardConfig::from_boards_txt parses Arduino boards.txt records.
  • fbuild_build_engine::arduino_props applies default and explicit board-menu choices.
  • ResolutionContext is the intended funnel for new board-resolution inputs.
  • Native builds currently select a fixed Platform via Platform::from_platform_str, and the embedded board database is derived from PlatformIO registry JSON.

There is no current FQBN input or Arduino package-index resolver, so vendor cores that are absent from the PlatformIO registry cannot be named in their native Arduino identity.

Proposal

Research and prototype an additive FQBN resolution path for native fbuild builds:

  1. Parse Arduino FQBNs (vendor:architecture:board[:menu=value,...]) into a typed identity.
  2. Resolve an explicitly selected vendor package and version from an installed Arduino data directory and/or a supplied package-index URL.
  3. Read the package's boards.txt, platform.txt, menu selections, tool dependencies, variants, and precompiled framework metadata.
  4. Normalize the result through ResolutionContext/BoardConfig where possible, while documenting which Arduino recipe semantics require a new abstraction.
  5. Keep existing platformio.ini board/platform resolution unchanged; FQBN support should be an additive input, not an implicit reinterpretation of PlatformIO board IDs.
  6. Use Arduino CLI output as a parity oracle during development, without making arduino-cli a runtime dependency of native fbuild.

The Seeed XIAO nRF52840 Plus package above is the motivating vertical slice. Arduino Uno should be used as a control case so the design is not accidentally vendor-specific.

Acceptance criteria

  • RED evidence is checked in showing that native fbuild cannot currently resolve/build Seeeduino:mbed:xiaonRF52840Plus, including the current unsupported-platform or unknown-board diagnostic.
  • A short design note documents FQBN parsing, package/version/index selection, cache layout, offline behavior, checksum/trust policy, menu-option handling, and how Arduino build recipes map to existing fbuild orchestrators.
  • A focused prototype or first implementation resolves Seeeduino:mbed:xiaonRF52840Plus from Seeeduino:[email protected] and exposes the normalized board/platform properties in a deterministic test.
  • GREEN evidence demonstrates the same focused repro passing through the proposed native path, ideally compiling Blink; if compilation is deliberately deferred, the issue must produce scoped implementation follow-ups with the remaining unsupported recipe semantics identified.
  • Existing PlatformIO-style resolution tests remain green, and an Arduino Uno FQBN control test proves the parser/resolver is not Seeed-specific.
  • Invalid FQBNs, missing package versions, unavailable indexes, and unsupported architectures fail with actionable diagnostics that include the unresolved identity.

Decisions

  • Treat this as P2 research/feature work: it unlocks exact vendor-core reproduction but does not block already-supported boards.
  • Make FQBN resolution additive to the current PlatformIO configuration model to avoid changing existing project semantics.
  • Pin package version and package-index source explicitly in the reproducible path; silently selecting a latest vendor core would make builds nondeterministic.
  • Prefer a native resolver over shelling out to Arduino CLI so fbuild retains its standalone, cacheable build model.
  • Use the Seeed Mbed package as the first vertical slice because it exercises a real gap that the embedded PlatformIO board database cannot represent today.

Open questions

  • Should the user-facing surface be fbuild build --fqbn ..., a new configuration key, a generated ephemeral environment, or more than one of these?
  • Should fbuild initially consume only already-installed Arduino packages, or own package-index download/install/cache behavior from the first release?
  • How much of generic Arduino platform.txt recipe evaluation should be implemented versus translating known architectures into existing native orchestrators?

Activity

  1. zackees commented on Dec 1, 2026

    @zackees
    MemberAuthor

    Steward tick 2026-12-01T08:40Z — first cell delivered as PR #2227 (unmerged): parse an FQBN and resolve it against an installed Arduino data directory.

    Measured RED evidence on fbuild 2.5.50, which is the diagnostic criterion 1 asks for:

    $ fbuild build --fqbn Seeeduino:mbed:xiaonRF52840Plus
    error: unexpected argument '--fqbn' found
      tip: to pass '--fqbn' as a value, use '-- --fqbn'
    Usage: fbuild build [OPTIONS] [PROJECT_DIR]
    

    --board accepts only ids the bundled database or a project-local boards/<id>.json defines; a vendor core the PlatformIO registry does not carry has neither, so the identity cannot be named at all.

    What #2227 contains (crates/fbuild-build-engine/src/fqbn.rs + fqbn_tests.rs, record docs/design/fqbn-resolution.md):

    • Fqbn::parse — vendor:architecture:board[:menu=value,...] with structural characters/whitespace refused inside a field, trailing : rejected, duplicate menu selection refused (not last-wins), every error naming the raw input and field.
    • ArduinoPackage::locate — <data_dir>/packages/<vendor>/hardware/<arch>/<version>; no version is guessed (explicit must be installed; no version resolves only when exactly one is installed; several installed = error listing them), because an FQBN carries no version and silently taking "newest" is the non-determinism the issue's decision list forbids.
    • resolve — boards.txt + platform.txt required; menu selections validated against the package first (unknown menu/option reports the available names) then applied through arduino_props::load_board_props_with_menu_overrides, the same helper the PlatformIO board_build.<menu> path uses. Returns normalized board properties, verbatim platform.txt properties ({…} unexpanded) and board_config().

    Criteria mapped:

    Criterion State
    1. RED evidence above (checked into docs/design/fqbn-resolution.md)
    2. Design note (parsing, package/version/index selection, cache layout, offline, checksum/trust, menus, recipe mapping) docs/design/fqbn-resolution.md
    3. Prototype resolves Seeeduino:mbed:xiaonRF52840Plus from Seeeduino:[email protected], deterministic test deterministic tests on synthesized package trees; the real package was measured out-of-band — 34,722,259 B, SHA-256 65d9de0b77010859dd1ca16bfb36b333ddcfbbd7a93270c431cbf49825fd784f (matches the index), resolves to mcu=cortex-m4, variant=SEEED_XIAO_NRF52840_PLUS, crossprefix=arm-none-eabi-, platform.name="Seeed nRF52 mbed-enabled Boards", platform.version=2.9.3
    4. GREEN through the native path / scoped follow-ups compilation deliberately deferred; four scoped follow-ups are listed in the design record and the PR
    5. PlatformIO resolution green + Uno control test engine lib 624 passed / 0 failed; control test resolves arduino:avr:demo:cpu=fast → atmega328p
    6. Actionable diagnostics invalid FQBN, missing/absent version, absent architecture (lists installed ones), unknown board (lists defined ones), unknown menu/option (lists available), missing package file

    What genuinely remains on this issue — and it is not a fence-post, it is a measured limit: the Seeed core names its MCU by ARM core (build.mcu=cortex-m4), not by chip, and its recipes resolve the toolchain through compiler.path={runtime.tools.…}. So (a) an architecture/core → orchestrator decision that accepts a vendor build.mcu, and (b) recipe/toolchain mapping, are the follow-ups on top of the CLI surface. Neither is hardware-gated; neither is in this PR.

    #1298 stays open.

  2. zackees commented on Dec 1, 2026

    @zackees
    MemberAuthor

    Cell delivered: the resolver now has a CLI surface — fbuild fqbn (#2228, merged 2026-12-01T10:46:21Z, origin/main = 481eaa5a).

    #2227 landed the parser/resolver, but it had zero production callers — an installed vendor package could only be resolved from Rust tests. This is the query surface, so the resolution is reachable and the printed properties are what the build-side wiring (follow-up 2) will consume.

    $ fbuild fqbn Seeeduino:mbed:xiaonRF52840Plus --arduino-data-dir <data>
    fqbn=Seeeduino:mbed:xiaonRF52840Plus
    package=<data>/packages/Seeeduino/hardware/mbed/2.9.3
    vendor=Seeeduino
    architecture=mbed
    board_id=xiaonRF52840Plus
    package_version=2.9.3
    # board properties (boards.txt, with the FQBN's menus applied)
    board.build.mcu=cortex-m4
    board.build.variant=SEEED_XIAO_NRF52840_PLUS
    board.build.crossprefix=arm-none-eabi-
    # platform properties (platform.txt, verbatim)
    platform.compiler.c.cmd={build.crossprefix}gcc
    platform.name=Seeed nRF52 mbed-enabled Boards
    platform.version=2.9.3
    
    • Deterministic key=value lines (identity, then board.* sorted, then platform.* sorted), so it pipes; --json emits the same as one object with board_properties / platform_properties.
    • Data dir: --arduino-data-dir, then ARDUINO_DIRECTORIES_DATA, then the conventional location (%LOCALAPPDATA%\Arduino15, ~/.arduino15). A flag/environment value is authoritative even when the path is missing — found because this host has a real ~/.arduino15, which a "first existing candidate wins" rule silently preferred over the flag. Pinned by an_explicit_data_dir_wins_even_when_it_does_not_exist (RED with the "must exist" guard restored: 1 failed / 0 passed).
    • Nothing is downloaded; only installed packages are read.

    RED evidence at c086d1b6: fbuild fqbn Seeeduino:mbed:xiaonRF52840Plus → error: unexpected argument 'Seeeduino:mbed:xiaonRF52840Plus' found (a bare FQBN is taken as a project dir).

    Real run against the published Seeeduino:[email protected] package (34,722,259 B, SHA-256 65d9de0b…fd784f): resolves without --version (only one installed); unknown board → exit 1 naming the 4 defined boards; uninstalled version → exit 1 listing 2.9.3; malformed arduino:avr → exit 1 naming the grammar.

    Gates: fqbn_cmd module 12/12, fbuild-cli bin 561/561, clippy -D warnings 0, fmt 0, platform boundary rows=0; dylint_rows=0; PR 25 pass / 19 skip / 0 fail; merge-group ci-minimal 46628326807 SUCCESS with linux / Check 12,125 lines: 0 soldr#3377 / 0 INFRA - / 0 relay / 0 FAILED / 56 test result: ok; Dylint Full success.

    #1298 stays open. Updated cell map:

    1. CLI surface — delivered; the build-side half (fbuild build --fqbn, board_build.fqbn through ResolutionContext) remains, and it cannot land before (2) because a flag that always ends in "cannot compile this" is worse than the query.
    2. Architecture/core → orchestrator decision for vendor cores whose build.mcu is an ARM core (cortex-m4), including the compiler.path → toolchain mapping. Hardware-free.
    3. Package index install — cache layout, streaming checksum enforcement, offline reuse, trust policy.
    4. Recipe evaluation for the categories the native orchestrators do not model (post-link objcopy, hooks).

    Docs: docs/reference/cli.md (### fbuild fqbn), docs/design/fqbn-resolution.md (status + follow-up 1 updated).

  3. zackees commented on Dec 1, 2026

    @zackees
    MemberAuthor

    Follow-up 2 decided and implemented: the orchestrator claim rule — #2232, merged 2026-12-01T18:35:06Z (origin/main = 00fd80f9).

    The open question this issue left ("how much of platform.txt maps onto existing orchestrators") is answered with one rule instead of a table:

    A package claims an orchestrator only when its own build.mcu names a chip that exactly one orchestrator supports.

    ResolvedFqbn::platform() delegates to BoardConfig::platform() — the board database's existing mcu -> Platform owner — so an FQBN and a PlatformIO board naming the same chip cannot disagree, and a chip gains FQBN support the day the database learns it. Architecture is never the input: Arduino's mbed architecture covers nRF52 and RP2040.

    Measured cases (all in the merged tests, plus a real-binary run):

    $ fbuild fqbn arduino:avr:demo --arduino-data-dir <data>
    orchestrator=atmelavr
    
    $ fbuild fqbn Seeeduino:mbed:demo --arduino-data-dir <data>
    orchestrator_error=config error: FQBN `Seeeduino:mbed:demo` resolved to architecture `mbed` but claims no native orchestrator: its board declares `build.mcu=cortex-m4`, which no orchestrator's chip rule matches; `cortex-m4` is a CPU core, and more than one orchestrator can target the same core, so a package naming a core must also name the chip
    

    A core-named package claims nothing and says which identity/architecture/mcu was refused — guessing compiles another family's link script, start files and flash tooling and only fails on hardware.

    Gates: fqbn module 15/15, fbuild-cli --bin fbuild fqbn 14/14, clippy -D warnings 0, fmt 0, boundary rows=0; dylint_rows=0; RED proven twice (claim branch removed -> 13 passed / 2 failed, exit 101). Design record updated: docs/design/fqbn-resolution.md → "Follow-up 2: the claim rule (implemented)".

    Remaining cells, per the issue's own follow-up list (this issue stays open):

    1. fbuild build --fqbn + board_build.fqbn through ResolutionContext — now has an answer for chip-named packages and a named gap for core-named ones.
    2. An explicit ruling for core-named vendor cores (cortex-m4) and the toolchain mapping expressed by compiler.path.
    3. Package index install (cache layout, streaming SHA-256 enforcement, offline reuse, trust policy).
    4. Recipe evaluation for categories the native orchestrators do not model (recipe.objcopy.*, recipe.hooks.*).
  4. zackees commented on Dec 1, 2026

    @zackees
    MemberAuthor

    Follow-up 2b delivered: the compiler.path toolchain mapping — PR #2233.

    The remaining half of cell 2 was "the toolchain mapping currently expressed by compiler.path". It is a mapping, not a path: the package names its compiler by reference and the tool that provides it is installed beside it.

    platform.txt  compiler.path={build.compiler_path}
                  compiler.c.cmd={build.crossprefix}gcc
    boards.txt    demo.build.compiler_path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
                  demo.build.crossprefix=arm-none-eabi-
    on disk       <data>/packages/Seeeduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-gcc
    

    fqbn_toolchain::resolve_toolchain expands exactly compiler.path and compiler.c.cmd over platform.txt overlaid with board properties; it evaluates no recipe and executes nothing. Rules, both inherited from cells 1 and 2 rather than invented:

    • No version is guessed — a versioned {runtime.tools.<tool>.path} must name an installed version; a bare name resolves only when exactly one version is installed, several are refused listing them (same rule as package versions).
    • Nothing unset is invented — an undefined {…} reference is an error naming it, and only {runtime.platform.path} / runtime.tools.<tool>.path are expanded; other runtime.* properties are refused by name.
    • Own packager first, then across packagers (the toolsDependencies relationship arduino-cli creates); two packagers both installing the tool is refused naming both.

    fbuild fqbn reports it in-band like the orchestrator claim: toolchain=arm-none-eabi-gcc@7-2017q4 + compiler=… or toolchain_error=… beside a successful resolution; --json carries the same pair.

    Measured on the published package Seeeduino:[email protected] (34,722,259 B, SHA-256 65d9de0b…fd784f, index checksum verified) plus the real x86_64 arm-none-eabi-gcc 7-2017q4 (99,857,645 B, index checksum verified; 7.2.1 20170904):

    $ fbuild fqbn Seeeduino:mbed:xiaonRF52840Plus --arduino-data-dir ./data
    toolchain=arm-none-eabi-gcc@7-2017q4
    compiler=./data/packages/Seeeduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-gcc
    

    The resolved compiler then built an ELF32 / Machine: ARM / Version5 EABI object for that board using the board's own -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 flags. With the tool dir moved aside, the query still succeeds and reports needs tool `arm-none-eabi-gcc-7-2017q4`, which is not installed under …/packages/Seeeduino/tools (installed versions of arm-none-eabi-gcc: 9-2019q4).

    Gates: module 17/17, engine fqbn* 32/32, CLI fqbn 18/18 (4 new), clippy -D warnings 0, fmt 0, boundary rows=0; dylint_rows=0; RED proved by disabling the compiler-existence guard (1 failed, exit 101).

    #1298 stays open. Remaining cells: (1) fbuild build --fqbn + board_build.fqbn through ResolutionContext; (2) an explicit maintainer ruling for core-named vendor cores (cortex-m4); (3) package-index install (cache layout, streaming SHA-256, offline reuse, trust policy); (4) recipe evaluation for recipe.objcopy.* / recipe.hooks.*.

  5. zackees commented on Dec 1, 2026

    @zackees
    MemberAuthor

    Follow-up 3 delivered: install a vendor package and its tools from a package index — PR #2234, merged 2026-12-01T22:45:06Z (origin/main = 74674b1a).

    The remaining cell 3 ("package index install: cache layout, streaming checksum enforcement, offline reuse, trust policy") now exists as a separate explicit verb; a query still downloads nothing.

    fbuild fqbn <FQBN> --install --package-index <package_<vendor>_index.json> [--version V] [--json]
    

    The four decisions, made from measurements rather than a template:

    • Trust root = the index file the caller names. Nothing searches for one, no default URL. Every archive is matched against that file's SHA-256 and size, so the transport is not the identity. That is why http and https are both accepted (measured: the published Seeeduino index serves openocd and mkspiffs over plain http; an https-only rule made the motivating package uninstallable), while ftp:/file: are refused by name, MD5: is refused by name, a digest that is not 64 hex is refused and a missing size is refused.
    • Enforced before extraction: size, then SHA-256, then the existing extractor (hostile-tar + long-path guards) unpacks into a staging dir inside the data dir; the tree is renamed into place only after it validates (package needs boards.txt + platform.txt, tool must be non-empty, one top-level wrapper dir is flattened). A refused archive leaves no installed tree.
    • Cache layout = the canonical layout, packages/<vendor>/hardware/<arch>/<version> and packages/<packager>/tools/<name>/<version>, so cells 1–2b read the result with no migration. An installed target is reused with zero requests.
    • Offline: second run of the real install reported state=reused bytes=0 for all five targets.

    Real run against https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json (290,172 B): Seeeduino:[email protected] (34,722,259 B) + [email protected] (2,052,080) + arm-none-eabi-gcc@7-2017q4 (99,857,645) + [email protected] (399,532) + [email protected] (77,184), every archive verified. Then fbuild fqbn Seeeduino:mbed:xiaonRF52840Plus --arduino-data-dir ./data on the installed tree prints toolchain=arm-none-eabi-gcc@7-2017q4 + the installed compiler, and that compiler (7.2.1 20170904) built an ELF32 object with the board's own -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16.

    One real-world defect the index itself exposed: the published Seeeduino index carries a platform object inside a tools array (no host), so a strict model refused the entire file (missing field host at line 5121) and made every other vendor in it unusable. Every index model field is now optional; an unrelated malformed entry simply never matches a selection.

    Gates: fqbn_install 19/19, engine fqbn* 51/51, CLI fqbn 22/22 (4 new), clippy -D warnings 0, fmt 0, boundary rows=0; dylint_rows=0; RED twice (verification disabled → 2 failed; reuse disabled → 1 failed).

    Still open in this issue: (1) fbuild build --fqbn + board_build.fqbn through ResolutionContext and the explicit ruling for core-named vendor cores (cortex-m4), (2) recipe evaluation (recipe.objcopy.*, recipe.hooks.*) — post-install hook execution is deliberately not part of the install verb.

  6. zackees commented on Dec 2, 2026

    @zackees
    MemberAuthor

    Follow-up 4a delivered: a recipe expands into its command — PR #2235.

    Follow-up 4 was "recipe evaluation for categories the native orchestrators do
    not model". Its first half is a mapping, not an execution, so it is now a
    separate verb:

    fbuild fqbn <FQBN> --recipe <key> --prop k=v … [--json]
    recipe=recipe.c.o.pattern
    command="…/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -c -g -Os -w … -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR  "./Blink.c" -o "./Blink.o"
    

    --json carries recipe{key, template, command, argv[]}; a recipe that cannot
    expand is reported in-band as recipe_error= beside a successful resolution.

    Nothing is invented. The property set is platform.txt + the board record +
    what the caller passes. Everything the Arduino builder derives itself is a
    caller property when a recipe names it — build.arch, runtime.ide.version,
    build.core.path, build.variant.path, source_file, object_file,
    includes, build.path — and an unset one is an error naming the reference.
    Deriving build.arch from a Platform would be the second mcu → Platform
    rule this design already refused to add. A --prop never overrides a
    boards.txt/platform.txt property (refused naming both), and quoting is "
    only, so a backslash stays literal ("-IC:\Arduino\libraries").

    A real defect the measured recipes found. The pre-existing {…} expander
    budgeted expansion passes and replaced exactly one reference per pass, so any
    template naming more than 8 references was reported as a {…} cycle. Every
    earlier template had two references; the real recipe.c.o.pattern names
    thirteen. A pass now expands every reference at its level, so the bound counts
    nesting. Proved RED by restoring the one-reference-per-pass loop.

    Measured on both published packages, installed from their own indexes by
    follow-up 3 (no arduino-cli in the loop):

    arduino:[email protected]      recipe.c.o.pattern -> avr-gcc, 15 argv
      spawn exit 0 -> Blink.o, ELF32 "Machine: Atmel AVR 8-bit microcontroller"
    Seeeduino:[email protected]   recipe.c.o.pattern -> arm-none-eabi-gcc, 26 argv
      spawn exit 0 -> Blink.o, ELF32 "Machine: ARM"
    

    The AVR run is the acceptance control for "not Seeed-specific" (criterion 5): a
    second vendor, a second architecture, a second tool family (.tar.bz2
    avr-gcc) and a uno record that declares no menus. The Seeed run refuses
    {build.core.path} and {build.variant.path} until they are passed — the
    refusal is the design working, and then it expands.

    Still open on this issue: fbuild build --fqbn (source list, {includes}
    contents, orchestrator dispatch) and the ruling on core-named vendor cores;
    recipe.hooks.* are executed rather than expanded and still need that decision.
    #1298 stays open.

  7. zackees commented on Dec 2, 2026

    @zackees
    MemberAuthor

    Merged: PR #2235 -> origin/main af7ed706 (2026-12-02T00:51:54Z, merge queue position 1). Follow-up 4a is on main; the expansion half of follow-up 4 is delivered, and fbuild build --fqbn plus recipe.hooks.* remain open on this issue.

  8. zackees commented on Dec 2, 2026

    @zackees
    MemberAuthor

    Follow-up 4b — the builder half of recipe evaluation — is implemented: PR #2236.

    Follow-up 4a expanded a platform.txt recipe into an argv and stopped at
    data. This cell adds the decisions the Arduino builder makes around that
    command, in a new engine module crates/fbuild-build-engine/src/fqbn_compile.rs:

    • source → recipe: .c → recipe.c.o.pattern, .cpp/.cc/.cxx →
      recipe.cpp.o.pattern, .S → recipe.S.o.pattern. A .ino is refused
      naming the preprocessing stage it needs (#include <Arduino.h> plus
      prototypes); an unknown extension is refused listing the known ones.
    • core source list: cores/<build.core> walked recursively and sorted
      (fbuild fqbn <FQBN> --sources).
    • builder-derived properties, derived from the package tree instead of
      passed by hand: build.arch (architecture uppercased — Arduino's own
      definition), build.core.path, build.variant.path (only when the board
      declares one), build.path (the object's directory), source_file,
      object_file, includes (core → variant → source dir → --include, each
      -I"<path>" so the recipe grammar keeps a spaced path intact).
    • the spawn, through fbuild_core::subprocess, creating the object's
      directory first; success is exit 0 and a non-empty object.

    runtime.ide.version stays a caller --prop — it is the Arduino IDE's version
    and fbuild is not that IDE — so a recipe naming it fails naming the reference,
    the 4a rule unchanged.

    Real evidence, both packages installed from their published indexes with no
    arduino-cli:

    arduino:[email protected] --compile cores/arduino/wiring.c
      recipe.c.o.pattern, avr-gcc 7.3.0-atmel3.6.1-arduino7
      includes: cores/arduino, variants/standard
      --run exit 0 -> 10216 B ELF32, e_machine 83 (Atmel AVR 8-bit)
    Seeeduino:[email protected] --compile cores/arduino/itoa.c
      recipe.c.o.pattern, arm-none-eabi-gcc@7-2017q4
      includes: cores/arduino, variants/SEEED_XIAO_NRF52840_PLUS
      --run exit 0 -> 67396 B ELF32, e_machine 40 (ARM)
    

    The Seeed run is the proof of the derivation: that core's recipes name
    {build.core.path} / {build.variant.path}, which 4a refused until a caller
    passed them by hand. The AVR Uno run stays the vendor/architecture control.

    Gates: module 13/13; engine --lib 684 passed / 0 failed (671 + 13); fbuild-cli --bin fbuild 578 passed / 0 failed (575 + 3); clippy -D warnings 0; fmt 0;
    boundary rows=0; dylint_rows=0; win-msvc clippy 0; aarch64-darwin check 0; RED
    proved (lowercasing build.arch fails the derivation test, exit 101).

    Still open (deliberately): linking (recipe.ar.pattern, recipe.c.combine.pattern),
    library discovery, sketch preprocessing, recipe.hooks.* execution (the ruling
    4a left undecided), and fbuild build --fqbn.

    PR #2236. #1298 stays open — acceptance criterion 4 is closer (a real
    translation unit compiles through the native path) but not met while a sketch
    still needs preprocessing and a link step does not exist.

  9. zackees commented on Dec 2, 2026

    @zackees
    MemberAuthor

    Follow-up 4c delivered — the link half: PR #2237, merged 2026-12-02T05:12:55Z (origin/main = be978586).

    Follow-up 4b compiled one translation unit. An Arduino build then does two more
    things, and both are decisions rather than templates, so they are now an engine
    module (crates/fbuild-build-engine/src/fqbn_link.rs) plus two CLI steps:

    fbuild fqbn arduino:avr:uno --archive ./build/core.a --object ./build/*.o --run
    fbuild fqbn arduino:avr:uno --link ./build/Blink.elf \
      --object ./build/Blink.cpp.o --core-archive ./build/core.a --run
    
    • recipe.ar.pattern, once per object. The archive is removed first:
      ar rcs appends, so a member left from an earlier build would link code that
      is no longer in the tree and the linker would not say a word about it.
    • recipe.c.combine.pattern for the image. object_files is one quoted
      argument per object in --object order; build.project_name is the requested
      .elf stem and build.path its directory, because that is how both measured
      cores compose the output.
    • Derived only where the package does not define it. The real AVR core
      declares archive_file_path={build.path}/{archive_file}, so a derived value
      collided on the first real run; the rule is now "derive what is missing, then
      prove the expanded command names the requested archive and image"
      (require_names). A package that would compose a different path is refused
      instead of trusted.
    • --core-archive is separate from --archive. Sharing one flag meant a
      link silently rebuilt its own input from the sketch object (measured: 354,868
      bytes → 3,300), which is exactly the failure mode this issue is about.
    • An empty output is a failure, and the image is removed before the link for the
      same reason as the archive.

    Real end-to-end, no arduino-cli — Arduino's published index,
    arduino:[email protected], [email protected]:

    • 25 core translation units compiled through the package's own recipes;
    • --archive → 25 avr-gcc-ar invocations, exit 0, 354,868 bytes;
    • --link → exit 0, 9,968 bytes, ELF32, machine Atmel AVR 8-bit microcontroller, flags avr:5.

    Gates: module 17/17, engine --lib 701/0, fbuild-cli --bin fbuild 587/0,
    clippy -D warnings 0 on linux and x86_64-pc-windows-msvc,
    cargo check --target aarch64-apple-darwin 0, fmt 0, boundary
    rows=0; dylint_rows=0. RED twice (stale-archive removal disabled → 16/1,
    exit 101; unconditional archive_file_path → 15/2, exit 101).

    One fact for the next cell: a hand-written .cpp that omits #include <Arduino.h> compiles fine and then fails to link with undefined reference to 'setup', because that header is what gives setup/loop C linkage. Sketch
    preprocessing, library discovery, recipe.hooks.* and fbuild build --fqbn
    remain the open cells.

  10. zackees commented on Dec 3, 2026

    @zackees
    MemberAuthor

    Follow-up 4d shipped for review: PR #2242 — a sketch now compiles

    fbuild fqbn <FQBN> --compile Blink.ino plans and runs the compile of the
    translation unit Arduino's builder produces. The preprocessing stage is
    reused from SourceScanner (the PlatformIO sketch preprocessor), not
    re-derived, so tab order, hoisted includes, #line maps and the
    auto-generated prototype block have exactly one owner.

    Real evidence, both packages installed from the vendors' own indexes via
    fbuild fqbn --install (no hand-assembled trees):

    • arduino:avr:uno, a full Blink build through the native path: 24/24 core
      units compiled, core.a 340,294 B, link exit 0, build/Blink.elf =
      ELF32 EXEC "Atmel AVR 8-bit microcontroller", text 956 / bss 9, main
      at 0x2b2. setup/loop/blink_once are inlined into main by the core's
      own -flto -Os link recipe.
    • Seeeduino:mbed:xiaonRF52840Plus (the motivating slice): real
      Seeeduino:[email protected] + arm-none-eabi-gcc@7-2017q4; the preprocessed unit
      compiles with the real variant include
      (variants/SEEED_XIAO_NRF52840_PLUS) and the core's own
      @defines.txt/@cxxflags.txt, -mcpu=cortex-m4 — exit 0, 936,144 B
      ELF32 REL, Machine ARM.

    Remaining cell for this ticket is now only the mbed link: the full
    Seeeduino:mbed core is hundreds of translation units plus the mbed-os
    framework tree, which a single --link step does not reach. Every earlier
    cell (parse, resolve, install from an index, recipe expansion, compile, link)
    is delivered on main or in this PR.

  11. zackees commented on Dec 3, 2026

    @zackees
    MemberAuthor

    Steward receipt — #2242 landed. The sketch-preprocessing follow-up (4d) merged via the merge queue at 2026-12-03T21:44:28Z; origin/main is now c9aa1e66 ("Merge pull request #2242 from FastLED/agent/1298-ino-preprocess"). Merge-group run 47207676993 succeeded (all jobs; linux / Check included), and the push run at c9aa1e66 is SUCCESS plus three board dispatches (Uno, Teensy 4.1, ESP32 Dev) green.

    Verified on the trunk, not just the branch: git grep plan_sketch_unit origin/main -- crates/fbuild-build-engine/src/fqbn_compile.rs = 3 hits, so the .ino branch of plan_unit that reuses SourceScanner is live.

    Real e2e recorded on the PR: arduino:avr:uno full Blink → 24/24 core units, core.a 340,294 B, link exit 0, ELF32 AVR EXEC (text 956); Seeeduino:mbed:xiaonRF52840Plus sketch TU → 936,144 B ELF32 REL ARM with the real mbed 2.9.3 + arm-none-eabi 7-2017q4.

    Remaining known gap is unchanged and still separate: the virtual-mbed link (hundreds of TUs + mbed-os). This issue stays open.

  12. zackees commented on Dec 4, 2026

    @zackees
    MemberAuthor

    Steward receipt — follow-up 4e: a vendor core's link is delivered (PR #2243).

    Two cells, both found by running the real package rather than a fixture:

    1. recipe.hooks.linking.prelink.<n>.pattern. Seeeduino:[email protected] composes its linker script into the build directory before linking:
      recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.elf.cmd}" -E -P -x c ... "{build.variant.path}/{build.ldscript}" -o "{build.path}/{build.ldscript}", then recipe.c.combine.pattern links -T{build.path}/{build.ldscript}.
      fbuild fqbn --link now plans every prelink hook in numeric order (1, 2, 10 — not lexical), expands it over the same properties as the link, runs it before the linker, and stops the link when a hook exits non-zero (naming the hook key, leaving no image).
    2. The variant folder belongs to the core archive. Arduino compiles variants/<board>/* into core.a next to cores/<core>/** (its own files only). Without variant.cpp the archive builds clean and the ELF dies with undefined reference to g_APinDescription / PINCOUNT_fn / getUniqueSerialNumber / _ontouch1200bps_ — the exact failure this run hit before the fix. core_sources now includes those files.

    Real e2e (published index: core 34,722,259 B sha256 65d9de0b…, toolchain arm-none-eabi 7-2017q4 sha256 96a029e2ae13…, canonical layout): 42 core units → core.a 27,637,612 B, sketch TU 936,772 B, link_hooks_run=1, link_exit=0 → Blink.elf 1,732,660 B, ELF32 ARM EXEC, entry 0x2fb6d, symbols main/setup/loop; the hook's build/linker_script.ld is 4,242 B and preprocessed (FLASH ORIGIN = 0x27000, no #define remaining).

    Gates: engine 709 passed / 0 failed / 6 ignored, cli 589 passed / 0 failed, clippy 0 (engine+cli, -D warnings), boundary rows=0; dylint_rows=0, fmt clean. RED twice: disabling the hook loop fails a_prelink_hook_runs_before_the_linker_and_blocks_it_when_it_cannot_run (19/1, exit 101); dropping the variant walk fails the_variant_folder_sources_join_the_core_but_not_its_subdirectories (17/1, exit 101).

    PR: #2243 (unmerged, for the owner). #1298 stays open — the remaining cells are the objcopy/upload side of the same builder.

  13. zackees commented on Dec 4, 2026

    @zackees
    MemberAuthor

    Merged: #2243 -> origin/main e3c85381 (merge commit, 2026-12-04T02:04:41Z) after the merge-queue group run 47247735984 went green.

    What landed for follow-up 4e (vendor-core link):

    • recipe.hooks.linking.prelink.<n>.pattern planned in numeric order and run before recipe.c.combine.pattern; a failing hook stops the link, names its key and writes no image.
    • core_sources now includes variants/<build.variant>/* (top level only), without which core.a links clean and the ELF dies on undefined reference to g_APinDescription / PINCOUNT_fn.
    • CLI link_hooks=N, link_hook.<i>=, link_hooks_run=N; JSON link.hooks[], link_outcome.hooks.

    Real e2e on the published Seeeduino:[email protected] package (checksums matched the index): 42 core units -> core.a 27,637,612 B; sketch TU 936,772 B; link_hooks_run=1, link_exit=0 -> Blink.elf 1,732,660 B, ELF32 ARM EXEC, entry 0x2fb6d, main/setup/loop; the hook's linker_script.ld is 4,242 B and C-preprocessed (FLASH ORIGIN 0x27000).

    Trunk verified, not just the branch: git show origin/main:crates/fbuild-build-engine/src/fqbn_link.rs carries prelink_hooks(), and the three post-merge board dispatches (Uno / Teensy 4.1 / ESP32 Dev) are green on e3c85381.

    #1298 stays open — the remaining cells are the .ino upload/objcopy half and fbuild deploy against a vendor core.

  14. zackees commented on Dec 4, 2026

    @zackees
    MemberAuthor

    Steward receipt — follow-up 4f: the firmware images of a vendor core (PR #2246, merged).

    origin/main is now afafa8de ("Merge pull request #2246 from FastLED/agent/1298-fqbn-objcopy"), merged 2026-12-04T05:15:43Z after merge-group run 47271268521 went green.

    What landed:

    • fbuild fqbn <FQBN> --objcopy <name>.elf plans and runs every non-empty
      recipe.objcopy.<ext>.pattern the package declares, in name order
      (bin, eep, hex, zip). Order is a rule, not a nicety: the real
      Seeeduino:[email protected] recipe.objcopy.zip.pattern packages
      {build.project_name}.hex, not the ELF, so hex must run first.
    • An empty recipe is skipped: mbed declares recipe.objcopy.eep.pattern= with
      no value, and Arduino skips it.
    • Each image is derived as {build.path}/{build.project_name}.<ext> from the
      ELF's own directory and stem, and the expansion must name that path, so a
      recipe writing elsewhere is refused by name.
    • Success is "every step exited 0 and every declared image exists" — the AVR
      .eep recipe legitimately writes 0 bytes for a sketch with no EEPROM data,
      while a step that exits 0 and writes nothing at all fails.
    • CLI text/JSON: objcopy_elf, objcopy_images, objcopy_image.<i>,
      objcopy_recipe.<i>, objcopy_command.<i>, objcopy_exit,
      objcopy_written, objcopy_bytes.<i>; --link + --objcopy work in one
      invocation.

    Real e2e, real arduino:[email protected] package + avr-gcc 7.3.0 (no fixture):
    24/24 core units → core.a 347,362 B → sketch TU → Blink.elf 14,160 B
    (link_exit=0) → --objcopy build/Blink.elf --run → objcopy_written=2,
    build/Blink.hex 2,615 B Intel HEX (first bytes :100000000C945C0),
    build/Blink.eep 13 B, exit 0.

    Gates: engine 716 passed / 0 failed / 6 ignored; cli 592 passed / 0 failed;
    clippy 0 (engine+cli, -D warnings); boundary rows=0; dylint_rows=0; fmt
    clean. RED twice: dropping the empty-value filter fails 2 tests, dropping the
    derived-name check fails 1; each guard restored and re-run green.

    Trunk verified, not just the branch: git show origin/main:crates/fbuild-build-engine/src/lib.rs
    declares pub mod fqbn_objcopy; and args.rs carries the flag.

    #1298 stays open: the remaining cell is the upload/deploy side — naming the
    board a vendor FQBN produced and flashing the image above with fbuild deploy.

  15. zackees commented on Dec 4, 2026

    @zackees
    MemberAuthor

    Steward receipt — follow-up 4g: the package's own uploader (PR #2249, merged).

    origin/main is now db1e254a ("Merge pull request #2249 from FastLED/agent/1298-fqbn-upload"), merged 2026-12-04T09:02:47Z after merge-group run 47301189061 went green (38 checks, 0 failures).

    The chain the issue asked for now ends where Arduino's does — an image handed to a programme the package installs:

    • fbuild fqbn <FQBN> --upload <image> --port <port> [--protocol <p>] [--upload-verbose] [--run] expands the package's tools.<tool>.upload.pattern, where <tool> comes from upload.tool.<protocol> → upload.tool.default → upload.tool.
    • {serial.port} is never defaulted; {upload.verbose} is tools.<tool>.upload.params.<level> and {upload.verify} is tools.<tool>.upload.verify (the AVR core declares it empty — the package's value, not an invented default).
    • Tool-scoped references ({cmd.path}, {config.path}, {path}) now resolve inside tools.<tool>. — the real AVR pattern names its uploader that way, and a package-wide-only expansion refused every real avrdude command. An unresolvable reference is refused by name and namespace.
    • The "command must name the file you asked for" rule is containment with path-character bounds, because the flasher receives the image inside -Uflash:w:<path>.hex:i; a recipe naming a different file is still refused. .elf input and an absent --port are refused before anything runs.

    Real e2e, arduino:[email protected] from the published index (checksums verified), no board flashed: 25 core units → core.a 353,404 B → sketch TU 3,916 B → Blink.elf 14,200 B → --objcopy → Blink.hex 2,611 B + Blink.eep 13 B → --upload prints

    "…/avrdude" "-C…/etc/avrdude.conf" -q -q  -patmega328p -carduino "-P/dev/ttyACM0" -b115200 -D "-Uflash:w:build/Blink.hex:i"
    

    --run against a nonexistent port spawns the real avrdude, upload_exit=1, avrdude: ser_open(): can't open device … — the tool's own verdict, propagated.

    Gates: engine 730 passed / 0 failed / 6 ignored; cli 594 passed / 0 failed; clippy -D warnings exit 0; fmt clean; boundary rows=0; dylint_rows=0. RED proven twice (scope disabled → 5 failures incl. the real AVR plan; containment neutered → the "names another image" test passes when it must fail).

    Trunk verified, not just the branch: origin/main:crates/fbuild-build-engine/src/fqbn_upload.rs exists and args.rs carries the --upload surface.

    #1298 stays open — library discovery and fbuild build --fqbn are the cells left.

  16. zackees commented on Dec 4, 2026

    @zackees
    MemberAuthor

    Steward receipt — follow-up 4h: the libraries a sketch includes (PR #2250, merged).

    origin/main is now 66c05e00 ("Merge pull request #2250 from FastLED/agent/1298-fqbn-libraries"), merged 2026-12-04T13:06:40Z after merge-group run 47338969324 completed SUCCESS (no non-success job).

    Arduino's builder resolves the sketch's #include lines before it compiles anything. The FQBN path compiled the core and the sketch, but nothing ever answered "which library is <FastLED.h>?", so that include had no source. fqbn_libraries is that step:

    • Ownership: library.properties includes= → folder name == header stem (Wire/Wire.h) → the one library holding a file of that name. The earliest search root wins, exactly as Arduino's include order does; two libraries inside the same root claiming one header are refused by name, because compiling the wrong utility/twi.h is invisible until the link.
    • Roots: the package's bundled libraries/, then <data_dir>/libraries, then each --library-root.
    • Layouts: 1.5-format is src/-rooted (sources recursive below src/, one include dir); 1.0-format compiles from its root plus utility/, and never from examples//extras/.
    • Core first: a header the core or the board variant provides is never a library header.
    • Transitive: library headers are scanned for further includes, so one library naming another selects both.
    • Unresolved covers headers the sketch includes (the compiler stays the authority — stdint.h is the toolchain's). A library's own #ifdef-guarded platform includes are not reported: FastLED alone names 300+ ESP32/nRF52/STM32 headers it knows, and the preprocessor decides whether they are read.

    CLI, on the existing fbuild fqbn: --sketch <dir>/<name>.ino [--library-root DIR] reports library_count, library.<i>, library_root.<i>, library_include.<i>.<j>, library_source.<i>.<j>, unresolved_header.<i> (JSON: libraries); a --compile of the sketch gains the selected include directories, so discovery is wired, not just printed.

    Real e2e (no fixtures): arduino:[email protected] installed from the published index (checksums verified) plus a real FastLED 3.10.10 checkout:

    library_count=5   EEPROM(0 sources, header-only) FastLED(36) SPI(1) SoftwareSerial(1) Wire(2)
    unresolved_header_count=0
    compile_recipe=recipe.cpp.o.pattern
    compile_exit=0    compile_object_bytes=160096
    

    The expanded command carries all five library -I directories; a deliberately missing <NotInstalledHere.h> was reported as unresolved_header.0 and refused by avr-g++ with that exact name, then removed for the green run.

    Gates: engine 742 passed / 0 failed / 6 ignored (12 new tests); cli 598 + 12 passed / 0 failed; clippy -D warnings exit 0; boundary rows=0; dylint_rows=0; research --check exit 0; fmt clean; soldr lint rust --check --cross-dylint exit 0. RED twice: dropping the core-header check fails the core/unresolved test, dropping the include-append fails the include-wiring test. Test modules split (fqbn_cmd_library_tests.rs) to keep every .rs under the 1000-line gate — the first push was red on ban_std_pathbuf (a local Vec<PathBuf>), fixed in 738ae39c.

    #1298 stays open — the remaining cell is fbuild build --fqbn.

  17. zackees commented on Dec 4, 2026

    @zackees
    MemberAuthor

    Steward receipt — follow-up 5: fbuild build from an FQBN (PR #2251).

    origin/main is 66c05e00 (follow-up 4h merged). The pieces existed one step
    at a time — resolve, recipe, compile, archive, link, objcopy, upload,
    libraries — and this is the driver that runs them in Arduino's order:

    fbuild fqbn arduino:avr:uno --sketch Blink/Blink.ino --build ./out \
      --prop runtime.ide.version=10607
    
    • Stages: prebuild hooks → core sources → core.a (rebuilt) → libraries
      (libraries.prebuild) → sketch (sketch.prebuild, generated tab +
      the sketch's own src/) → link (recipe.c.combine.pattern + its numeric
      pre-link hooks) → recipe.objcopy.* in name order → postbuild. The build
      stops at the first failing stage and names it; the report is in band, so the
      counts of the stages that ran survive the failure.
    • One build.path: objects live under core/, core/variant/,
      libraries/<name>/ and sketch/, but every recipe expands {build.path} to
      the one root (plan_unit_in; plan_unit's inferred form is unchanged).
    • No re-derived rules: library selection is fqbn_libraries::plan_for_sketch,
      sketch preprocessing is the shared source_scanner, archiving/linking/pre-link
      hooks are fqbn_link.
    • Hooks refused, not skipped: a package declaring a hook in a stage this
      driver does not run (core.prebuild, objcopy.*, savehex.*) is refused by
      key, because silently skipping a stage is firmware the package did not
      describe.

    Real e2e, no fixtures:

    arduino:[email protected]  Blink          25 core units  core.a 353,796 B  ELF 14,208 B
                                     .eep 13 B  .hex 2,611 B                      exit 0
    + real FastLED 3.10.10            38 library units               ELF 61,864 B
                                     .hex 10,126 B                               exit 0
    Seeeduino:[email protected] xiaonRF52840Plus  (the issue's motivating target)
                                      42 core units  core.a 27,637,612 B
                                      ELF 1,732,744 B  .bin 84,632 B
                                      .hex 238,115 B  .zip 85,441 B              exit 0
    

    The mbed run exercised the package's own pre-link hook (-E -P of the variant
    linker script into build.path) and its nrfutil packaging recipe (that tool is
    installed by the core's post_install.sh, not by a package index).

    Gates: engine 752 passed / 0 failed / 6 ignored (10 new), cli 602 / 0 (4 new),
    clippy -D warnings 0, Windows MSVC clippy 0, macOS aarch64 check 0, boundary
    rows=0; dylint_rows=0, research --check 0, fmt clean; RED twice.

    This closes the build-driver cell. #1298 stays open for the remaining open
    question — the user-facing surface (fbuild build --fqbn vs this additive flag
    on fbuild fqbn) is a maintainer decision, and the driver is deliberately the
    fbuild fqbn surface the last four follow-ups built.

  18. zackees commented on Dec 4, 2026

    @zackees
    MemberAuthor

    Merged. PR #2251 is on main as 0db2944a (merge group 47360619158 green, no
    non-success job; merged 2026-12-04T15:15:51Z). Trunk verified: lib.rs declares
    pub mod fqbn_build; (module 813 lines) and args.rs carries the --build
    flag on fqbn.

    So every stage of the issue's proposal is now in-repo and exercised end to end on
    the motivating Seeed core:

    1. FQBN parsing — fqbn.rs
    2. package/version/index install — fqbn_install.rs
    3. boards.txt / platform.txt / menus / tools / variants — fqbn.rs, fqbn_toolchain.rs
    4. normalization through BoardConfig — ResolvedFqbn::board_config
    5. additive to PlatformIO — untouched (fbuild build still takes a platformio.ini)
    6. Arduino CLI parity oracle — not a runtime dependency; parity was compared against
      the vendor recipes and real package trees, not a shelled-out CLI
    7. RED evidence — checked into the tests (sketch-name refusal, unresolved includes,
      unplaceable hooks) plus the original unsupported-platform diagnostic still
      covered by the PlatformIO tests
    8. GREEN evidence — Seeeduino:mbed:xiaonRF52840Plus builds Blink natively:
      42 core units → core.a 27,637,612 B → ELF 1,732,744 B → .bin/.hex/.zip

    The only thing left in the issue's own list is a decision, not code: whether the
    public surface should also grow fbuild build --fqbn (an alias that would have to
    reinterpret the build subcommand) or stay the additive fbuild fqbn … --build
    that the six follow-ups built. That is a maintainer call; this issue can be
    closed or kept as a tracking ticket for it.

  19. zackees commented on Dec 4, 2026

    @zackees
    MemberAuthor

    Steward receipt — the decision record now matches the code (PR #2252).

    The design note named by acceptance criterion 2 still argued from the state before
    follow-ups 4c-5 landed: it said a .ino "is refused rather than compiled as C++",
    that archiving/linking and the libraries/ scan "are the next cells", and that
    fbuild build --fqbn "can only land once a resolved FQBN can be mapped onto an
    orchestrator". docs/reference/cli.md closed its FQBN section with "Library
    discovery, recipe.hooks.* and fbuild build --fqbn remain the open cells".
    None of that is true on main (0db2944a).

    PR #2252 (docs only) records what shipped, one section per cell:

    • 4c — archive rebuilt from exactly the planned objects (deleted first,
      because ar rcs appends and a stale member links code that is not in the
      tree); object_files one quoted argument per object; the output must be
      <name>.elf, so a caller asking for .bin is refused by name.
    • 4d — the .ino stage reuses source_scanner; the generated tab lives at
      build.path/sketch/<name>.ino.cpp and the sketch's own non-.ino sources
      keep their own recipe.
    • 4e — recipe.hooks.linking.prelink.<n>.pattern in numeric order, and
      variants/<board>/* (top level) is part of core.a.
    • 4f — recipe.objcopy.* in name order (mbed's .zip packages the
      .hex), an empty recipe skipped, success = the declared image exists.
    • 4g — the uploader, unchanged, now placed in numeric order.
    • 4h — ownership (includes= → folder stem → holder), root precedence,
      1.5 src/-rooted vs 1.0 root+utility/, transitive, unresolved =
      entry-file includes only.
    • 5 — the driver: stage order, plan_build data vs build the only
      spawner, one build root through plan_unit_in, hook stages run vs refused
      by key, stop at the first failing stage naming it.

    Statements were re-read from the code on 0db2944a (fqbn_link.rs,
    fqbn_objcopy.rs, fqbn_libraries.rs, fqbn_compile.rs::core_sources,
    fqbn_build.rs, fqbn_build_cmd.rs), not from the run notes.

    Where the issue stands. All six acceptance criteria are satisfied in-repo
    (RED evidence and controls in the tests; the design note now current; the
    motivating Seeeduino:[email protected] xiaonRF52840Plus third row builds end to end:
    42 core units → core.a 27.6 MB → ELF 1,732,744 B → .bin/.hex/.zip
    85,441 B, exit 0). What remains is not code:

    1. Surface ruling — fbuild build is the PlatformIO entry point; whether it
      also takes an additive --fqbn (plus a board_build.fqbn key) is a routing
      decision. The capability already exists behind fqbn … --build.
    2. Core-named vendor cores — which orchestrator, if any, a core-named
      build.mcu (cortex-m4) may select.

    This issue stays open for those two rulings; the block ledger is pinned to its
    current body so the next tick does not re-nominate it, and an edit to this issue
    re-opens it for re-verification.

  20. zackees commented on Dec 4, 2026

    @zackees
    MemberAuthor

    Merged. PR #2252 is on main as c34febb5 ("Merge pull request #2252 from
    FastLED/agent/1298-fqbn-doc-driver"), merge-queue group 47377981242 green; merged
    2026-12-04T16:46:21Z. Trunk verified: docs/design/fqbn-resolution.md carries the six
    new sections (4c, 4d, 4e, 4f, 4h, 5) and docs/reference/cli.md carries
    ### fqbn --sketch, --library-root and --build.

    Checks before the queue: all pass, 0 failures (linux / Check 11m12s, dylint / Rust lint 2m2s, Render-and-diff 39s), mergeStateStatus: CLEAN.

    So the issue's acceptance criteria are all satisfied in-repo and the design note now
    describes the shipped code. What remains is the two maintainer rulings recorded in the
    previous comment (the fbuild build --fqbn surface, and the orchestrator for a
    core-named build.mcu); the issue block is pinned to its current body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions