fix(folders): save and read chosen folders without a verbatim prefix #298

Merged
HumanBean merged 3 commits from dyst/LongshotLauncher:fix/verbatim-folder-paths into main 2026-11-27 15:48:52 +00:00
Member

Players who chose their own build files folder in Settings can't build any version: every file fails with fatal error: '<header>' file not found. The launcher saves the chosen folder in the verbatim spelling Windows' fs::canonicalize gives (\\?\X:\...) and passes it to longshot-builder as --cache. clang can't resolve includes from such paths. Fixes #297.

What changes

  • Change::prepare (src/folders.rs) saves the selection in its plain spelling (X:\..., \\server\share\...).
  • The four readers of the folder settings read a value an earlier launcher saved verbatim in the plain spelling too, so players who already chose a folder are fixed by the update, without choosing again: home::work, home::data_folder, game::install_root, and the stable migration's buildsFolder (src/players/stable.rs).
  • Inside the launcher nothing else changes. tree::absolute still returns fs::canonicalize's spelling, so the folders a move compares, its receipts and destinations, and the version-locations record keys stay as they were. An earlier attempt that made tree::absolute itself return plain paths split the record keys from the lookups in library::existing, which canonicalize again, and broke three move tests.
  • tree::link_path, which already turned a verbatim path into the plain one, moves to fsx::plain so the readers outside folders/ can use it. Its callers are unchanged apart from the name.

Read first: src/folders.rs (Change::prepare), src/home.rs (work, data_folder), src/fsx.rs (plain).

Testing

Tested on Windows 11, Rust 1.99.1 (gnullvm):

  • New test folders::tests::a_chosen_folder_is_saved_and_read_without_a_verbatim_prefix (Windows only, like the prefix). It fails on main (saved as \\?\E:\...\build files) and passes here. It chooses a folder through Change::prepare + apply, checks the saved work setting, then saves work, dataFolder and buildsFolder verbatim, as this launcher did, and checks home::work, home::data_folder and game::install_root read them plain.
  • cargo test --locked: 122 passed, 11 failed. The same 11 fail on main on Windows (main has those 11 plus the new test failing), so none are new. CI runs Linux, where the spellings are the same. They are: interrupted_cache_move_resumes_without_removing_the_original, resume_publication_on_either_side_of_directory_and_link_switches, workspace_move_is_cancellable_and_refuses_collisions_and_active_builders, prune::keeps_each_rollback_and_unregistered_playable_installs, prune::protects_profiles_rows_fetches_rollback_partial_and_player_files, registry::moved_portable_reads_previous_locations_without_rewriting_stable_paths, steam::library::library_play_uses_the_launcher_and_preserves_the_steam_identity, home::moving_a_portable_install_repairs_missing_paths_but_keeps_live_inputs, storage::reclaim::preservation::previous_build_review_removes_only_selected_outputs_after_confirmation, storage::installed_games_excludes_prefetched_tools_and_previous_launcher_games, update::releases::release_py_fixture_verifies_exact_bytes_only.
  • cargo fmt --check and cargo clippy --locked --all-targets -- -D warnings: clean. tests/test_launcher_core.py: the 15 catalogs validate, then its cargo test gives the result above. Tooling's test_release.py with LAUNCHER=$PWD: 46 tests OK.
  • The builder side, with nightly-842's own builder and a --cache \\?\E:\...\cache: 506 files fail with exactly the players' error (\\?\E:\...\cache\sources\c404701dea78ef5e\gpu\vk\eden\...\emit_spirv_atomic.cpp:9:10: fatal error: 'shader_recompiler/backend/spirv/emit_spirv.h' file not found), then compile_failed.
  • One expectation in moves_profiles_and_custom_installs_together_and_can_restore_the_default changes by design: after a move, home::data_folder is the plain spelling of the canonical folder, not the verbatim one. On Linux the two are the same.

Still to test:

  • Windows, by hand: in Settings, choose a build files folder on another drive, then build a nightly. Expected: work in the launcher's settings has no \\?\, and the build compiles.
  • Windows, by hand: a launcher home whose work was saved as \\?\X:\... by the current nightly, updated to this one. Expected: the next build compiles with no change in Settings.

Risks

  • A player who saved a folder verbatim gets the plain spelling from the readers after the update. Code that compares such a folder with a canonicalized one already canonicalizes both sides (info.rs, versions.rs, library::existing), and profile folders are rebuilt from data_folder each time. A comparison I missed would show up as a version or profile not recognised after the update. A revert restores the old behaviour.
  • Nothing else is written or moved by the update; the settings file keeps the verbatim value until the folder is next chosen.

The builder also strips the prefix from --cache for launchers without this fix: a separate Longshot pull request, linked from #297.

🤖 Generated with Claude Code

Players who chose their own build files folder in Settings can't build any version: every file fails with `fatal error: '<header>' file not found`. The launcher saves the chosen folder in the verbatim spelling Windows' `fs::canonicalize` gives (`\\?\X:\...`) and passes it to longshot-builder as `--cache`. clang can't resolve includes from such paths. Fixes #297. ## What changes - `Change::prepare` (`src/folders.rs`) saves the selection in its plain spelling (`X:\...`, `\\server\share\...`). - The four readers of the folder settings read a value an earlier launcher saved verbatim in the plain spelling too, so players who already chose a folder are fixed by the update, without choosing again: `home::work`, `home::data_folder`, `game::install_root`, and the stable migration's `buildsFolder` (`src/players/stable.rs`). - Inside the launcher nothing else changes. `tree::absolute` still returns `fs::canonicalize`'s spelling, so the folders a move compares, its receipts and destinations, and the `version-locations` record keys stay as they were. An earlier attempt that made `tree::absolute` itself return plain paths split the record keys from the lookups in `library::existing`, which canonicalize again, and broke three move tests. - `tree::link_path`, which already turned a verbatim path into the plain one, moves to `fsx::plain` so the readers outside `folders/` can use it. Its callers are unchanged apart from the name. Read first: `src/folders.rs` (`Change::prepare`), `src/home.rs` (`work`, `data_folder`), `src/fsx.rs` (`plain`). ## Testing **Tested** on Windows 11, Rust 1.99.1 (gnullvm): - New test `folders::tests::a_chosen_folder_is_saved_and_read_without_a_verbatim_prefix` (Windows only, like the prefix). It fails on `main` (`saved as \\?\E:\...\build files`) and passes here. It chooses a folder through `Change::prepare` + `apply`, checks the saved `work` setting, then saves `work`, `dataFolder` and `buildsFolder` verbatim, as this launcher did, and checks `home::work`, `home::data_folder` and `game::install_root` read them plain. - `cargo test --locked`: 122 passed, 11 failed. The same 11 fail on `main` on Windows (`main` has those 11 plus the new test failing), so none are new. CI runs Linux, where the spellings are the same. They are: `interrupted_cache_move_resumes_without_removing_the_original`, `resume_publication_on_either_side_of_directory_and_link_switches`, `workspace_move_is_cancellable_and_refuses_collisions_and_active_builders`, `prune::keeps_each_rollback_and_unregistered_playable_installs`, `prune::protects_profiles_rows_fetches_rollback_partial_and_player_files`, `registry::moved_portable_reads_previous_locations_without_rewriting_stable_paths`, `steam::library::library_play_uses_the_launcher_and_preserves_the_steam_identity`, `home::moving_a_portable_install_repairs_missing_paths_but_keeps_live_inputs`, `storage::reclaim::preservation::previous_build_review_removes_only_selected_outputs_after_confirmation`, `storage::installed_games_excludes_prefetched_tools_and_previous_launcher_games`, `update::releases::release_py_fixture_verifies_exact_bytes_only`. - `cargo fmt --check` and `cargo clippy --locked --all-targets -- -D warnings`: clean. `tests/test_launcher_core.py`: the 15 catalogs validate, then its `cargo test` gives the result above. Tooling's `test_release.py` with `LAUNCHER=$PWD`: 46 tests OK. - The builder side, with nightly-842's own builder and a `--cache \\?\E:\...\cache`: 506 files fail with exactly the players' error (`\\?\E:\...\cache\sources\c404701dea78ef5e\gpu\vk\eden\...\emit_spirv_atomic.cpp:9:10: fatal error: 'shader_recompiler/backend/spirv/emit_spirv.h' file not found`), then `compile_failed`. - One expectation in `moves_profiles_and_custom_installs_together_and_can_restore_the_default` changes by design: after a move, `home::data_folder` is the plain spelling of the canonical folder, not the verbatim one. On Linux the two are the same. **Still to test:** - Windows, by hand: in Settings, choose a build files folder on another drive, then build a nightly. Expected: `work` in the launcher's settings has no `\\?\`, and the build compiles. - Windows, by hand: a launcher home whose `work` was saved as `\\?\X:\...` by the current nightly, updated to this one. Expected: the next build compiles with no change in Settings. ## Risks - A player who saved a folder verbatim gets the plain spelling from the readers after the update. Code that compares such a folder with a canonicalized one already canonicalizes both sides (`info.rs`, `versions.rs`, `library::existing`), and profile folders are rebuilt from `data_folder` each time. A comparison I missed would show up as a version or profile not recognised after the update. A revert restores the old behaviour. - Nothing else is written or moved by the update; the settings file keeps the verbatim value until the folder is next chosen. The builder also strips the prefix from `--cache` for launchers without this fix: a separate Longshot pull request, linked from #297. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A build files folder chosen in Settings is saved as tree::absolute gives it, fs::canonicalize's \\?\X:\... on
Windows, and passed to longshot-builder as --cache: clang finds no header from a \\?\ path, so every compile fails.
Fails on main: the folder is saved as \\?\E:\...; a setting saved so is read as it is. Windows only, as the prefix is.

