Skip to content

feat(fqbn): decide which orchestrator a resolved FQBN claims (#1298) - #2232

Merged
zackees merged 1 commit into
mainfrom
agent/1298-orchestrator-claim
Dec 1, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/1298-orchestrator-claim

Conversation

@zackees

@zackees zackees commented Dec 1, 2026

Copy link
Copy Markdown
Member

What this decides

A resolved FQBN names a board, properties and a package — but nothing said which
native orchestrator would build it. This implements #1298's follow-up 2 as 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 (atmega328p -> atmelavr,
esp32* -> espressif32, nrf52* -> nordicnrf52, …). No second table, so an
FQBN and a PlatformIO board naming the same chip cannot disagree, and a new chip
gains FQBN support the day the board database learns it.

Architecture is never the input. The measured Seeed package is the
counter-example: Arduino's mbed architecture covers nRF52 and RP2040, and
build.mcu=cortex-m4 names an ARM core that fbuild's nRF52 and SAMD
orchestrators could both claim. A core name claims nothing and is refused with
the identity, architecture and build.mcu named — guessing would compile another
family's link script, start files and flash tooling and only fail on hardware.

fbuild fqbn now reports the outcome beside the properties:

fqbn=arduino:avr:demo
orchestrator=atmelavr
board.build.mcu=atmega328p
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

--json carries "orchestrator": "atmelavr" or "orchestrator": null plus
"orchestrator_error". A refusal is not a query failure: the properties are
still the answer, so the exit code stays 0.

RED evidence

Removing the claim branch (if let Some(platform) = board.platform() { return Ok(platform) })
and rerunning the module:

test fqbn::tests::a_chip_named_fqbn_claims_the_avr_orchestrator ... FAILED
test fqbn::tests::a_chip_named_esp32_fqbn_claims_the_espressif_orchestrator ... FAILED
test result: FAILED. 13 passed; 2 failed; 0 ignored; 0 measured; 618 filtered out
exit=101

Restored -> test result: ok. 15 passed; 0 failed.

Gates (real output)

Gate Result
soldr cargo test -p fbuild-build-engine fqbn 15 passed / 0 failed (12 existing + 3 new)
soldr cargo test -p fbuild-cli --bin fbuild fqbn 14 passed / 0 failed (12 existing + 2 new)
soldr cargo clippy -p fbuild-build-engine -p fbuild-cli --all-targets -- -D warnings exit 0
soldr cargo fmt --all -- --check exit 0
ci/enforce_platform_boundary.py --print-totals rows=0; dylint_rows=0
real binary, synthetic installed packages orchestrator=atmelavr for a chip-named board; orchestrator_error=…cortex-m4… for a core-named one

New tests: a_chip_named_fqbn_claims_the_avr_orchestrator,
a_chip_named_esp32_fqbn_claims_the_espressif_orchestrator,
an_arm_core_mcu_claims_no_orchestrator_and_names_the_core,
a_core_named_mcu_reports_the_refusal_beside_the_properties,
a_core_named_mcu_reports_the_refusal_in_json.

Docs

docs/design/fqbn-resolution.md gains "Follow-up 2: the claim rule (implemented)"
and its follow-up list is updated; docs/reference/cli.md documents the two new
output keys.

What this does not do

No compile yet: fbuild build --fqbn + board_build.fqbn (follow-up 1's
remainder) and the compiler.path toolchain mapping, plus an explicit ruling for
core-named vendor cores, are still open. #1298 stays open.

A resolved FQBN names a board, but nothing said which native orchestrator
would build it. This implements follow-up 2's decision as 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 new chip
gains FQBN support the day the database learns it. Architecture is never
the input: Arduino's `mbed` architecture covers nRF52 and RP2040.

A core-named MCU (`cortex-m4`, the measured Seeed package) claims nothing
and is refused with the identity, architecture and mcu named, because
guessing compiles another family's link script and fails on hardware.
`fbuild fqbn` reports `orchestrator=<platform>` or `orchestrator_error=`
beside a still-successful resolution; `--json` carries the same pair.
@zackees
zackees added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 00fd80f Dec 1, 2026
44 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant