Repository navigation
feat(toolchain): publish per-chip Xtensa toolchain slices - #1951
Merged
Merged
Conversation
The slicer (#1947) and the client (#1949) were done; nothing published had a slice for a client to resolve, so every ESP32 build still downloaded the whole 176 MB unified Xtensa archive. This is the server side. `ci/publish_toolchain_slices.py` publishes ONE host package of ONE version: it runs the slicer, uploads each chip archive to `v1/espressif/<toolchain>/release/<version>/<host>/<chip>/` as public-read, HEAD-checks every upload, and only then writes the shard component plus its Index descriptor. Integrity pins come from the vendor metadata, so a mismatched local tree cannot relabel the asset; `--archive` mirrors the whole bundle only when its bytes match those pins. Chips merge into an existing component, so a later `--chips esp32` cannot retract an earlier `esp32s3`. `--check` verifies the Index descriptor still hashes the committed shard -- the Index is a generated document, and a regeneration that does not know this owner would silently send every client back to whole archives. Published and verified for linux-amd64 / 14.2.0_20260121: esp32s3 106,462,349 B, esp32s2 106,655,161 B, esp32 141,361,956 B (vendor 176,559,292 B). Each was sliced with --verify, then downloaded again post-upload and hashed to its pinned sha256; the esp32s3 object was extracted from the download and its compiler used (`crosstool-NG esp-14.2.0_20260121 14.2.0`, libgcc resolving inside, probe TU compiling). The committed shard is parsed by the real client parser in a unit test: one bad entry rejects the WHOLE manifest for every client, so this is checked, not hoped.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
The committed-manifest contract (enforced by committed_manifest_is_accepted_and_prefers_the_bucket) requires every published entry to serve the mirror first and keep the vendor URL as the fallback. My first cut listed the vendor URL alone, so a slice-less chip or an unpublished host would have depended on GitHub for every download. --archive is now required and must hash to the metadata pins; it is uploaded and listed first.
This was referenced Nov 7, 2026
5 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.
Publishes the server half of the per-chip toolchain slices:
@esp-toolchainnowexists as a mirror shard, and the three Xtensa chips' toolchain slices it points
at are uploaded and verified. Closes the "publishing the slices" item that #1944
has been waiting on since #1947 (slicer) and #1949 (client).
What lands
ci/publish_toolchain_slices.py— one invocation publishes ONE host packageof ONE toolchain version: it runs the existing slicer, uploads each per-chip
archive under
v1/espressif/<toolchain>/release/<version>/<host>/<chip>/(
public-read), HEAD-checks every upload, and only then writes the shardcomponent plus its Index descriptor.
site/mirror/shards/esp-toolchain.json+ one line insite/mirror/manifest.json— the
@esp-toolchainshard keyed by the exact vendor URLcrates/fbuild-toolchainresolves from the pioarduino metadata, listing oneslice per chip the toolchain ships:
esp32,esp32s2,esp32s3.ci/test_publish_toolchain_slices.py— 28 offline contract tests.crates/fbuild-packages-fetch/src/downloader_mirror_manifest_tests.rs— thecommitted shard is parsed by the REAL client parser, because one bad entry
rejects the whole manifest for every client.
Design choices worth reviewing
sha256and
sizeare the vendor's numbers for that exact URL, so a mismatched treecannot relabel the asset.
--archivemirrors the whole bundle and refuses afile that disagrees with those pins; without it the entry lists the vendor URL
alone, i.e. the download behaviour of every host/chip without a slice is
unchanged.
compilers, so a
linux-amd64slice is not amacos-arm64install. Chips aremerged into the existing component, so publishing
esp32later cannot retractthe
esp32s3slice (test-pinned in both directions).untouched, so an entry can never point at a missing object (test-pinned).
--checkneeds no network and fails when the Index descriptor no longerhashes the committed shard — the Index is generated, so a regeneration that
does not know this owner would silently send every client back to whole
archives.
Real run (not a projection)
Extracted
xtensa-esp-elf14.2.0_20260121 x86_64-linux-gnu tree (1.1 GB, 4187members, chips esp32/esp32s2/esp32s3) from this host's fbuild cache; the vendor
archive is 176,559,292 B:
36a9f0e7…f085811564ea6…c553037802e0…374dEach was produced with
--verify(extract, run that chip's compiler,-print-libgcc-file-nameresolving inside the extraction, then a real-std=gnu++17 -Os -c); esp32s3 took 6m24s and the pair 11m.Verified again AFTER upload by downloading each published object over HTTPS
(
200,content-length= the pinned size) and hashing it to the exact pinnedsha256; the esp32s3 object was also byte-compared with the local slice, then
extracted from the DOWNLOAD of it and used: its
xtensa-esp32s3-elf-gccreportscrosstool-NG esp-14.2.0_20260121 14.2.0, libgcc resolves inside, and a probecompiles. The archive carries no
.install_complete.--checkpasses against the committed documents; the Rust test parses them andresolves the vendor URL to the slice, and goes RED when the slice
formatiscorrupted (the whole document is then rejected, which is the failure it guards).
Tests
uv run --no-project --with zstandard python -m unittest ci.test_publish_toolchain_slices— 28 passed.soldr cargo test -p fbuild-packages-fetch --lib -- committed_toolchain_shard— 1 passed.ci/test_local_suites,ci/test_gate_script_coverage,ci/test_slice_toolchain— pass.44/43rc0, test layout ok, dylint allowlists ok,ruff check+ci/check_python_complexityclean.Not done here
macos-arm64,win32, ...) is one command each andneeds that host's extracted tree; until then those hosts keep the whole
archive. Re-slicing a chip later is also a no-op for the others (the shard
merges per chip, test-pinned).
needs the shard live on
main(clients read the published manifest), so it isthe follow-up this unblocks — CI's ESP32 board matrix exercises it on the next
push to main.