Repository navigation
refactor(platform): move QEMU runtime-library policy behind the facade (#1315) - #2116
Merged
Merged
Conversation
The Espressif QEMU toolchain held 9 of the 15 remaining enforcement-ledger rows: `#[cfg(windows)]`/`#[cfg(not(windows))]` pairs around DLL staging and `#[cfg(target_os = "linux")]` around the shared-library probe. Add `platform::runtime` (`probe_binary`, `stage_runtime_libraries`, `runtime_library_dirs`, `library_path_var`) with per-OS implementations, and collapse the toolchain's cfg-selected bodies into single calls. Ledger 15 -> 6 (a migration, not a re-baseline). Refs #1315
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
8 tasks
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.
Phase 9/9 of the platform refactor (#1315): the Espressif QEMU toolchain was the
largest remaining host-mechanic group in the enforcement ledger — 9 of 15 rows,
all of them
cfg-selected host policy rather than product policy.What moved
New neutral capability
fbuild_core::platform::runtime:probe_binary(binary, library_path)→BinaryProbe— whether an installedbinary can start, and the linker's own complaint when it cannot.
stage_runtime_libraries(binary)— place the libraries a binary needs beside it.runtime_library_dirs(binary)— directories a child needs on its search path.library_path_var()— the variable this host's loader reads,Nonewhen itresolves libraries another way.
Linux probes the binary with
LD_LIBRARY_PATHand stages nothing. Windowsstages
libiconv-2.dllbeside the executable and reportsPATHdirectories.macOS binaries are self-contained: it stages and probes nothing.
Call sites
crates/fbuild-toolchain/src/toolchain/esp_qemu.rs: the fivehydrate_windows_runtime+validate_windows_runtimepairs collapse into onestage_runtime_libraries(&path)call;build_windows_qemu_path_envnow composesthe platform's directory list instead of owning the DLL discovery. The
libiconv-2.dllsearch policy (PATH,%ProgramFiles%\Git,%LOCALAPPDATA%avr-gcc) moved into the Windows implementation, which is the only host that had
it.
crates/fbuild-toolchain/src/toolchain/esp_qemu_runtime.rs: the privateQemuProbeenum and the#[cfg(target_os)]pair insideprobe_qemu_binaryare replaced by the capability;
ensure_qemu_can_startkeeps the lazy-bundlepolicy and the diagnostics, and asks
library_path_var()when composing theprobe's search path.
Ledger
rows=15; dylint_rows=15→rows=6; dylint_rows=6— a migration, not are-baseline: the rows disappear because the
cfgselections no longer exist.ci/platform_boundary_research.tsvregenerated (--write, line-number shiftsonly) and the explicit row count in
ci/test_enforce_platform_boundary.pylowered 15 → 6.
Verification
soldr cargo test -p fbuild-core --lib platform::— 77 passed, 0 failed.soldr cargo test -p fbuild-toolchain --lib— 203 passed, 0 failed, 6 ignored(includes the three probe tests, now routed through the capability).
Startedmakesprobe_linux_detects_missing_shared_library_exit_127andprobe_linux_exports_the_bundle_on_ld_library_pathFAIL; restoring it makesthem pass, so those assertions are not vacuous.
soldr cargo check --workspace --all-targets --exclude fbuild-python— clean(
fbuild-pythoncannot link on this host: no sharedlibpython3.14).soldr cargo clippy -p fbuild-core -p fbuild-toolchain --all-targets --no-deps -- -D warnings— clean;cargo fmt --all --check— clean.ci/enforce_platform_boundary.py --print-totals→rows=6; dylint_rows=6,exit 0;
ci/platform_boundary_research.py --checkexit 0;ci.test_enforce_platform_boundary+ci.test_platform_boundary_research—30 tests OK.
The Windows staging test (
staging_copies_a_path_dll_next_to_the_binary) runs inthe
full / windows / Checklane; it cannot execute on this Linux host, so theWindows half of this change is verified by compilation plus that test's
existence, not by a local run.
#1315 stays open (remaining cells: the residue rows and the closing three-host
audit).