fix(folders): save and read chosen folders without a verbatim prefix #298
No reviewers
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!298
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/LongshotLauncher:fix/verbatim-folder-paths"
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 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::canonicalizegives (\\?\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\...).home::work,home::data_folder,game::install_root, and the stable migration'sbuildsFolder(src/players/stable.rs).tree::absolutestill returnsfs::canonicalize's spelling, so the folders a move compares, its receipts and destinations, and theversion-locationsrecord keys stay as they were. An earlier attempt that madetree::absoluteitself return plain paths split the record keys from the lookups inlibrary::existing, which canonicalize again, and broke three move tests.tree::link_path, which already turned a verbatim path into the plain one, moves tofsx::plainso the readers outsidefolders/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):
folders::tests::a_chosen_folder_is_saved_and_read_without_a_verbatim_prefix(Windows only, like the prefix). It fails onmain(saved as \\?\E:\...\build files) and passes here. It chooses a folder throughChange::prepare+apply, checks the savedworksetting, then saveswork,dataFolderandbuildsFolderverbatim, as this launcher did, and checkshome::work,home::data_folderandgame::install_rootread them plain.cargo test --locked: 122 passed, 11 failed. The same 11 fail onmainon Windows (mainhas 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 --checkandcargo clippy --locked --all-targets -- -D warnings: clean.tests/test_launcher_core.py: the 15 catalogs validate, then itscargo testgives the result above. Tooling'stest_release.pywithLAUNCHER=$PWD: 46 tests OK.--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), thencompile_failed.moves_profiles_and_custom_installs_together_and_can_restore_the_defaultchanges by design: after a move,home::data_folderis the plain spelling of the canonical folder, not the verbatim one. On Linux the two are the same.Still to test:
workin the launcher's settings has no\\?\, and the build compiles.workwas saved as\\?\X:\...by the current nightly, updated to this one. Expected: the next build compiles with no change in Settings.Risks
info.rs,versions.rs,library::existing), and profile folders are rebuilt fromdata_foldereach time. A comparison I missed would show up as a version or profile not recognised after the update. A revert restores the old behaviour.The builder also strips the prefix from
--cachefor launchers without this fix: a separate Longshot pull request, linked from #297.🤖 Generated with Claude Code
WIP: fix(folders): save and read chosen folders without a verbatim prefixto fix(folders): save and read chosen folders without a verbatim prefixPushed
373346aaae51to 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.