Skip to content

fix(paths): make path spellings host-independent so the Windows lane is green (#1780) - #1782

Merged
zackees merged 3 commits into
mainfrom
agent/windows-path-assertions
Oct 29, 2026
Merged

zackees merged 3 commits into
mainfrom
agent/windows-path-assertions

Conversation

@zackees

@zackees zackees commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Problem

full / windows / Check (windows-latest) is red on main for reasons unrelated to any
feature: production and test code disagree about how paths are spelled on Windows.
Because full / Full coverage is part of the ci-full set, this blocks
CI selected coverage and therefore every setup-soldr v0 promotion canary.
Tracked as #1780.

Changes

1–3. Test assertions now use the host's own rendering (test-only)

  • disk_preflight_tests.rs — the failure text is built from root.path.display() and
    the missing-dir probe walk is recorded with display(), so both carry \ separators
    on Windows. Assert against the same rendering; record the walked roots with
    display_slash() so the expected spelling stays forward-slashed everywhere.
  • daemon_client/tests.rs — the foreign-root-owner message names the owner's executable
    through NormalizedPath; compare with claim.exe.display() instead of the fabricated
    /venv/bin/fbuild-daemon literal.
  • rebuild_signature.rs — the prefix-map test fabricated /home/..., which is not
    absolute on Windows, so path_arg_for_compile_cwd never relativized it and two
    unrelated projects were compared. Fabricate the projects under a host-native root
    (C:/projects on Windows via fbuild_core::platform::host::current()).

4. debug_prefix_map_args emits forward slashes (production, one line of logic)

The fourth Windows failure is a genuine cross-platform cache bug, not just a brittle
test: the map values were rendered with Path::display(), so the same project emitted
/p/sketch=... on Linux and a backslash-spelled variant on Windows. The module exists
precisely so the recorded path is identical in every checkout — that has to include a
checkout on another OS, otherwise the core cache can never share objects across hosts.
Both map values now go through NormalizedPath::display_slash(). Both spellings
compile; only one is stable. is_within still compares normalize_for_key spellings,
so the containment decision is unchanged.

No new test module, no new PathBuf, no cfg!(unix)/cfg!(windows) — the host question
goes through the sanctioned platform::host facade.

Verification

Linux host, soldr only:

soldr cargo test -p fbuild-build-engine --lib disk_preflight    -> 13 passed; 0 failed
soldr cargo test -p fbuild-build-engine --lib prefix_map        ->  1 passed; 0 failed
soldr cargo test -p fbuild-cli --bin fbuild foreign_root_owner  ->  1 passed; 0 failed
soldr cargo test -p fbuild-paths --lib debug_prefix_map         ->  4 passed; 0 failed
bash test (TMPDIR=/home/niteris/t)                              -> 3945 passed; 0 failed; 47 suites
soldr cargo fmt --all -- --check                                -> clean
soldr cargo clippy --workspace --all-targets -- -D warnings     -> clean (rc=0)
run_dylint --package fbuild-build-engine|fbuild-cli|fbuild-paths -> rc=0 each
ci/enforce_platform_boundary.py --print-totals                  -> rows=44; dylint_rows=43, rc=0
ci/check_dylint_allowlists.py, ci/check_test_layout.py          -> current / ok: 8 categories

Windows evidence from run 40842815498
(ci-full, job full / windows / Check (windows-latest)), which carried the test-only commit:

test disk_preflight_tests::a_root_that_does_not_exist_yet_is_measured_on_its_volume ... ok
test disk_preflight_tests::only_the_short_root_is_named_on_failure ... ok
test rebuild_signature::tests::prefix_map_flags_normalize_their_source_path ... ok
test daemon_client::tests::foreign_root_owner_message_names_the_owner ... ok
...
failures:
  debug_prefix_map::tests::debug_prefix_map_covers_an_external_build_root
  left:  [..., "-fdebug-prefix-map=\\tmp\\short-build-dir\\uno\\quick=fbuild-build"]
  right: [..., "-fdebug-prefix-map=/tmp/short-build-dir/uno/quick=fbuild-build"]
test result: FAILED. 90 passed; 1 failed

i.e. three of the four were already proven fixed on the real Windows runner, and the one
remaining failure is exactly what change 4 addresses — it was the last test binary in the
step, so there is nothing queued behind it.

Three assertions hard-coded POSIX literals that never appear in paths
rendered by the production code on Windows, so the Windows lane of
`full` has been red independent of any feature change:

* disk_preflight: the failure text is built from `root.path.display()`
  and the missing-dir walk is recorded as `display()`; both carry `\`
  separators on Windows. Assert against the same rendering, and record
  the walked roots with `display_slash()` so the expectations stay a
  forward-slash spelling on every host.
* daemon_client: the foreign-root-owner message names the owner's
  executable through `NormalizedPath`; compare with `claim.exe.display()`
  instead of the fabricated "/venv/bin/fbuild-daemon" literal.
* rebuild_signature: the prefix-map test fabricated "/home/...", which
  is not absolute on Windows, so the flag value never relativized and
  two unrelated projects were compared. Fabricate the projects under a
  host-native root.

Test-only, no production behaviour changes.
@coderabbitai

coderabbitai Bot commented Oct 29, 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

Comment @coderabbitai help to get the list of available commands.

@zackees zackees added the ci-full Run the complete release-equivalent CI matrix on this PR SHA label Oct 29, 2026
`-fdebug-prefix-map` values were rendered with `Path::display()`, i.e. the
host's native separator. The module exists so that the recorded path is
identical in *every* checkout — but a Windows checkout emitted a
backslash-spelled root where Linux emitted `/root/...`, so the two hosts
could never share core-cache objects, and the Windows lane's own
`debug_prefix_map_covers_an_external_build_root` assertion caught it.

Render both map values through `NormalizedPath::display_slash()`. Both
spellings compile; only one is stable across hosts. `is_within` already
compares `normalize_for_key` spellings, so the containment decision is
unchanged.

Found while fixing #1780's Windows-lane failures; this is the fourth one
and the only production-side change in the PR.
@zackees zackees changed the title test(windows): assert on host-rendered paths so the Windows lane is green (#1780) fix(paths): make path spellings host-independent so the Windows lane is green (#1780) Oct 29, 2026
@zackees zackees removed the ci-full Run the complete release-equivalent CI matrix on this PR SHA label Oct 29, 2026
@zackees

zackees commented Oct 29, 2026

Copy link
Copy Markdown
Member Author

Heads-up on the two red jobs in ci-minimal (run 40862560392): Arduino Uno / build and
Teensy 4.1 / build did not compile anything — both died in ~15 s downloading their
toolchain/framework archives:

HTTP 403 Forbidden (gave up after 1 attempts at byte offset 0; error is not retryable)

dl.registry.platformio.org started refusing agents whose User-Agent does not begin
with PlatformIO/. fbuild's shared HTTP client sends no UA, so every cold download 403s —
that is #1783, fixed in #1784 (this PR's own code is unaffected: the same boards passed
in run 40847963620 before the registry changed its gate).

CI selected coverage is a merge-queue-required context, so this PR cannot enter the queue
until #1784 lands. I will re-run the board jobs once it does.

@zackees
zackees added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 2ba5754 Oct 29, 2026
28 checks passed
@zackees
zackees deleted the agent/windows-path-assertions branch October 29, 2026 12:29
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Oct 30, 2026
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.

1 participant