fix(builder): a verbatim --cache is taken in its plain spelling #2671
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2671
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:fix/builder-cache-verbatim"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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::canonicalizespells 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_CACHEgiven as\\?\X:\...asX:\..., 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_forandplain.See MagicBeanDev/LongshotLauncher#297
Testing
Tested: Windows 11, Ryzen 9 3900X, with a player's build from the
.nupand--cache \\?\E:\...\cache(a fresh cache),--no-prepare-shaders:longshot-builder-nightly-842-86b3b9e4-windows-x64.exe(signature and SHA-256 checked).compiled in 669s, 506 failed, thencompile_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.longshot-builder(release profile) with nightly-842's own source pack attached (dev release attach, the samec404701dea78ef5esources, 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 plainE:\...\cache. The 147 s compile reused the objects the failed build had compiled.a_verbatim_cache_is_taken_in_its_plain_spelling(build-driver'slayouttests, game-free) fails onmain(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 --libon Windows: 137 passed, 9 failed. The same 9 fail onmainon Windows (channel,modhook×2,perf,folder,play,read×2,sources), which #2587 addresses.cargo clippy -p build-driver --all-targets -D warningson Windows: nothing inlayout.rs. It stops on 3needless_borrowerrors inplay.rs's Windows-only code, the same onmain(CI lints on Linux).tests/run_all.py --stricton Windows (llvm-mingw first on PATH): 791 passed, 21 failed, 48 skipped. Of the 21, 15 fail onmaintoo (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--strictand 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 onmain(test_present_acquire_ahead,test_seed_reader). None fail because of this change.Still to test:
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
\\?\X:\...deeper than 260 characters is now used in the plain spelling. The builder's manifest makes it long-path aware (the build), anddoctoralready warns when long paths are off. Before this such a cache failed every compile anyway.\\?\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
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with 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]>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.
Possibly related, for context:
WIP: fix(builder): a verbatim --cache is taken in its plain spellingto fix(builder): a verbatim --cache is taken in its plain spellingCI: 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.Pushed
0d00110316e8to 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.