Repository navigation
feat(ci): slice ESP toolchains per chip (#1944 server half) - #1947
Merged
Merged
Conversation
per-chip archives are the remaining ~95 MB of the ESP32-S3 install budget: #1944 measured 660 MB extracted -> 75.3 MB for esp32s3 at zstd -19 against a 168 MB vendor download. This adds the slicer; publishing and client resolution follow. Selection is by path component (any path naming a chip), so bin/libexec/ include and the top-level multilib archives stay in every slice. Fails closed on an unknown chip, a tree with no per-chip dirs, an escaping symlink, and a symlink whose in-tree target the slice drops; an in-tree .. link is kept. --verify extracts the slice and runs that chip's compiler from it (version, libgcc resolving inside the slice, a real C++ compile).
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This was referenced Nov 7, 2026
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.
Server half of #1944's remaining option: publish a single-chip, zstd-compressed
toolchain instead of the 168 MB unified download.
Why
#1944 measured the composition of the 660 MB installed
xtensa-esp-elftree:the per-chip SDK libs are the removable bulk (
lib/esp32204 MB,lib/esp32s2103 MB,
lib/esp32s3102 MB), whilebin/libexec(80 MB each) and thetop-level multilib archives are chip-shared. Compression alone saves 42 MB and
still lands at ~4.0 min on a 10 Mbit link; dropping the sibling chips is what
buys the rest.
What this adds
ci/slice_toolchain.py— one deterministictar.zstper chip, plus aslices.jsonindex carrying the samemanifest_slicesshape the ESP libsslicer emits (url/sha256/size/format per chip).
component names a chip (
lib/esp32s3,lib/gcc/<triple>/<version>/esp32s3),so shared content is never dropped by a hardcoded list going stale.
single-threaded encoder. Two runs of the same tree are byte-identical.
directories (never emit a "slice" that is a whole-tree copy), an absolute or
escaping symlink, and a symlink whose in-tree target the slice drops. An
in-tree
..link is kept — the real toolchain shipslib/bfd-plugins/liblto_plugin.so -> ../../libexec/.....install_completeis never archived: a stale marker inside a slice would letan interrupted extraction pass as a complete install.
--verifyextracts each slice and runs that chip's compiler from theextraction:
--version, a-print-libgcc-file-namethat must resolveinside the slice, and a real
-std=gnu++17 -Os -c.--checkrecomputes andcompares without writing.
Measured on the real toolchain (not a paper size)
Cached production
xtensa-esp-elf13.2.0 tree,--chips esp32s3 --verify:00a6ca50…c66cVerification output from the extracted slice itself:
xtensa-esp32s3-elf-gcc (crosstool-NG esp-13.2.0_20240530) 13.2.0,libgcc=lib/gcc/xtensa-esp-elf/13.2.0/esp32s3/libgcc.a(inside the slice),and the probe TU compiled with exit 0.
Projection on #1944's own measured rate (68.7 MB/min): after #1945's 70 MiB
esptool cut the install is ~317 MB / 4.62 min; swapping 168 MB of toolchain for
75.3 MB gives ~222 MB / 3.24 min, i.e. inside the issue's under-4-min target.
Tests
ci/test_slice_toolchain.py— 11 tests, registered inci/local_suites.py(
LOCAL_ONLY_MODULES, same lane as the ESP libs slicer). Real runs:Ran 11 tests ... OK;ruff check ci/clean;ci/check_python_complexity.pyclean;
ci/gate_script_coverage.py --budget 0reports every workflow-invokedgate accounted for.
Three mutations each kill their tests (selection keeps everything → 8 failures,
incl. the new fail-closed post-condition; libgcc containment not checked → the
outside-the-slice test; install marker shipped → 2 marker tests).
Not in this PR
Publishing (mirror upload + shard/manifest registration) and the client half
(resolve toolchain URL + MCU → slice, whole archive as fallback) are the
follow-ups;
ci/publish_esp_slices.pyis the model. Until then no clientconsumes these archives, and the slice has not yet been exercised by a real
fbuild buildfor an ESP32-S3 sketch — that is the end-to-end gate for theclient PR.