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

Manually merged
github merged 1 commit from gh-pr/49/head into gh-pr/49/base 2026-11-26 04:06:25 +00:00
Owner

@⁠gefydev on GitHub · 2026-11-22 22:21 UTC · original
gefydev:vfs-host-drive-paths → main · +64 −16 · 1 files · 1 commits · merged 2026-11-22 22:31 UTC

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.
**@⁠gefydev** on GitHub · 2026-11-22 22:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/49) `gefydev:vfs-host-drive-paths` → `main` · +64 −16 · 1 files · 1 commits · merged 2026-11-22 22:31 UTC 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.
The default "D:" mount (the package drive, XDefiant's d:\hunter\...)
translated every path on the PC's D: drive. With the game or XCL's data
on D:, the host could not read the game's exe: D:\games\x\game.exe
became <game>\games\x\game.exe ("loading the game failed: ... os error
3"). The e2e test fails this way when the repository is on D:.

- 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", "GAME:\x" made relative
  by a runtime) is looked for before the drive mounts. With the current
  directory on D:, the "D:" mount took it first and the title's
  GAME:\ reads failed with ERROR_INVALID_NAME.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:06:24 +00:00
github manually merged commit 61c6be863f into gh-pr/49/base 2026-11-26 04:06:25 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-22 22:31 UTC · original

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.

**@⁠ivall** on GitHub · 2026-11-22 22:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/49#issuecomment-7086879705) 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.