Repository navigation
fix(toolchain): scope registry-resolved toolchain to its MCU chip (slice was never selected) - #1963
Merged
Merged
Conversation
`Esp32Toolchain::with_slice_variant` was applied only on the metadata/`from_resolved` path. Both `from_registry_payload` call sites returned the package with no `slice_chip`, so `PackageBase::published_slice` returned at `self.slice_chip?` before ever consulting the mirror manifest and every build downloaded the whole 168 MB Xtensa archive although a per-chip slice is published and listed. That is #1961: `FBUILD_MIRROR_MANIFEST_URL` looked inert because nothing read the manifest for this package, not because the override failed (its `source-url` sidecar was written correctly all along). The bundled `espressif32` platform declares `toolchain-xtensa-esp-elf` as a registry version, not a metadata URL, so the registry branch is the normal path there. RISC-V keeps the shared directory: its multilibs are ISA shaped and never sliced. Measured on linux-amd64 (esp32s3 fixture, isolated cache, manifest override set): 106 MB chip slice instead of the whole archive, install in `...-gnu+esp32s3/`, output unchanged at flash 356075 / ram 74919.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This was referenced Nov 8, 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.
What
The Xtensa toolchain package from a PlatformIO-registry payload never learned
which chip the build targets, so it never asked the mirror manifest for a
published per-chip slice and downloaded the whole archive every time.
Esp32Toolchain::with_slice_variant(#1944) was only applied on thefrom_resolved/metadata path. Bothfrom_registry_payloadcall sites returnedthe package unscoped:
resolve_and_create_toolchain(live resolution)provision_toolchain(cached payload)PackageBase::published_slicestarts withself.slice_chip?, so with no chip thefunction returns before
manifest_enabled/published_manifestare evercalled. That is the whole of #1961:
FBUILD_MIRROR_MANIFEST_URLlooked brokenbecause nothing consulted the manifest for this package — the override was
read fine (its
source-urlsidecar was written), it just had no reader.This is the normal path on the bundled
espressif32platform: itsplatform.jsondeclarestoolchain-xtensa-esp-elfas a registry version(
owner: platformio), not a metadata URL, sohas_unified_toolchainis false andthe registry branch is taken.
Fix
registry_toolchain(...)helper:from_registry_payload(...)pluswith_slice_variant(&mcu_config.mcu)for Xtensa (RISC-V multilibs are ISAshaped, never sliced, so they keep the shared directory).
Esp32Toolchain::chip_install_path()exposes the chip-scoped installdirectory, so the call-site wiring is assertable from outside the crate.
Evidence
Measured on linux-amd64 with an isolated cache and
FBUILD_MIRROR_MANIFEST_URLpointed at the published manifest (
site/mirror/manifest.json), esp32s3 fixture:fbuild_packages_fetch::chip_slice: downloading esp32-xtensa-gcc vxtensa-esp-elf-14.2.0_20260121-x86_64-linux-gnu esp32s3 chip slice (106 MB)toolchains/toolchain-xtensa-esp-elf/<id>/…-gnu+esp32s3/with
.install_complete;flash: 356075 bytes, ram: 74919 bytes(identical tothe issue's control build).
Tests:
soldr cargo test -p fbuild-build-esp --lib(below). The new test is ared witness: with
registry_toolchainreverted to returnfrom_registry_payloadunscoped it fails with
the registry toolchain must carry its MCU's chip.Scope
Additive; no behaviour change for the metadata path, no new crate, no board
literals. RISC-V is deliberately excluded so its whole archive keeps the shared
install directory instead of fragmenting per chip.
Closes #1961.