Repository navigation
Description
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_txtparses Arduinoboards.txtrecords.fbuild_build_engine::arduino_propsapplies default and explicit board-menu choices.ResolutionContextis the intended funnel for new board-resolution inputs.- Native builds currently select a fixed
PlatformviaPlatform::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:
- Parse Arduino FQBNs (
vendor:architecture:board[:menu=value,...]) into a typed identity. - Resolve an explicitly selected vendor package and version from an installed Arduino data directory and/or a supplied package-index URL.
- Read the package's
boards.txt,platform.txt, menu selections, tool dependencies, variants, and precompiled framework metadata. - Normalize the result through
ResolutionContext/BoardConfigwhere possible, while documenting which Arduino recipe semantics require a new abstraction. - Keep existing
platformio.iniboard/platform resolution unchanged; FQBN support should be an additive input, not an implicit reinterpretation of PlatformIO board IDs. - Use Arduino CLI output as a parity oracle during development, without making
arduino-clia 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:xiaonRF52840PlusfromSeeeduino:[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.txtrecipe evaluation should be implemented versus translating known architectures into existing native orchestrators?
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
zackees commentedon Dec 1, 2026
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:--boardaccepts only ids the bundled database or a project-localboards/<id>.jsondefines; 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, recorddocs/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.txtrequired; menu selections validated against the package first (unknown menu/option reports the available names) then applied througharduino_props::load_board_props_with_menu_overrides, the same helper the PlatformIOboard_build.<menu>path uses. Returns normalized board properties, verbatimplatform.txtproperties ({…}unexpanded) andboard_config().Criteria mapped:
docs/design/fqbn-resolution.md)docs/design/fqbn-resolution.mdSeeeduino:mbed:xiaonRF52840PlusfromSeeeduino:[email protected], deterministic test65d9de0b77010859dd1ca16bfb36b333ddcfbbd7a93270c431cbf49825fd784f(matches the index), resolves tomcu=cortex-m4,variant=SEEED_XIAO_NRF52840_PLUS,crossprefix=arm-none-eabi-,platform.name="Seeed nRF52 mbed-enabled Boards",platform.version=2.9.3arduino:avr:demo:cpu=fast→atmega328pWhat 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 throughcompiler.path={runtime.tools.…}. So (a) an architecture/core → orchestrator decision that accepts a vendorbuild.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.#1298stays open.zackees commentedon Dec 1, 2026
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.
key=valuelines (identity, thenboard.*sorted, thenplatform.*sorted), so it pipes;--jsonemits the same as one object withboard_properties/platform_properties.--arduino-data-dir, thenARDUINO_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 byan_explicit_data_dir_wins_even_when_it_does_not_exist(RED with the "must exist" guard restored: 1 failed / 0 passed).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-25665d9de0b…fd784f): resolves without--version(only one installed); unknown board → exit 1 naming the 4 defined boards; uninstalled version → exit 1 listing2.9.3; malformedarduino:avr→ exit 1 naming the grammar.Gates: fqbn_cmd module 12/12,
fbuild-clibin 561/561, clippy-D warnings0, fmt 0, platform boundaryrows=0; dylint_rows=0; PR 25 pass / 19 skip / 0 fail; merge-groupci-minimal46628326807 SUCCESS withlinux / Check12,125 lines: 0soldr#3377/ 0INFRA -/ 0 relay / 0 FAILED / 56test result: ok; Dylint Full success.#1298 stays open. Updated cell map:
fbuild build --fqbn,board_build.fqbnthroughResolutionContext) remains, and it cannot land before (2) because a flag that always ends in "cannot compile this" is worse than the query.build.mcuis an ARM core (cortex-m4), including thecompiler.path→ toolchain mapping. Hardware-free.objcopy,hooks).Docs:
docs/reference/cli.md(### fbuild fqbn),docs/design/fqbn-resolution.md(status + follow-up 1 updated).zackees commentedon Dec 1, 2026
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.txtmaps onto existing orchestrators") is answered with one rule instead of a table:ResolvedFqbn::platform()delegates toBoardConfig::platform()— the board database's existingmcu -> Platformowner — 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'smbedarchitecture covers nRF52 and RP2040.Measured cases (all in the merged tests, plus a real-binary run):
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:
fqbnmodule 15/15,fbuild-cli --bin fbuild fqbn14/14, clippy-D warnings0, fmt 0, boundaryrows=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):
fbuild build --fqbn+board_build.fqbnthroughResolutionContext— now has an answer for chip-named packages and a named gap for core-named ones.cortex-m4) and the toolchain mapping expressed bycompiler.path.recipe.objcopy.*,recipe.hooks.*).zackees commentedon Dec 1, 2026
Follow-up 2b delivered: the
compiler.pathtoolchain 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.fqbn_toolchain::resolve_toolchainexpands exactlycompiler.pathandcompiler.c.cmdoverplatform.txtoverlaid with board properties; it evaluates no recipe and executes nothing. Rules, both inherited from cells 1 and 2 rather than invented:{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).{…}reference is an error naming it, and only{runtime.platform.path}/runtime.tools.<tool>.pathare expanded; otherruntime.*properties are refused by name.toolsDependenciesrelationship arduino-cli creates); two packagers both installing the tool is refused naming both.fbuild fqbnreports it in-band like the orchestrator claim:toolchain=arm-none-eabi-gcc@7-2017q4+compiler=…ortoolchain_error=…beside a successful resolution;--jsoncarries the same pair.Measured on the published package
Seeeduino:[email protected](34,722,259 B, SHA-25665d9de0b…fd784f, index checksum verified) plus the real x86_64arm-none-eabi-gcc 7-2017q4(99,857,645 B, index checksum verified;7.2.1 20170904):The resolved compiler then built an
ELF32 / Machine: ARM / Version5 EABIobject for that board using the board's own-mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16flags. With the tool dir moved aside, the query still succeeds and reportsneeds 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, CLIfqbn18/18 (4 new), clippy-D warnings0, fmt 0, boundaryrows=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.fqbnthroughResolutionContext; (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 forrecipe.objcopy.*/recipe.hooks.*.zackees commentedon Dec 1, 2026
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.
The four decisions, made from measurements rather than a template:
SHA-256andsize, so the transport is not the identity. That is whyhttpandhttpsare both accepted (measured: the published Seeeduino index servesopenocdandmkspiffsover plainhttp; an https-only rule made the motivating package uninstallable), whileftp:/file:are refused by name,MD5:is refused by name, a digest that is not 64 hex is refused and a missingsizeis refused.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 needsboards.txt+platform.txt, tool must be non-empty, one top-level wrapper dir is flattened). A refused archive leaves no installed tree.packages/<vendor>/hardware/<arch>/<version>andpackages/<packager>/tools/<name>/<version>, so cells 1–2b read the result with no migration. An installed target is reused with zero requests.state=reused bytes=0for 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. Thenfbuild fqbn Seeeduino:mbed:xiaonRF52840Plus --arduino-data-dir ./dataon the installed tree printstoolchain=arm-none-eabi-gcc@7-2017q4+ the installed compiler, and that compiler (7.2.1 20170904) built anELF32object 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
toolsarray (nohost), 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_install19/19, enginefqbn*51/51, CLIfqbn22/22 (4 new), clippy-D warnings0, fmt 0, boundaryrows=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.fqbnthroughResolutionContextand 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.zackees commentedon Dec 2, 2026
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:
--jsoncarriesrecipe{key, template, command, argv[]}; a recipe that cannotexpand 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.archfrom aPlatformwould be the secondmcu → Platformrule this design already refused to add. A
--propnever overrides aboards.txt/platform.txtproperty (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
{…}expanderbudgeted expansion passes and replaced exactly one reference per pass, so any
template naming more than 8 references was reported as a
{…}cycle. Everyearlier template had two references; the real
recipe.c.o.patternnamesthirteen. 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-cliin the loop):The AVR run is the acceptance control for "not Seeed-specific" (criterion 5): a
second vendor, a second architecture, a second tool family (
.tar.bz2avr-gcc) and aunorecord that declares no menus. The Seeed run refuses{build.core.path}and{build.variant.path}until they are passed — therefusal 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.
zackees commentedon Dec 2, 2026
Merged: PR #2235 ->
origin/mainaf7ed706(2026-12-02T00:51:54Z, merge queue position 1). Follow-up 4a is on main; the expansion half of follow-up 4 is delivered, andfbuild build --fqbnplusrecipe.hooks.*remain open on this issue.zackees commentedon Dec 2, 2026
Follow-up 4b — the builder half of recipe evaluation — is implemented: PR #2236.
Follow-up 4a expanded a
platform.txtrecipe into anargvand stopped atdata. 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:.c→recipe.c.o.pattern,.cpp/.cc/.cxx→recipe.cpp.o.pattern,.S→recipe.S.o.pattern. A.inois refusednaming the preprocessing stage it needs (
#include <Arduino.h>plusprototypes); an unknown extension is refused listing the known ones.
cores/<build.core>walked recursively and sorted(
fbuild fqbn <FQBN> --sources).passed by hand:
build.arch(architecture uppercased — Arduino's owndefinition),
build.core.path,build.variant.path(only when the boarddeclares 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).fbuild_core::subprocess, creating the object'sdirectory first; success is exit 0 and a non-empty object.
runtime.ide.versionstays a caller--prop— it is the Arduino IDE's versionand 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: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 callerpassed them by hand. The AVR Uno run stays the vendor/architecture control.
Gates: module 13/13; engine
--lib684 passed / 0 failed (671 + 13);fbuild-cli --bin fbuild578 passed / 0 failed (575 + 3); clippy-D warnings0; fmt 0;boundary
rows=0; dylint_rows=0; win-msvc clippy 0; aarch64-darwin check 0; REDproved (lowercasing
build.archfails the derivation test, exit 101).Still open (deliberately): linking (
recipe.ar.pattern,recipe.c.combine.pattern),library discovery, sketch preprocessing,
recipe.hooks.*execution (the ruling4a 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.
zackees commentedon Dec 2, 2026
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:recipe.ar.pattern, once per object. The archive is removed first:ar rcsappends, so a member left from an earlier build would link code thatis no longer in the tree and the linker would not say a word about it.
recipe.c.combine.patternfor the image.object_filesis one quotedargument per object in
--objectorder;build.project_nameis the requested.elfstem andbuild.pathits directory, because that is how both measuredcores compose the output.
declares
archive_file_path={build.path}/{archive_file}, so a derived valuecollided 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 refusedinstead of trusted.
--core-archiveis separate from--archive. Sharing one flag meant alink 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.
same reason as the archive.
Real end-to-end, no arduino-cli — Arduino's published index,
arduino:[email protected],[email protected]:--archive→ 25avr-gcc-arinvocations, exit 0, 354,868 bytes;--link→ exit 0, 9,968 bytes, ELF32, machineAtmel AVR 8-bit microcontroller, flagsavr:5.Gates: module 17/17, engine
--lib701/0,fbuild-cli --bin fbuild587/0,clippy
-D warnings0 on linux andx86_64-pc-windows-msvc,cargo check --target aarch64-apple-darwin0, fmt 0, boundaryrows=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
.cppthat omits#include <Arduino.h>compiles fine and then fails to link withundefined reference to 'setup', because that header is what givessetup/loopC linkage. Sketchpreprocessing, library discovery,
recipe.hooks.*andfbuild build --fqbnremain the open cells.
zackees commentedon Dec 3, 2026
Follow-up 4d shipped for review: PR #2242 — a sketch now compiles
fbuild fqbn <FQBN> --compile Blink.inoplans and runs the compile of thetranslation unit Arduino's builder produces. The preprocessing stage is
reused from
SourceScanner(the PlatformIO sketch preprocessor), notre-derived, so tab order, hoisted includes,
#linemaps and theauto-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 coreunits compiled,
core.a340,294 B, link exit 0,build/Blink.elf=ELF32 EXEC "Atmel AVR 8-bit microcontroller", text 956 / bss 9,
mainat 0x2b2.
setup/loop/blink_onceare inlined intomainby the core'sown
-flto -Oslink recipe.Seeeduino:mbed:xiaonRF52840Plus(the motivating slice): realSeeeduino:[email protected]+arm-none-eabi-gcc@7-2017q4; the preprocessed unitcompiles 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 BELF32 REL, Machine ARM.
Remaining cell for this ticket is now only the mbed link: the full
Seeeduino:mbedcore is hundreds of translation units plus the mbed-osframework tree, which a single
--linkstep does not reach. Every earliercell (parse, resolve, install from an index, recipe expansion, compile, link)
is delivered on
mainor in this PR.zackees commentedon Dec 3, 2026
Steward receipt — #2242 landed. The sketch-preprocessing follow-up (4d) merged via the merge queue at 2026-12-03T21:44:28Z;
origin/mainis nowc9aa1e66("Merge pull request #2242 from FastLED/agent/1298-ino-preprocess"). Merge-group run 47207676993 succeeded (all jobs;linux / Checkincluded), and the push run atc9aa1e66is 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.inobranch ofplan_unitthat reusesSourceScanneris live.Real e2e recorded on the PR:
arduino:avr:unofull Blink → 24/24 core units,core.a340,294 B, link exit 0, ELF32 AVR EXEC (text 956);Seeeduino:mbed:xiaonRF52840Plussketch 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.
zackees commentedon Dec 4, 2026
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:
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}", thenrecipe.c.combine.patternlinks-T{build.path}/{build.ldscript}.fbuild fqbn --linknow 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).variants/<board>/*intocore.anext tocores/<core>/**(its own files only). Withoutvariant.cppthe archive builds clean and the ELF dies withundefined reference to g_APinDescription / PINCOUNT_fn / getUniqueSerialNumber / _ontouch1200bps_— the exact failure this run hit before the fix.core_sourcesnow includes those files.Real e2e (published index: core 34,722,259 B sha256
65d9de0b…, toolchain arm-none-eabi 7-2017q4 sha25696a029e2ae13…, canonical layout): 42 core units →core.a27,637,612 B, sketch TU 936,772 B,link_hooks_run=1,link_exit=0→Blink.elf1,732,660 B, ELF32 ARM EXEC, entry0x2fb6d, symbolsmain/setup/loop; the hook'sbuild/linker_script.ldis 4,242 B and preprocessed (FLASH ORIGIN = 0x27000, no#defineremaining).Gates: engine 709 passed / 0 failed / 6 ignored, cli 589 passed / 0 failed, clippy 0 (engine+cli,
-D warnings), boundaryrows=0; dylint_rows=0, fmt clean. RED twice: disabling the hook loop failsa_prelink_hook_runs_before_the_linker_and_blocks_it_when_it_cannot_run(19/1, exit 101); dropping the variant walk failsthe_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.
zackees commentedon Dec 4, 2026
Merged: #2243 ->
origin/maine3c85381(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>.patternplanned in numeric order and run beforerecipe.c.combine.pattern; a failing hook stops the link, names its key and writes no image.core_sourcesnow includesvariants/<build.variant>/*(top level only), without whichcore.alinks clean and the ELF dies onundefined reference to g_APinDescription / PINCOUNT_fn.link_hooks=N,link_hook.<i>=,link_hooks_run=N; JSONlink.hooks[],link_outcome.hooks.Real e2e on the published
Seeeduino:[email protected]package (checksums matched the index): 42 core units ->core.a27,637,612 B; sketch TU 936,772 B;link_hooks_run=1,link_exit=0->Blink.elf1,732,660 B, ELF32 ARM EXEC, entry0x2fb6d,main/setup/loop; the hook'slinker_script.ldis 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.rscarriesprelink_hooks(), and the three post-merge board dispatches (Uno / Teensy 4.1 / ESP32 Dev) are green one3c85381.#1298 stays open — the remaining cells are the
.inoupload/objcopy half andfbuild deployagainst a vendor core.zackees commentedon Dec 4, 2026
Steward receipt — follow-up 4f: the firmware images of a vendor core (PR #2246, merged).
origin/mainis nowafafa8de("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>.elfplans and runs every non-emptyrecipe.objcopy.<ext>.patternthe package declares, in name order(
bin,eep,hex,zip). Order is a rule, not a nicety: the realSeeeduino:[email protected]recipe.objcopy.zip.patternpackages{build.project_name}.hex, not the ELF, sohexmust run first.recipe.objcopy.eep.pattern=withno value, and Arduino skips it.
{build.path}/{build.project_name}.<ext>from theELF's own directory and stem, and the expansion must name that path, so a
recipe writing elsewhere is refused by name.
.eeprecipe legitimately writes 0 bytes for a sketch with no EEPROM data,while a step that exits 0 and writes nothing at all fails.
objcopy_elf,objcopy_images,objcopy_image.<i>,objcopy_recipe.<i>,objcopy_command.<i>,objcopy_exit,objcopy_written,objcopy_bytes.<i>;--link+--objcopywork in oneinvocation.
Real e2e, real
arduino:[email protected]package + avr-gcc 7.3.0 (no fixture):24/24 core units →
core.a347,362 B → sketch TU →Blink.elf14,160 B(
link_exit=0) →--objcopy build/Blink.elf --run→objcopy_written=2,build/Blink.hex2,615 B Intel HEX (first bytes:100000000C945C0),build/Blink.eep13 B, exit 0.Gates: engine 716 passed / 0 failed / 6 ignored; cli 592 passed / 0 failed;
clippy 0 (engine+cli,
-D warnings); boundaryrows=0; dylint_rows=0; fmtclean. 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.rsdeclares
pub mod fqbn_objcopy;andargs.rscarries 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.zackees commentedon Dec 4, 2026
Steward receipt — follow-up 4g: the package's own uploader (PR #2249, merged).
origin/mainis nowdb1e254a("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'stools.<tool>.upload.pattern, where<tool>comes fromupload.tool.<protocol>→upload.tool.default→upload.tool.{serial.port}is never defaulted;{upload.verbose}istools.<tool>.upload.params.<level>and{upload.verify}istools.<tool>.upload.verify(the AVR core declares it empty — the package's value, not an invented default).{cmd.path},{config.path},{path}) now resolve insidetools.<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.-Uflash:w:<path>.hex:i; a recipe naming a different file is still refused..elfinput and an absent--portare refused before anything runs.Real e2e,
arduino:[email protected]from the published index (checksums verified), no board flashed: 25 core units →core.a353,404 B → sketch TU 3,916 B →Blink.elf14,200 B →--objcopy→Blink.hex2,611 B +Blink.eep13 B →--uploadprints--runagainst 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 warningsexit 0; fmt clean; boundaryrows=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.rsexists andargs.rscarries the--uploadsurface.#1298 stays open — library discovery and
fbuild build --fqbnare the cells left.zackees commentedon Dec 4, 2026
Steward receipt — follow-up 4h: the libraries a sketch includes (PR #2250, merged).
origin/mainis now66c05e00("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
#includelines 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_librariesis that step:library.propertiesincludes=→ 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 wrongutility/twi.his invisible until the link.libraries/, then<data_dir>/libraries, then each--library-root.src/-rooted (sources recursive belowsrc/, one include dir); 1.0-format compiles from its root plusutility/, and never fromexamples//extras/.stdint.his 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]reportslibrary_count,library.<i>,library_root.<i>,library_include.<i>.<j>,library_source.<i>.<j>,unresolved_header.<i>(JSON:libraries); a--compileof 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:The expanded command carries all five library
-Idirectories; a deliberately missing<NotInstalledHere.h>was reported asunresolved_header.0and 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 warningsexit 0; boundaryrows=0; dylint_rows=0; research--checkexit 0; fmt clean;soldr lint rust --check --cross-dylintexit 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.rsunder the 1000-line gate — the first push was red onban_std_pathbuf(a localVec<PathBuf>), fixed in738ae39c.#1298 stays open — the remaining cell is
fbuild build --fqbn.zackees commentedon Dec 4, 2026
Steward receipt — follow-up 5:
fbuild buildfrom an FQBN (PR #2251).origin/mainis66c05e00(follow-up 4h merged). The pieces existed one stepat a time — resolve, recipe, compile, archive, link, objcopy, upload,
libraries — and this is the driver that runs them in Arduino's order:
core.a(rebuilt) → libraries(
libraries.prebuild) → sketch (sketch.prebuild, generated tab +the sketch's own
src/) → link (recipe.c.combine.pattern+ its numericpre-link hooks) →
recipe.objcopy.*in name order →postbuild. The buildstops at the first failing stage and names it; the report is in band, so the
counts of the stages that ran survive the failure.
build.path: objects live undercore/,core/variant/,libraries/<name>/andsketch/, but every recipe expands{build.path}tothe one root (
plan_unit_in;plan_unit's inferred form is unchanged).fqbn_libraries::plan_for_sketch,sketch preprocessing is the shared
source_scanner, archiving/linking/pre-linkhooks are
fqbn_link.driver does not run (
core.prebuild,objcopy.*,savehex.*) is refused bykey, because silently skipping a stage is firmware the package did not
describe.
Real e2e, no fixtures:
The mbed run exercised the package's own pre-link hook (
-E -Pof the variantlinker script into
build.path) and itsnrfutilpackaging recipe (that tool isinstalled 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 warnings0, Windows MSVC clippy 0, macOS aarch64 check 0, boundaryrows=0; dylint_rows=0, research--check0, fmt clean; RED twice.This closes the build-driver cell. #1298 stays open for the remaining open
question — the user-facing surface (
fbuild build --fqbnvs this additive flagon
fbuild fqbn) is a maintainer decision, and the driver is deliberately thefbuild fqbnsurface the last four follow-ups built.zackees commentedon Dec 4, 2026
Merged. PR #2251 is on
mainas0db2944a(merge group 47360619158 green, nonon-success job; merged 2026-12-04T15:15:51Z). Trunk verified:
lib.rsdeclarespub mod fqbn_build;(module 813 lines) andargs.rscarries the--buildflag on
fqbn.So every stage of the issue's proposal is now in-repo and exercised end to end on
the motivating Seeed core:
fqbn.rsfqbn_install.rsboards.txt/platform.txt/ menus / tools / variants —fqbn.rs,fqbn_toolchain.rsBoardConfig—ResolvedFqbn::board_configfbuild buildstill takes aplatformio.ini)the vendor recipes and real package trees, not a shelled-out CLI
unplaceable hooks) plus the original unsupported-platform diagnostic still
covered by the PlatformIO tests
Seeeduino:mbed:xiaonRF52840Plusbuilds Blink natively:42 core units →
core.a27,637,612 B → ELF 1,732,744 B →.bin/.hex/.zipThe 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 toreinterpret the
buildsubcommand) or stay the additivefbuild fqbn … --buildthat the six follow-ups built. That is a maintainer call; this issue can be
closed or kept as a tracking ticket for it.
zackees commentedon Dec 4, 2026
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 thatfbuild build --fqbn"can only land once a resolved FQBN can be mapped onto anorchestrator".
docs/reference/cli.mdclosed its FQBN section with "Librarydiscovery,
recipe.hooks.*andfbuild build --fqbnremain the open cells".None of that is true on
main(0db2944a).PR #2252 (docs only) records what shipped, one section per cell:
because
ar rcsappends and a stale member links code that is not in thetree);
object_filesone quoted argument per object; the output must be<name>.elf, so a caller asking for.binis refused by name..inostage reusessource_scanner; the generated tab lives atbuild.path/sketch/<name>.ino.cppand the sketch's own non-.inosourceskeep their own recipe.
recipe.hooks.linking.prelink.<n>.patternin numeric order, andvariants/<board>/*(top level) is part ofcore.a.recipe.objcopy.*in name order (mbed's.zippackages the.hex), an empty recipe skipped, success = the declared image exists.includes=→ folder stem → holder), root precedence,1.5
src/-rooted vs 1.0 root+utility/, transitive,unresolved=entry-file includes only.
plan_builddata vsbuildthe onlyspawner, one build root through
plan_unit_in, hook stages run vs refusedby 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] xiaonRF52840Plusthird row builds end to end:42 core units →
core.a27.6 MB → ELF 1,732,744 B →.bin/.hex/.zip85,441 B, exit 0). What remains is not code:
fbuild buildis the PlatformIO entry point; whether italso takes an additive
--fqbn(plus aboard_build.fqbnkey) is a routingdecision. The capability already exists behind
fqbn … --build.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.
zackees commentedon Dec 4, 2026
Merged. PR #2252 is on
mainasc34febb5("Merge pull request #2252 fromFastLED/agent/1298-fqbn-doc-driver"), merge-queue group 47377981242 green; merged
2026-12-04T16:46:21Z. Trunk verified:
docs/design/fqbn-resolution.mdcarries the sixnew sections (
4c,4d,4e,4f,4h,5) anddocs/reference/cli.mdcarries### fqbn --sketch, --library-root and --build.Checks before the queue: all pass, 0 failures (
linux / Check11m12s,dylint / Rust lint2m2s,Render-and-diff39s),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 --fqbnsurface, and the orchestrator for acore-named
build.mcu); the issue block is pinned to its current body.