Skip to content

fix(build-engine): re-root drive-relative compile-database paths on Windows - #2058

Merged
zackees merged 5 commits into
mainfrom
agent/reroot-rooted-paths
Nov 17, 2026
Merged

zackees merged 5 commits into
mainfrom
agent/reroot-rooted-paths

Conversation

@zackees

@zackees zackees commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

What

crates/fbuild-build-engine/src/compile_database/merge.rs::respell gated
re-rooting on Path::is_absolute(). On Windows that is the wrong predicate: a
drive-relative spelling such as /proj/main.c has a root but no prefix, so
it is neither absolute nor relative — respell returned None and a Windows
capture kept its absolute-looking file/output entries.

The gate is now has_root():

  • a plain relative name (main/main.c) is still left exactly as captured;
  • a rooted spelling is re-rooted, on every host;
  • relative_spelling still answers None where no relative path exists (two
    roots that do not meet, e.g. /proj against C:/proj), via its
    shared-component guard — unchanged.

Why now

full / windows / Check on #1633 went red once #2049's clippy::large_futures
error stopped masking the test phase. Three compile_database::merge tests
failed there with the pre-fix spelling:

merge_adds_framework_entries_only_idf_compiled
reroot_removes_scratch_and_checkout_prefixes
reroot_spells_sources_relative_to_the_project
  left: ["/proj/main/main.c", "/proj/components/mycomp/mycomp.c", ...]
 right: ["main/main.c", "components/mycomp/mycomp.c", ...]

This is a main-side latent break: ci-full (the only workflow that runs the
macOS/Windows matrix) runs on PRs that carry the ci-full label, so main never
sees it. It is not caused by #1633 — its diff does not touch this module.

Tests

New respell_rewrites_only_rooted_spellings pins the contract; it returns
None for /proj/main/main.c under the old is_absolute predicate on Windows,
so the Windows cell is a real regression test, not just a green.

  • soldr cargo test -p fbuild-build-engine --lib compile_database → 91 passed, 0 failed, 0 ignored
  • soldr cargo clippy -p fbuild-build-engine --all-targets --no-deps -- -D warnings -A unfulfilled_lint_expectations → exit 0
  • soldr cargo clippy -p fbuild-build-engine --all-targets --target x86_64-pc-windows-msvc -- -D warnings -A unfulfilled_lint_expectations → exit 0
  • soldr cargo fmt --all -- --check → exit 0
  • ci/enforce_platform_boundary.py --print-totals → rows=44; dylint_rows=43

The ci-full label is set so the full / windows / Check cell proves it.

#1633 is unaffected (stays blocked only on its owner review).

Second window: fbuild-toolchain fixtures (same cell)

With the merge tests fixed, the same full / windows / Check cell reported
three more Windows-only failures, all one cause: the ESP-IDF/ESP32 fixtures
wrote POSIX binary names while the code looks them up via
platform::executable::native_name.

  • esp32::tests::test_slice_variant_installs_into_a_chip_scoped_directory
    ("a chip-scoped install must be found")
  • esp_idf_install_tests::installed_bytes_sums_every_unit_and_dedupes_hardlinks
    (installed.missing_units().is_empty())
  • esp_idf_install_tests::a_missing_unit_is_named_instead_of_reading_as_a_small_tree
    (remove_file(python.python()) → NotFound)

Fixtures now fabricate tool_name/native_name spellings; on Linux nothing
changes, so installed_bytes = 2068 still holds (sizes are summed, never names).

cargo test -p fbuild-toolchain --lib → 203 passed, 0 failed, 6 ignored.

Remaining reds are external (#2064)

The nine ESP32 board cells die in ~1 min with
download failed for .../tasmota/esptool/releases/download/v5.6.0/esptool-linux-amd64.zip: HTTP 404 while pioarduino/esptool v5.6.0 esptool.zip still 302s — reported as
#2064. CI summary / CI selected coverage / full / Full coverage are
aggregators over those cells. Every code cell is green, including
full / windows / Check (48m02s), both macOS cells, Dylint Full and the LOC/
boundary/lint gates.

…indows

`respell` refused any path that was not `Path::is_absolute`, but on Windows a
drive-relative spelling like `/proj/main.c` is rooted without a prefix and is
not absolute — so a Windows capture kept its absolute-looking file/output
entries and the compile database was never re-rooted there.

The predicate is now `has_root()`: a relative name is still left untouched, and
`relative_spelling` still answers `None` for two roots that do not meet (a drive
split), through its shared-component guard.

Surfaced by `full / windows / Check` on #1633 once #2049's clippy red stopped
masking it: `reroot_spells_sources_relative_to_the_project`,
`reroot_removes_scratch_and_checkout_prefixes` and
`merge_adds_framework_entries_only_idf_compiled` failed with the absolute
spelling (`/proj/main/main.c`) instead of the project-relative one.
@zackees zackees added the ci-full Run the complete release-equivalent CI matrix on this PR SHA label Nov 17, 2026
@coderabbitai

coderabbitai Bot commented Nov 17, 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

…n find them

The ESP-IDF/ESP32 fixtures wrote POSIX binary names ("python", "xtensa-esp-elf-gcc")
while the code under test looks them up through
`platform::executable::native_name` — so on Windows `is_installed()`,
`missing_units()` and `python()` saw nothing and three tests failed:

* `esp32::tests::test_slice_variant_installs_into_a_chip_scoped_directory`
* `esp_idf_install_tests::installed_bytes_sums_every_unit_and_dedupes_hardlinks`
* `esp_idf_install_tests::a_missing_unit_is_named_instead_of_reading_as_a_small_tree`

Fabricate with `tool_name`/`native_name` instead. On Linux the names are
unchanged, so the byte-count expectation (2068) still holds: only the *contents*
are summed, never the file names.
…ves it

The last Windows failures were the interpreter *directory*: a venv's PATH entry
is `bin` on Unix and `Scripts` on Windows, and the fixture hardcoded `bin`, so
`python()` named a file that was never created. Build the tree through
`IdfPythonEnvironment::new(..)` and create `python.bin_dir()`, then write
`python.python()` itself — the exact file `missing_units()` looks for.
`full / windows / Check` runs `renesas_acceptance::` with `--ignored`, i.e.
both acceptance tests in ONE process. Each called `CompileBackend::start()`,
and a second concurrent start cannot win the zccache cache-root writer slot:

    Start("... cache root C:\Users\runneradmin\.fbuild\dev\zccache\v1.15.8
           unusable: another live daemon already holds this cache root ...")

Use the guarded `OnceCell` installer the sibling harnesses already carry
(`nxplpc_build_flags.rs`, `clangd_check_parity.rs`), so the second test reuses
the process-wide backend instead of racing for it.
@zackees
zackees added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 466342c Nov 17, 2026
135 checks passed
zackees added a commit that referenced this pull request Nov 18, 2026
Brings #2051 (reroot relative spelling), #2057 (rp2040 large future),
#2058 (respell has_root / native tool spelling / renesas OnceCell), #2059
(bench framework + tracing feature) and #2063/#2067. Only conflict was
fbuild-toolchain esp32.rs test fixture, resolved to main's #2058 native-spelling
semantics (explicit native_name let-binding).
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run the complete release-equivalent CI matrix on this PR SHA

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant