Repository navigation
fix(paths): make path spellings host-independent so the Windows lane is green (#1780) - #1782
Conversation
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.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
`-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.
|
Heads-up on the two red jobs in ci-minimal (run 40862560392):
|
Problem
full / windows / Check (windows-latest)is red onmainfor reasons unrelated to anyfeature: production and test code disagree about how paths are spelled on Windows.
Because
full / Full coverageis part of theci-fullset, this blocksCI selected coverageand therefore every setup-soldrv0promotion 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 fromroot.path.display()andthe missing-dir probe walk is recorded with
display(), so both carry\separatorson 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 executablethrough
NormalizedPath; compare withclaim.exe.display()instead of the fabricated/venv/bin/fbuild-daemonliteral.rebuild_signature.rs— the prefix-map test fabricated/home/..., which is notabsolute on Windows, so
path_arg_for_compile_cwdnever relativized it and twounrelated projects were compared. Fabricate the projects under a host-native root
(
C:/projectson Windows viafbuild_core::platform::host::current()).4.
debug_prefix_map_argsemits 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 existsprecisely 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 spellingscompile; only one is stable.
is_withinstill comparesnormalize_for_keyspellings,so the containment decision is unchanged.
No new test module, no new
PathBuf, nocfg!(unix)/cfg!(windows)— the host questiongoes through the sanctioned
platform::hostfacade.Verification
Linux host,
soldronly:Windows evidence from run 40842815498
(
ci-full, jobfull / windows / Check (windows-latest)), which carried the test-only commit: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.