Repository navigation
feat(esptool): provision the 617 KiB source archive instead of the 82 MiB bundle - #1945
Merged
Merged
Conversation
… MiB bundle A cold install on a 10 Mbit link moved 399 MB, 82.5 MiB of it the PyInstaller esptool bundle - 20% of the download for one elf2image call per image (#1944). pioarduino publishes the same release as a 617 KiB source archive, which fbuild already installs in a private uv tool environment for Windows. Every host now takes the source archive. A host that cannot build that environment (no uv, no interpreter, no PyPI) falls back to the standalone binary instead of failing the build; Windows keeps the failure fatal because releases like 5.1.0 are source-only there. Measured on a real ESP32-S3 bootloader ELF: byte-identical images (sha256 3ef75dd1...), and elf2image is faster warm (0.10 s vs 0.29 s) since the PyInstaller one-file bundle unpacks ~217 MB per invocation.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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.
Why
#1944: a cold
fbuild installon a 10 Mbit link takes 5.81 min / 399 MB forESP32-S3. 82.5 MiB of that was the
tool-esptoolpyPyInstaller bundle — 20% of the wholefirst-time download, for a tool fbuild uses for exactly one
elf2imagecall per image.pioarduino already publishes the same esptool release as a 617 KiB source archive
(
esptoolpy-v<ver>.zip→v<ver>/esptool.zip). fbuild has installed that archive in a privateuv toolenvironment for Windows since #1678 (some releases, e.g. 5.1.0, have no Windows binary atall); this PR takes it on every host.
What changed
Esptool::select_source_url(new, extracted fromfrom_metadata_url_for_host): theregistry-shaped
esptoolpy-v<version>.zipmapping is no longer gated onis_windows(). Everyhost gets the 617 KiB archive; anything else keeps the old standalone-binary path.
ensure_standalone_installed(new): the PyInstaller body ofensure_installedmoved hereunchanged.
ensure_installed: a failed source install on a host that has a standalone binary falls backto it with a
warn!instead of failing the build. Windows keeps it fatal — there the sourcearchive is the install.
Measured, not assumed (this host, real network)
elf2image(ESP32-S3 bootloader ELF, warm)sha256=3ef75dd1e480cfca…(18,720 B) for the samebootloader_dio_80m.elf. The Python entry point is also faster warm, because the PyInstallerone-file bundle unpacks ~217 MB on every invocation.
ensure_installed(download → extract →uv tool install→ version verify → locate launcher): 26.8 s, then 4.2 s warm on the re-run.~331 MB / ~4.4 min at 10 Mbit, matching ESP32-S3 first-time install misses 4 min at 10 Mbit (5.81 min, 399 MB) #1944's own estimate for dropping the bundle. Reaching
"under 4 min" still needs the 168 MB toolchain shrink, which is mirror-side (zstd single-chip
slices) and out of scope here.
Tests
crates/fbuild-library/src/library/esptool_tests.rs: 33 pass (module), 333 pass for thewhole crate lib (8 ignored).
registry_esptool_uses_published_source_archives— both 5.1.0 and 5.3.0 map to the sourcearchive on every host (this is the assertion that used to require Windows).
standalone_fallback_is_permitted_only_where_a_binary_exists— both directions.registry_url_with_an_unexpected_filename_keeps_the_standalone_path— the rewrite stays keyedon the exact
esptoolpy-v<ver>.zipshape, so no guessedesptool.zipfor a wrong version.live_registry_source_install_provisions_a_runnable_esptool(#[ignore], needs network +uv)— the real end-to-end check above; run it with
soldr cargo test -p fbuild-library --lib live_registry_source -- --ignored.is_windows()gate → 2 URL tests fail;!windows→true→the fallback test fails.
soldr clippy -p fbuild-library --all-targets -- -D warningsclean,cargo fmt --checkclean,platform boundary
rows=44; dylint_rows=43(unchanged), dylint allowlists current, test layout ok.Not done
--python 3.10pin.Closes nothing: #1944 still tracks the toolchain/MB target.