Builds fail with "file not found" for every header when the build files folder was chosen in Settings (\\?\ path) #297
Labels
No labels
area/build
area/install
area/mods
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher#297
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Players who chose their own build files folder in Settings get a build that stops with hundreds of
fatal error: '<header>' file not foundlines, for headers that sit right beside the file being compiled:Players who kept the default folder build normally.
Why
Change::prepare(src/folders.rs) saves the chosen folder astree::absolute(path), andtree::absolute(src/folders/tree.rs) isfs::canonicalize. On Windows that returns a verbatim path,\\?\X:\Games\LongshotBuild, and that string goes into the settings'work.buildsFolderanddataFolderare saved the same way.home::workreturns the setting as it is, and the launcher passes<work>\longshot-builderto longshot-builder as--cache. The builder unpacks the sources under it and hands clang\\?\...paths.\\?\E:\t\sub\a.cppdoesn't find"a.h"beside it, and an-I \\?\...folder isn't searched. The same files with plainE:\...paths compile. Reproduced with a two-file test on Windows 11.Workaround
In Settings, set the build files folder back to the default. That saves an empty setting, so no
\\?\path is kept. Choosing the custom folder again in this launcher brings the bug back.Fix
tree::absolutereturns the plain spelling (X:\...,\\server\share\...) of a canonical path, and folder settings already saved in the verbatim spelling are read back in the plain one, so affected players are fixed by the update.--cache/LONGSHOT_CACHE, for launchers without the fix and any other caller (a separate Longshot pull request).Related: MagicBeanDev/Longshot#2661 is another place where a path in one spelling is compared with the same folder in another (the default folder, not this bug).
Possibly related, for context:
Builds fail with "file not found" for every header when the build files folder was chosen in Settings (\?\ path)to Builds fail with "file not found" for every header when the build files folder was chosen in Settings (\\?\ path)Fixes, both ready for review: #298 (the launcher saves and reads chosen folders in the plain spelling; players who already chose one are fixed by the update) and MagicBeanDev/Longshot#2671 (longshot-builder takes a verbatim cache in the plain spelling, for launchers without the fix). Reproduced with nightly-842's builder: 506 files fail; with the fixed builder carrying the same sources, 0.