linux: keep caches outside the source tree while linux/ is in the checkout (fixes #3) #8

Closed
lordra9-svg wants to merge 1 commit from upstream-pr/8 into main
lordra9-svg commented 2026-11-27 21:50:28 +00:00 (Migrated from github.com)

Imported from Slaktarn700/SlaktarnVI. Originally posted by lordra9-svg on 2026-11-27T21:50:28Z.


Why

A first run from a checkout fails before the title starts, because the scripts default saves and caches to linux/victory-data/ and the runtime refuses to write game-derived data inside a VIctory source tree. This is issue #3: moving linux/ out of the checkout works around it, but then the folder loses the tree's build output and the launcher's Play button path.

What

  • New linux/data-dir.sh (valhalla_data_dir): if the given folder is under a tree with .victory-root, the data directory is $XDG_DATA_HOME/victory (default ~/.local/share/victory); otherwise it stays <linux>/victory-data, as before. So a linux/ folder copied out of the checkout keeps the old behaviour exactly.
  • run-victory.sh and run-7900.sh use it for VICTORY_DATA_DIR, VICTORY_CACHE_DIR and VKD3D_SHADER_CACHE_PATH.
  • The launcher uses the same rule for launcher.json, the prepared-shader cache and the Prepare environment.
  • README notes where the data goes in each case.

Testing

Machine: Ryzen 7 7700, RX 7800 XT (RADV, Mesa 26.3.1), Bazzite, Proton Experimental. A real Xbox Series dump, GAME_DIR/GAME_EXE pointing at it, PATCHED=0 (Steam's Proton).

  • bash -c '. linux/data-dir.sh; valhalla_data_dir linux' → /home/<user>/.local/share/victory
  • the same helper on a copy of linux/ outside the checkout → <copy>/victory-data
  • ./run-7900.sh from the checkout with no VICTORY_CACHE_DIR/VICTORY_DATA_DIR/VKD3D_SHADER_CACHE_PATH set: the previous refusal is gone; the run used ~/.local/share/victory/cache-7900\images and .../data/7952987A/storage, mapped the title, and ran until the 75 s test timeout.
  • bash -n on the three scripts and python3 -m py_compile on the launcher pass.

Not covered: the Windows path (launcher/scripts are Linux-only) and the separate “Play does nothing after moving linux/ out of the tree” report in the issue; this change removes the need to move it.

AI use: patch, test runs and this text were produced by an OpenCode agent running DeepSeek V4.1 Flash; submitted from @lordra9-svg's account.

<!-- greyfinch-sync:Slaktarn700/SlaktarnVI:issue:5533537008 --> Imported from [Slaktarn700/SlaktarnVI](https://github.com/Slaktarn700/SlaktarnVI/pull/8). Originally posted by [lordra9-svg](https://github.com/lordra9-svg) on 2026-11-27T21:50:28Z. --- ## Why A first run from a checkout fails before the title starts, because the scripts default saves and caches to `linux/victory-data/` and the runtime refuses to write game-derived data inside a VIctory source tree. This is issue #3: moving `linux/` out of the checkout works around it, but then the folder loses the tree's build output and the launcher's Play button path. ## What - New `linux/data-dir.sh` (`valhalla_data_dir`): if the given folder is under a tree with `.victory-root`, the data directory is `$XDG_DATA_HOME/victory` (default `~/.local/share/victory`); otherwise it stays `<linux>/victory-data`, as before. So a `linux/` folder copied out of the checkout keeps the old behaviour exactly. - `run-victory.sh` and `run-7900.sh` use it for `VICTORY_DATA_DIR`, `VICTORY_CACHE_DIR` and `VKD3D_SHADER_CACHE_PATH`. - The launcher uses the same rule for `launcher.json`, the prepared-shader cache and the Prepare environment. - README notes where the data goes in each case. ## Testing Machine: Ryzen 7 7700, RX 7800 XT (RADV, Mesa 26.3.1), Bazzite, Proton Experimental. A real Xbox Series dump, `GAME_DIR`/`GAME_EXE` pointing at it, `PATCHED=0` (Steam's Proton). - `bash -c '. linux/data-dir.sh; valhalla_data_dir linux'` → `/home/<user>/.local/share/victory` - the same helper on a copy of `linux/` outside the checkout → `<copy>/victory-data` - `./run-7900.sh` from the checkout with no `VICTORY_CACHE_DIR`/`VICTORY_DATA_DIR`/`VKD3D_SHADER_CACHE_PATH` set: the previous refusal is gone; the run used `~/.local/share/victory/cache-7900\images` and `.../data/7952987A/storage`, mapped the title, and ran until the 75 s test timeout. - `bash -n` on the three scripts and `python3 -m py_compile` on the launcher pass. Not covered: the Windows path (launcher/scripts are Linux-only) and the separate “Play does nothing after moving linux/ out of the tree” report in the issue; this change removes the need to move it. AI use: patch, test runs and this text were produced by an OpenCode agent running DeepSeek V4.1 Flash; submitted from @lordra9-svg's account.
Slaktarn700 commented 2026-11-29 11:17:47 +00:00 (Migrated from github.com)

Imported from Slaktarn700/SlaktarnVI. Originally posted by Slaktarn700 on 2026-11-29T11:17:47Z.


Fixed in my working copy in another way (data goes to ~/.local/share/valhalla). Merging #8 as well would move people's caches twice, so I will not merge it, but thank you lordra9-svg for the work.

<!-- greyfinch-sync:Slaktarn700/SlaktarnVI:comment:7255013935 --> Imported from [Slaktarn700/SlaktarnVI](https://github.com/Slaktarn700/SlaktarnVI/pull/8#issuecomment-7255013935). Originally posted by [Slaktarn700](https://github.com/Slaktarn700) on 2026-11-29T11:17:47Z. --- Fixed in my working copy in another way (data goes to ~/.local/share/valhalla). Merging #8 as well would move people's caches twice, so I will not merge it, but thank you lordra9-svg for the work.
Slaktarn700 commented 2026-11-29 22:01:02 +00:00 (Migrated from github.com)

Imported from Slaktarn700/SlaktarnVI. Originally posted by Slaktarn700 on 2026-11-29T22:01:02Z.


main now keeps everything in ~/.local/share/valhalla (VALHALLA_HOME for another place), so people's caches move only once; I would like to close this as replaced. Thank you for the clear report and tests; looking at every parent folder is a good point.

<!-- greyfinch-sync:Slaktarn700/SlaktarnVI:comment:7263334689 --> Imported from [Slaktarn700/SlaktarnVI](https://github.com/Slaktarn700/SlaktarnVI/pull/8#issuecomment-7263334689). Originally posted by [Slaktarn700](https://github.com/Slaktarn700) on 2026-11-29T22:01:02Z. --- main now keeps everything in `~/.local/share/valhalla` (`VALHALLA_HOME` for another place), so people's caches move only once; I would like to close this as replaced. Thank you for the clear report and tests; looking at every parent folder is a good point.

Pull request closed

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
Slaktarn700/SlaktarnVI!8
No description provided.