Repository navigation
feat(fqbn): decide which orchestrator a resolved FQBN claims (#1298) - #2232
Merged
Merged
Conversation
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.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
ResolvedFqbn::platform()delegates toBoardConfig::platform()— the boarddatabase's existing
mcu -> Platformowner (atmega328p->atmelavr,esp32*->espressif32,nrf52*->nordicnrf52, …). No second table, so anFQBN 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
mbedarchitecture covers nRF52 and RP2040, andbuild.mcu=cortex-m4names an ARM core that fbuild's nRF52 and SAMDorchestrators could both claim. A core name claims nothing and is refused with
the identity, architecture and
build.mcunamed — guessing would compile anotherfamily's link script, start files and flash tooling and only fail on hardware.
fbuild fqbnnow reports the outcome beside the properties:--jsoncarries"orchestrator": "atmelavr"or"orchestrator": nullplus"orchestrator_error". A refusal is not a query failure: the properties arestill 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:
Restored ->
test result: ok. 15 passed; 0 failed.Gates (real output)
soldr cargo test -p fbuild-build-engine fqbnsoldr cargo test -p fbuild-cli --bin fbuild fqbnsoldr cargo clippy -p fbuild-build-engine -p fbuild-cli --all-targets -- -D warningssoldr cargo fmt --all -- --checkci/enforce_platform_boundary.py --print-totalsrows=0; dylint_rows=0orchestrator=atmelavrfor a chip-named board;orchestrator_error=…cortex-m4…for a core-named oneNew 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.mdgains "Follow-up 2: the claim rule (implemented)"and its follow-up list is updated;
docs/reference/cli.mddocuments the two newoutput keys.
What this does not do
No compile yet:
fbuild build --fqbn+board_build.fqbn(follow-up 1'sremainder) and the
compiler.pathtoolchain mapping, plus an explicit ruling forcore-named vendor cores, are still open. #1298 stays open.