Repository navigation
feat(toolchain): install a whole pinned ESP-IDF release as one fbuild operation - #1981
Merged
Merged
Conversation
… operation esp_idf_install.rs composes the three packages #1970 already pins — source tree, tool archives and Python environment — into EspIdfInstall::install(), which returns the environment a delegated idf.py build (#1971) must hand its subprocess: the venv bin first on PATH, IDF_PATH, IDF_PYTHON_ENV_PATH, ESP_ROM_ELF_DIR and OPENOCD_SCRIPTS, and deliberately no IDF_TOOLS_PATH. InstalledEspIdf names missing units instead of reporting a small byte count, and installed_bytes() sums the three entries du-style. Real e2e (ignored, run): 1 passed in 190.12 s — 24 source archives, 4 tool archives and the pinned CPython all installed into one cache root, then ESP-IDF's own tools/check_python_dependencies.py ran out of the installed tree with the installed interpreter and printed 'Python requirements are satisfied.', xtensa gcc reported esp-14.2.0_20241119, tools measured 1149.2 MB (<= 1.3 GB) and the release total 1684.7 MB; a second install of the whole release is a no-op. Refs #1970
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This was referenced Nov 10, 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.
Part 5 (last piece) of #1970 — follow-up 1 of the #1761 research programme.
The previous four PRs pinned the pieces: tool archives (#1975), the install
profile +
IdfEnvironment(#1976), the source tree (#1978) and the Pythonenvironment (#1980). Nothing installed the release. This adds the one entry
point that does, and returns the environment a delegated
idf.pybuild (#1971)must hand its subprocess.
What
crates/fbuild-toolchain/src/toolchain/esp_idf_install.rsEspIdfInstall::new(project_dir, profile)→install()installssource → tools → python, then returns anInstalledEspIdf.InstalledEspIdfis the answer to "what do I runidf.pywith?":path_dirs()— the venvbinfirst, then the toolbindirectories ininstall order. Ordering is not cosmetic:
idf.py's shebang resolvespythonfromPATH, so a host interpreter answering first fails ESP-IDF'sown dependency check on a correct environment.
env_vars()—IDF_PATH,IDF_PYTHON_ENV_PATH,ESP_ROM_ELF_DIR,OPENOCD_SCRIPTS. NoIDF_TOOLS_PATH: that variable pointsidf_tools.pyback at an~/.espressif-shaped side tree, which is exactlywhat feat(toolchain): pin an ESP-IDF release as fbuild packages with an esp32s3-only install profile #1970 removes.
missing_units()names a partial tree per unit rather than letting it readas a suspiciously small byte count.
installed_bytes()sums the three cache entriesdu-style (hardlinkscounted once, one identity set per entry).
IdfInstallUnit(Source/Tools/Python) exists because the threeunits are independent downloads with independent keys: a re-run after a failed
pipstep must not refetch the 450 MB source tree.A unit already installed is skipped by its own package, so re-running is a no-op
and a partial failure is repaired without re-downloading what landed.
Real output (ignored e2e, actually run)
soldr cargo test -p fbuild-toolchain --lib -- --ignored esp_idf_release_installThat single test installs the whole release into one cache root (24 source
archives, 4 tool archives, the pinned CPython + hashed wheels: ~450 MB of
downloads, ~1.6 GB on disk) and then asserts the combination, not the
pieces:
tools/check_python_dependencies.py, executed out of theinstalled source tree by the installed interpreter with the installed
constraints/requirements, prints
Python requirements are satisfied.— thesame gate
idf.pyruns at startup.xtensa-esp32-elf-gccreportsesp-14.2.0_20241119.1684.7 MB.
tree changes only by the sentinel's own bytes — nothing re-downloaded or
re-extracted (AC4).
Gates
soldr cargo test -p fbuild-toolchain --lib→198 passed; 0 failed; 6 ignoredsoldr clippy --workspace --all-targets -- -D warnings→ clean, 0 warningssoldr cargo fmt --all -- --check→ no diffsenforce_platform_boundary.py --print-totals→rows=44; dylint_rows=43, rc 0check_test_layout.py→ok: 8 integration-test categories, rc 0check_dylint_allowlists.py→Dylint allowlist paths are current., rc 0Deliberately not in this PR
is no cmake/ninja package in the repo today and their pin (IDF's
tools.jsonentry vs. a host-independent static build) is a decision of its own; it is the
last input feat(espidf): opt-in delegating idf.py build producing <build>/idf/ artifacts #1971 needs. Bundling it here would make this PR two units.
Packageimpl.Package::ensure_installedisPathBuf-typed and newfiles may not use it (
ban_std_pathbuf); the inherentinstall()is the APIfeat(espidf): opt-in delegating idf.py build producing <build>/idf/ artifacts #1971 will call.
~/dev/fbuildwas touched; all work happened in a worktree oforigin/main.