Repository navigation
feat(fqbn): install a vendor package and its tools from a package index (#1298) - #2234
Merged
Merged
Conversation
…ex (#1298) Cell 3 of the FQBN work: resolution read only packages an Arduino tool had already installed, so the motivating Seeeduino:mbed core still needed `arduino-cli core install` first. `fbuild fqbn <FQBN> --install --package-index <file>` now installs the package and every tool it depends on. - Trust root is the caller-supplied index file: no search, no default URL. Every archive is matched against that file's SHA-256 and size, so transport is not the identity. Measured: the published Seeeduino index serves openocd and mkspiffs over plain http, so https-only made the package uninstallable; http/https are accepted, any other scheme is refused by name. MD5 or a non-64-hex digest is refused, as is a missing size. - Verification happens before extraction (size, then SHA-256), into a staging dir inside the data dir, renamed into place after validation: a package must carry boards.txt + platform.txt, a tool must be non-empty, and a single top-level wrapper directory is flattened. - Offline reuse: an installed target is skipped with zero requests. - Published indexes carry junk (a platform object inside the Seeed `tools` array); every model field is optional so an unrelated malformed entry cannot make the whole index unusable. - No post-install hook execution, no index discovery, and no download during a build. Tests: fqbn_install 19 (engine fqbn* 51), CLI fqbn 22 (4 new); RED proven twice (verification disabled -> 2 failed; reuse disabled -> 1 failed). Refs #1298 (stays open).
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 delivers
Cell 3 of #1298: the FQBN path could resolve an installed vendor core but not
install one, so the motivating
Seeeduino:mbed:xiaonRF52840Plusrepro stillneeded
arduino-cli core installfirst. This adds the install as a separate,explicit verb:
The plan (one line per archive) goes to stderr before the first fetch; the
report (
target=… state=installed|reused destination=… bytes=…) goes to stdout.Design (record updated:
docs/design/fqbn-resolution.md§Follow-up 3)and there is no default URL, because installing from an index is code
execution. Every archive is matched against that file's
SHA-256andsize,so the transport is not the identity:
httpandhttpsare both accepted(measured — the published Seeeduino index serves
openocdandmkspiffsoverplain
http, so an https-only rule made the package uninstallable), any otherscheme is refused by name,
MD5is refused by name, a digest that is not 64hex characters is refused, and a missing
sizeis refused.existing
extractor(hostile-tar + long-path guards) into a staging dirinside the data dir, renamed into place only after validation. A package must
carry
boards.txt+platform.txt; a tool must be non-empty; a singletop-level wrapper directory is flattened (
gcc-arm-none-eabi-7-2017-q4-major/).packages/<vendor>/hardware/<arch>/<version>andpackages/<packager>/tools/<name>/<version>layout, so the resolver and thetoolchain mapping (cells 1–2b) read them with no migration. An installed
target is reused with zero requests.
object inside a
toolsarray (nohost); a strict parse rejected the wholefile and made every other package in it unusable. Every model field is
optional, so an unrelated malformed entry never matches a selection.
Deliberately not done, and said so in the record: no post-install hook
execution (
recipe.hooks.*is recipe evaluation, follow-up 4), no indexdiscovery / "latest" tracking, and no download of any kind during a build.
Real end-to-end evidence
Against the published index (290,172 B) on this host:
state=reused bytes=0, no network.fbuild fqbn Seeeduino:mbed:xiaonRF52840Plus --arduino-data-dir ./dataon thefreshly installed tree:
toolchain=arm-none-eabi-gcc@7-2017q4,compiler=…/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-gcc.ELF32object with the board's own-mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16;--version=7.2.1 20170904.Gates (real output)
fqbn_install19/19;-p fbuild-build-engine --lib fqbn51 passed, 0 failed.-p fbuild-cli --bin fbuild fqbn22 passed, 0 failed (4 new: flag parse,--installwithout an index refused by clap, missing index named, reportrendering).
-p fbuild-build-engine -p fbuild-cli --all-targets -- -D warnings:0 errors/warnings;
cargo fmt --all -- --checkclean; platform boundaryrows=0; dylint_rows=0.size mismatch), with reuse disabled 1 failed (the reuse test); restored, 19/19.
Refs #1298 (stays open — the build-side
--fqbnwiring and recipe evaluation arestill follow-ups).