fix(builder): a verbatim --cache is taken in its plain spelling #2671

Merged
HumanBean merged 3 commits from dyst/Longshot:fix/builder-cache-verbatim into main 2026-11-27 15:47:02 +00:00
Member

Summary

Players who chose their own build files folder in the new launcher's Settings can't build: every file fails with fatal error: '<header>' file not found, for headers right beside the file being compiled. The launcher saved the folder as Windows' fs::canonicalize spells it, \\?\X:\..., and passes it as --cache. The builder unpacks the sources there, and clang, given \\?\ paths, resolves no #include "..." beside a source and searches no -I \\?\... folder.

This makes the builder take a --cache / LONGSHOT_CACHE given as \\?\X:\... as X:\..., and \\?\UNC\server\share\... as \\server\share\... (Windows only; any other spelling as given). The launcher's own fix, which saves and reads the plain spelling, is MagicBeanDev/LongshotLauncher#298. This covers launchers without it and any other caller.

To see it on main: on Windows, longshot-builder build --game <.nup> --out <folder> --cache \\?\<an absolute folder>. The compile stage fails every unit.

Read: builder/crates/build-driver/src/layout.rs, cache_root_for and plain.

See MagicBeanDev/LongshotLauncher#297

Testing

Tested: Windows 11, Ryzen 9 3900X, with a player's build from the .nup and --cache \\?\E:\...\cache (a fresh cache), --no-prepare-shaders:

  • Before: nightly-842's own longshot-builder-nightly-842-86b3b9e4-windows-x64.exe (signature and SHA-256 checked). compiled in 669s, 506 failed, then compile_failed. Each failure is the players' error, e.g. \\?\E:\...\cache\sources\c404701dea78ef5e\gpu\vk\eden\shader_recompiler\backend\spirv\emit_spirv_atomic.cpp:9:10: fatal error: 'shader_recompiler/backend/spirv/emit_spirv.h' file not found. The log names \\?\ 1,018 times.
  • After: this branch's longshot-builder (release profile) with nightly-842's own source pack attached (dev release attach, the same c404701dea78ef5e sources, so only this fix differs). Same command and cache: compiled in 147s, 0 failed, done, and the game folder is complete. Its log has no \\?\, and the work folder and the store are under the plain E:\...\cache. The 147 s compile reused the objects the failed build had compiled.
  • The game wasn't started: this changes no code the game runs, only where the builder reads its cache.
  • a_verbatim_cache_is_taken_in_its_plain_spelling (build-driver's layout tests, game-free) fails on main (left: "\\\\?\\X:\\Games\\Build\\longshot-builder") and passes here. It checks drive, UNC, plain, a verbatim device path left as it is, and the same text on Linux left as it is, so it runs on CI's Linux too.
  • cargo test -p build-driver --lib on Windows: 137 passed, 9 failed. The same 9 fail on main on Windows (channel, modhook ×2, perf, folder, play, read ×2, sources), which #2587 addresses.
  • cargo clippy -p build-driver --all-targets -D warnings on Windows: nothing in layout.rs. It stops on 3 needless_borrow errors in play.rs's Windows-only code, the same on main (CI lints on Linux).
  • tests/run_all.py --strict on Windows (llvm-mingw first on PATH): 791 passed, 21 failed, 48 skipped. Of the 21, 15 fail on main too (test_oot_menu_mouse, test_auto_handheld, test_builder_channel, test_coverage_run, test_dev_build, test_dev_migrate, test_dev_ab, test_game_menu_mouse_buttons, test_input_movie, test_job_queue, test_dev_update, test_pads_after_menu, test_parity_gates, test_run_all_mingw, test_longshot_ctl). Four are tools this PC lacks, failed by --strict and skipped without it (test_fsr3fi_hud_layer, test_fsr3fi_hudless_colour: glslang; test_lifter: llvm-mc; test_native_zstd: zstandard). Two timed out under the full run's load and pass alone, on the branch and on main (test_present_acquire_ahead, test_seed_reader). None fail because of this change.

Still to test:

  • None: CI runs the new test on Linux, and the Windows path is covered by the build above.

Measurements

Nothing to measure: the build's speed and output are unchanged; only the spelling of the cache's path changes, for a cache given as \\?\.

Risks

  • A cache given as \\?\X:\... deeper than 260 characters is now used in the plain spelling. The builder's manifest makes it long-path aware (the build), and doctor already warns when long paths are off. Before this such a cache failed every compile anyway.
  • Other verbatim forms (\\?\Volume{...}\, devices) are left as they are. A revert restores the old behaviour. Nothing changes for a player whose cache wasn't given as \\?\.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary Players who chose their own build files folder in the new launcher's Settings can't build: every file fails with `fatal error: '<header>' file not found`, for headers right beside the file being compiled. The launcher saved the folder as Windows' `fs::canonicalize` spells it, `\\?\X:\...`, and passes it as `--cache`. The builder unpacks the sources there, and clang, given `\\?\` paths, resolves no `#include "..."` beside a source and searches no `-I \\?\...` folder. This makes the builder take a `--cache` / `LONGSHOT_CACHE` given as `\\?\X:\...` as `X:\...`, and `\\?\UNC\server\share\...` as `\\server\share\...` (Windows only; any other spelling as given). The launcher's own fix, which saves and reads the plain spelling, is https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/298. This covers launchers without it and any other caller. To see it on `main`: on Windows, `longshot-builder build --game <.nup> --out <folder> --cache \\?\<an absolute folder>`. The compile stage fails every unit. Read: `builder/crates/build-driver/src/layout.rs`, `cache_root_for` and `plain`. See https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/issues/297 ## Testing **Tested:** Windows 11, Ryzen 9 3900X, with a player's build from the `.nup` and `--cache \\?\E:\...\cache` (a fresh cache), `--no-prepare-shaders`: - Before: nightly-842's own `longshot-builder-nightly-842-86b3b9e4-windows-x64.exe` (signature and SHA-256 checked). `compiled in 669s, 506 failed`, then `compile_failed`. Each failure is the players' error, e.g. `\\?\E:\...\cache\sources\c404701dea78ef5e\gpu\vk\eden\shader_recompiler\backend\spirv\emit_spirv_atomic.cpp:9:10: fatal error: 'shader_recompiler/backend/spirv/emit_spirv.h' file not found`. The log names `\\?\` 1,018 times. - After: this branch's `longshot-builder` (release profile) with nightly-842's own source pack attached (`dev release attach`, the same `c404701dea78ef5e` sources, so only this fix differs). Same command and cache: `compiled in 147s, 0 failed`, `done`, and the game folder is complete. Its log has no `\\?\`, and the work folder and the store are under the plain `E:\...\cache`. The 147 s compile reused the objects the failed build had compiled. - The game wasn't started: this changes no code the game runs, only where the builder reads its cache. - `a_verbatim_cache_is_taken_in_its_plain_spelling` (build-driver's `layout` tests, game-free) fails on `main` (`left: "\\\\?\\X:\\Games\\Build\\longshot-builder"`) and passes here. It checks drive, UNC, plain, a verbatim device path left as it is, and the same text on Linux left as it is, so it runs on CI's Linux too. - `cargo test -p build-driver --lib` on Windows: 137 passed, 9 failed. The same 9 fail on `main` on Windows (`channel`, `modhook` ×2, `perf`, `folder`, `play`, `read` ×2, `sources`), which #2587 addresses. - `cargo clippy -p build-driver --all-targets -D warnings` on Windows: nothing in `layout.rs`. It stops on 3 `needless_borrow` errors in `play.rs`'s Windows-only code, the same on `main` (CI lints on Linux). - `tests/run_all.py --strict` on Windows (llvm-mingw first on PATH): 791 passed, 21 failed, 48 skipped. Of the 21, 15 fail on `main` too (`test_oot_menu_mouse`, `test_auto_handheld`, `test_builder_channel`, `test_coverage_run`, `test_dev_build`, `test_dev_migrate`, `test_dev_ab`, `test_game_menu_mouse_buttons`, `test_input_movie`, `test_job_queue`, `test_dev_update`, `test_pads_after_menu`, `test_parity_gates`, `test_run_all_mingw`, `test_longshot_ctl`). Four are tools this PC lacks, failed by `--strict` and skipped without it (`test_fsr3fi_hud_layer`, `test_fsr3fi_hudless_colour`: glslang; `test_lifter`: llvm-mc; `test_native_zstd`: zstandard). Two timed out under the full run's load and pass alone, on the branch and on `main` (`test_present_acquire_ahead`, `test_seed_reader`). None fail because of this change. **Still to test:** - None: CI runs the new test on Linux, and the Windows path is covered by the build above. ## Measurements Nothing to measure: the build's speed and output are unchanged; only the spelling of the cache's path changes, for a cache given as `\\?\`. ## Risks - A cache given as `\\?\X:\...` deeper than 260 characters is now used in the plain spelling. The builder's manifest makes it long-path aware ([the build](docs/dev/reference/build.md)), and `doctor` already warns when long paths are off. Before this such a cache failed every compile anyway. - Other verbatim forms (`\\?\Volume{...}\`, devices) are left as they are. A revert restores the old behaviour. Nothing changes for a player whose cache wasn't given as `\\?\`. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The new launcher passes a build files folder chosen in its Settings as fs::canonicalize gives it on Windows,
\\?\X:\..., as --cache. The builder unpacks the sources there and clang, given \\?\ paths, finds no header beside a
source nor in an include folder: every compile fails ("'fx_compile.h' file not found"). Fails on main: the cache is
kept as given.

MagicBeanDev/LongshotLauncher#297

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(builder): a verbatim --cache is taken in its plain spelling
Some checks failed
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Failing after 14s
PR description / Title and description (pull_request_target) Successful in 5s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 1m20s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 2m2s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 2m37s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 3m3s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 3m10s
CI / Website build and checks (pull_request) Successful in 1m59s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Successful in 3m45s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 25m58s
86014648c1
A cache given as \\?\X:\... (the new launcher's build files folder chosen in its Settings, canonicalized) is taken as
X:\..., and \\?\UNC\server\share\... as \\server\share\...: clang finds no header from a \\?\ path, so every compile
of the sources unpacked there failed. A launcher with the fix saves the plain spelling; this covers one without it,
and any other caller.

Fixes MagicBeanDev/LongshotLauncher#297 for the builder's part.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11, Ryzen 9 3900X: a player's build from the .nup with --cache \?\E:...\cache. nightly-842's builder: 506 files fail with the players' 'file not found'. This branch's builder carrying nightly-842's own sources: compiled, 0 failed, done, the game folder complete. The game itself is unchanged and wasn't started: the change is only where the builder reads its cache.

Tested in game: Windows 11, Ryzen 9 3900X: a player's build from the .nup with --cache \\?\E:\...\cache. nightly-842's builder: 506 files fail with the players' 'file not found'. This branch's builder carrying nightly-842's own sources: compiled, 0 failed, done, the game folder complete. The game itself is unchanged and wasn't started: the change is only where the builder reads its cache.
Member

Possibly related, for context:

  • issue #2661 Install: Windows: Successful build rejected with "The game folder is missing from this version" — Windows verbatim-path spelling also appears in this folder-validation report; note its claimed path-comparison cause is still under investigation.
Possibly related, for context: - issue #2661 Install: Windows: Successful build rejected with "The game folder is missing from this version" — Windows verbatim-path spelling also appears in this folder-validation report; note its claimed path-comparison cause is still under investigation.
dyst changed title from WIP: fix(builder): a verbatim --cache is taken in its plain spelling to fix(builder): a verbatim --cache is taken in its plain spelling 2026-11-27 14:58:21 +00:00
Author
Member

CI: the three failing jobs fail the same way on main 86b3b9e4f (this branch's base), none from this change: Rust (clippy's needless_borrow in build-driver's play.rs lines 503, 521, 522, which this PR doesn't touch), Third-party parts and guide screenshots (the guide screenshot check), and Game-free checks part 2/2 (tests/test_lifter.py). The jobs that run this PR's code pass up to that clippy stop; the new layout test also passed on Windows locally.

CI: the three failing jobs fail the same way on main 86b3b9e4f (this branch's base), none from this change: Rust (clippy's needless_borrow in build-driver's play.rs lines 503, 521, 522, which this PR doesn't touch), Third-party parts and guide screenshots (the guide screenshot check), and Game-free checks part 2/2 (tests/test_lifter.py). The jobs that run this PR's code pass up to that clippy stop; the new layout test also passed on Windows locally.
fix(builder): preserve cache paths that require Windows verbatim semantics
Some checks failed
PR description / Title and description (pull_request_target) Successful in 19s
CI / What the change needs (pull_request) Successful in 24s
CI / Third-party parts and guide screenshots (pull_request) Failing after 33s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Failing after 3m33s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 5m19s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m54s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 2m53s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m1s
CI / Website build and checks (pull_request) Successful in 3m26s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Successful in 11m17s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 31m54s
0d00110316
Owner

Pushed 0d00110316e8 to guard the Windows cache-path conversion. Ordinary drive and UNC paths still reach Clang without the verbatim prefix. Paths with literal trailing dots or spaces, reserved device names, or lengths that require the verbatim namespace keep their original spelling so the builder cannot resolve them to a different location.

All six build-driver layout tests passed. The regression cases cover ordinary drive and UNC paths, literal names, a device-like component, an overlength path and Linux passthrough. The Windows build result already recorded in this PR covers the common path case.

Pushed `0d00110316e8` to guard the Windows cache-path conversion. Ordinary drive and UNC paths still reach Clang without the verbatim prefix. Paths with literal trailing dots or spaces, reserved device names, or lengths that require the verbatim namespace keep their original spelling so the builder cannot resolve them to a different location. All six build-driver layout tests passed. The regression cases cover ordinary drive and UNC paths, literal names, a device-like component, an overlength path and Linux passthrough. The Windows build result already recorded in this PR covers the common path case.
HumanBean deleted branch fix/builder-cache-verbatim 2026-11-27 15:47:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2671
No description provided.