VFS: a console drive mount leaves the PC's own folders on that drive #48

Merged
gefydev merged 1 commit from upstream-pr/49 into main 2026-11-22 22:31:13 +00:00
gefydev commented 2026-11-22 22:21:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-22T22:21:10Z.


With the repository, a game or XCL's data on the PC's D: drive, the default D: mount (the package drive, for paths like d:\hunter\...) translated the PC's own paths too. On main, the e2e test fails for that reason when the repository is on D:. The host can't read the game's exe:

xcl: loading the game failed: reading D:\xcl-test\xcl\target\e2e\game\xcl_testtitle.exe: The system cannot find the path specified. (os error 3)

D:\xcl-test\...\game\xcl_testtitle.exe became <game>\xcl-test\...\game\xcl_testtitle.exe.

Two changes in vfs.rs:

  • A plain drive path that is already inside the game folder or the title's data folder is left alone. Console paths on that drive (D:\hunter\...) still go to the game folder.
  • An embedded console mount (<cwd>\GAME:\x, when a runtime treats GAME:\x as relative) is now looked for before the drive mounts. With only the first change, the test title ran on D: but one check still failed: with the current directory on D:, the D: mount took D:\...\GAME:\data\... first ([FAIL] files: console paths G:\ and GAME: read from the game folder: ... (os error 123)).

One ambiguity is left: a console path that happens to land inside the game folder's real location (a game installed at D:\hunter reading D:\hunter\x) is now taken as the PC path. I don't think that's worth more logic.

Validation

  • New test a_console_drive_mount_leaves_the_pcs_own_folders_on_that_drive mounts the drive that holds the test folders. On main it fails on both cases above.
  • Windows 11, MSVC, release, GTX 1650, repository on D:. cargo test --workspace --release --no-fail-fast:
    • main (055b0ad): test_title_runs_and_game_folder_is_untouched fails with the error above. Everything else passes.
    • This branch: everything passes, e2e included. The lib has 339 passed and 14 ignored.
  • cargo test -p xcl --lib on Windows GNU under Wine passes too.
<!-- greyfinch-sync:ivall/xcl:issue:6548557614 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/49). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-22T22:21:10Z. --- With the repository, a game or XCL's data on the PC's D: drive, the default `D:` mount (the package drive, for paths like `d:\hunter\...`) translated the PC's own paths too. On `main`, the e2e test fails for that reason when the repository is on D:. The host can't read the game's exe: ``` xcl: loading the game failed: reading D:\xcl-test\xcl\target\e2e\game\xcl_testtitle.exe: The system cannot find the path specified. (os error 3) ``` `D:\xcl-test\...\game\xcl_testtitle.exe` became `<game>\xcl-test\...\game\xcl_testtitle.exe`. Two changes in `vfs.rs`: - A plain drive path that is already inside the game folder or the title's data folder is left alone. Console paths on that drive (`D:\hunter\...`) still go to the game folder. - An embedded console mount (`<cwd>\GAME:\x`, when a runtime treats `GAME:\x` as relative) is now looked for before the drive mounts. With only the first change, the test title ran on D: but one check still failed: with the current directory on D:, the `D:` mount took `D:\...\GAME:\data\...` first (`[FAIL] files: console paths G:\ and GAME: read from the game folder: ... (os error 123)`). One ambiguity is left: a console path that happens to land inside the game folder's real location (a game installed at `D:\hunter` reading `D:\hunter\x`) is now taken as the PC path. I don't think that's worth more logic. ## Validation - New test `a_console_drive_mount_leaves_the_pcs_own_folders_on_that_drive` mounts the drive that holds the test folders. On `main` it fails on both cases above. - Windows 11, MSVC, release, GTX 1650, repository on D:. `cargo test --workspace --release --no-fail-fast`: - `main` (055b0ad): `test_title_runs_and_game_folder_is_untouched` fails with the error above. Everything else passes. - This branch: everything passes, e2e included. The lib has 339 passed and 14 ignored. - `cargo test -p xcl --lib` on Windows GNU under Wine passes too.
upstream-sync closed this pull request 2026-11-24 06:56:55 +00:00
ivall commented 2026-11-24 07:00:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-22T22:31:25Z.


Thanks, merged! This is the third fix for this bug (#33 and #35 had their own takes inside bigger PRs), and the smallest and clearest one. Checking for an embedded GAME: before the drive mounts is a good catch too.

I tested it on top of current main with the MSVC toolchain on Windows: all tests pass, 339 lib tests with your new one, the e2e test title, and the GPU tests. My games and the repository are on C: and E:, so the D: mount doesn't overlap here. Still, every file the title opens goes through classify, so I also ran two of the heaviest file readers:

  • Fortnite (Unreal paks through CreateFile2) reaches its title screen;
  • Unicorn Overlord (.cpk archives through CreateFileA) shows its title screen.

Neither had a file error in the log.

The ambiguity you mention is fine by me: a console path that happens to equal the game folder's real location on the same drive.

<!-- greyfinch-sync:ivall/xcl:comment:7086879705 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/49#issuecomment-7086879705). Originally posted by [ivall](https://github.com/ivall) on 2026-11-22T22:31:25Z. --- Thanks, merged! This is the third fix for this bug (#33 and #35 had their own takes inside bigger PRs), and the smallest and clearest one. Checking for an embedded `GAME:` before the drive mounts is a good catch too. I tested it on top of current `main` with the MSVC toolchain on Windows: all tests pass, 339 lib tests with your new one, the e2e test title, and the GPU tests. My games and the repository are on C: and E:, so the `D:` mount doesn't overlap here. Still, every file the title opens goes through `classify`, so I also ran two of the heaviest file readers: - Fortnite (Unreal paks through `CreateFile2`) reaches its title screen; - Unicorn Overlord (`.cpk` archives through `CreateFileA`) shows its title screen. Neither had a file error in the log. The ambiguity you mention is fine by me: a console path that happens to equal the game folder's real location on the same drive.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!48
No description provided.