Builds fail with "file not found" for every header when the build files folder was chosen in Settings (\\?\ path) #297

Closed
opened 2026-11-27 14:07:49 +00:00 by dyst · 2 comments
Member

Players who chose their own build files folder in Settings get a build that stops with hundreds of fatal error: '<header>' file not found lines, for headers that sit right beside the file being compiled:

FAILED fx_compile.cpp (0s, alone too):
\\?\X:\...\longshot-builder\sources\4dede708e94f9051\gpu\vk\reshade\fx_compile.cpp:1:10: fatal error: 'fx_compile.h' file not found
FAILED vk_gpu_clock.cpp (0s, alone too):
\\?\X:\...\longshot-builder\sources\...\gpu\vk\vk_gpu_clock.cpp:11:10: fatal error: 'vk_gpu_clock.h' file not found
...\not_implemented.cpp:7:10: fatal error: 'common/common_types.h' file not found

Players who kept the default folder build normally.

Why

  • Change::prepare (src/folders.rs) saves the chosen folder as tree::absolute(path), and tree::absolute (src/folders/tree.rs) is fs::canonicalize. On Windows that returns a verbatim path, \\?\X:\Games\LongshotBuild, and that string goes into the settings' work. buildsFolder and dataFolder are saved the same way.
  • home::work returns the setting as it is, and the launcher passes <work>\longshot-builder to longshot-builder as --cache. The builder unpacks the sources under it and hands clang \\?\... paths.
  • clang (llvm-mingw's 23.1.5, the one the builder ships) can't resolve includes from a verbatim path. A source given as \\?\E:\t\sub\a.cpp doesn't find "a.h" beside it, and an -I \\?\... folder isn't searched. The same files with plain E:\... 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

  • The launcher: tree::absolute returns 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.
  • longshot-builder: strip a verbatim prefix from --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).

Players who chose their own **build files folder** in Settings get a build that stops with hundreds of `fatal error: '<header>' file not found` lines, for headers that sit right beside the file being compiled: ```text FAILED fx_compile.cpp (0s, alone too): \\?\X:\...\longshot-builder\sources\4dede708e94f9051\gpu\vk\reshade\fx_compile.cpp:1:10: fatal error: 'fx_compile.h' file not found FAILED vk_gpu_clock.cpp (0s, alone too): \\?\X:\...\longshot-builder\sources\...\gpu\vk\vk_gpu_clock.cpp:11:10: fatal error: 'vk_gpu_clock.h' file not found ...\not_implemented.cpp:7:10: fatal error: 'common/common_types.h' file not found ``` Players who kept the default folder build normally. ## Why - `Change::prepare` (`src/folders.rs`) saves the chosen folder as `tree::absolute(path)`, and `tree::absolute` (`src/folders/tree.rs`) is `fs::canonicalize`. On Windows that returns a verbatim path, `\\?\X:\Games\LongshotBuild`, and that string goes into the settings' `work`. `buildsFolder` and `dataFolder` are saved the same way. - `home::work` returns the setting as it is, and the launcher passes `<work>\longshot-builder` to longshot-builder as `--cache`. The builder unpacks the sources under it and hands clang `\\?\...` paths. - clang (llvm-mingw's 23.1.5, the one the builder ships) can't resolve includes from a verbatim path. A source given as `\\?\E:\t\sub\a.cpp` doesn't find `"a.h"` beside it, and an `-I \\?\...` folder isn't searched. The same files with plain `E:\...` 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 - The launcher: `tree::absolute` returns 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. - longshot-builder: strip a verbatim prefix from `--cache` / `LONGSHOT_CACHE`, for launchers without the fix and any other caller (a separate Longshot pull request). Related: https://git.magicbean.dev/MagicBeanDev/Longshot/issues/2661 is another place where a path in one spelling is compared with the same folder in another (the default folder, not this bug).
Member

Possibly related, for context:

  • issue MagicBeanDev/Longshot#2661 Install: Windows: Successful build rejected with "The game folder is missing from this version" — Related Windows path-spelling mismatch, but affects build-folder ownership detection, not clang include resolution.
Possibly related, for context: - issue MagicBeanDev/Longshot#2661 Install: Windows: Successful build rejected with "The game folder is missing from this version" — Related Windows path-spelling mismatch, but affects build-folder ownership detection, not clang include resolution.
dyst changed title from 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) 2026-11-27 14:08:02 +00:00
Author
Member

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.

Fixes, both ready for review: https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/298 (the launcher saves and reads chosen folders in the plain spelling; players who already chose one are fixed by the update) and https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/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.
Sign in to join this conversation.
No milestone
No project
No assignees
2 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/LongshotLauncher#297
No description provided.