Refs #297

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(folders): save and read chosen folders without a verbatim prefix
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 14s
CI / Rust formatting, lint and tests (pull_request) Successful in 3m45s
PR title / Conventional Commit title (pull_request) Successful in 4s
CI / Release packages and stable upgrades (pull_request) Failing after 1h0m3s
7fb3fc72c3
A folder chosen in Settings was saved as tree::absolute gives it, fs::canonicalize's \\?\X:\... on Windows. The build
files folder goes on to longshot-builder as --cache, and clang, given \\?\ paths, finds no header beside a source nor
in an include folder: every build failed with "'<header>' file not found" for each file.

The selection is saved in its plain spelling (X:\..., \\server\share\...), and the four readers of the folder
settings (home::work, home::data_folder, game::install_root, the stable migration's buildsFolder) read one an earlier
launcher saved verbatim in the plain spelling too, so players who chose a folder are fixed by the update. Inside the
launcher the folders are still compared and recorded as tree::absolute gives them: each is canonicalized again, and
the version-location records keep their keys. tree::link_path, which already made a path plain, moves to fsx::plain
for the readers outside folders/.

Fixes #297

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dyst changed title from WIP: fix(folders): save and read chosen folders without a verbatim prefix to fix(folders): save and read chosen folders without a verbatim prefix 2026-11-27 14:58:23 +00:00
fix(folders): preserve Windows path identity across settings and shortcuts
Some checks failed
CI / What the change needs (pull_request) Successful in 13s
PR title / Conventional Commit title (pull_request) Successful in 14s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 26s
CI / Rust formatting, lint and tests (pull_request) Successful in 9m56s
CI / Release packages and stable upgrades (pull_request) Failing after 53m38s
373346aaae
Owner

Pushed 373346aaae51 to preserve Windows path identity across Settings and existing Steam shortcuts.

The follow-up guards the conversion so a Windows path is simplified only when it can retain its meaning in the ordinary namespace. It also accepts an existing Steam shortcut's verbatim profile path when its parent resolves to the configured profiles directory, and recognizes the old shortcut in the Versions page.

The launcher core suite passed (166 tests, one ignored). The synthetic Windows fixture checked path conversion and verified that an existing shortcut can resolve the managed profile while a different profile directory is rejected.

Locked Clippy passed as well. A native Windows Steam launch remains to be checked.

Pushed `373346aaae51` to preserve Windows path identity across Settings and existing Steam shortcuts. The follow-up guards the conversion so a Windows path is simplified only when it can retain its meaning in the ordinary namespace. It also accepts an existing Steam shortcut's verbatim profile path when its parent resolves to the configured profiles directory, and recognizes the old shortcut in the Versions page. The launcher core suite passed (166 tests, one ignored). The synthetic Windows fixture checked path conversion and verified that an existing shortcut can resolve the managed profile while a different profile directory is rejected. Locked Clippy passed as well. A native Windows Steam launch remains to be checked.
HumanBean deleted branch fix/verbatim-folder-paths 2026-11-27 15:48:53 +00:00
Sign in to join this conversation.
No reviewers
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!298
No description provided.