Skip to content

fix(toolchain): scope registry-resolved toolchain to its MCU chip (slice was never selected) - #1963

Merged
zackees merged 1 commit into
mainfrom
agent/registry-toolchain-slice
Nov 8, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/registry-toolchain-slice

Conversation

@zackees

@zackees zackees commented Nov 8, 2026

Copy link
Copy Markdown
Member

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 the
from_resolved/metadata path. Both from_registry_payload call sites returned
the package unscoped:

  • resolve_and_create_toolchain (live resolution)
  • provision_toolchain (cached payload)

PackageBase::published_slice starts with self.slice_chip?, so with no chip the
function returns before manifest_enabled/published_manifest are ever
called. That is the whole of #1961: FBUILD_MIRROR_MANIFEST_URL looked broken
because nothing consulted the manifest for this package — the override was
read fine (its source-url sidecar was written), it just had no reader.

This is the normal path on the bundled espressif32 platform: its
platform.json declares toolchain-xtensa-esp-elf as a registry version
(owner: platformio), not a metadata URL, so has_unified_toolchain is false and
the registry branch is taken.

Fix

  • New registry_toolchain(...) helper: from_registry_payload(...) plus
    with_slice_variant(&mcu_config.mcu) for Xtensa (RISC-V multilibs are ISA
    shaped, never sliced, so they keep the shared directory).
  • Both registry call sites go through it.
  • Esp32Toolchain::chip_install_path() exposes the chip-scoped install
    directory, so the call-site wiring is assertable from outside the crate.

Evidence

Measured on linux-amd64 with an isolated cache and FBUILD_MIRROR_MANIFEST_URL
pointed at the published manifest (site/mirror/manifest.json), esp32s3 fixture:

Tests: soldr cargo test -p fbuild-build-esp --lib (below). The new test is a
red witness: with registry_toolchain reverted to return from_registry_payload
unscoped 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.

`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.
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@zackees
zackees added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 186e127 Nov 8, 2026
39 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 9, 2026
@zackees
zackees deleted the agent/registry-toolchain-slice branch November 24, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

bug(ci): FBUILD_MIRROR_MANIFEST_URL does not move slice resolution — a new host slice cannot be proven before it is listed

1 participant