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

Closed
github-bot wants to merge 1 commit from gh-pr/8/head into gh-pr/8/base
Owner

@⁠lordra9-svg on GitHub · 2026-11-27 21:50 UTC · original
lordra9-svg:fix/data-dir-outside-repo → main · +52 −8 · 5 files · 1 commits · closed without merging

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.

**@⁠lordra9-svg** on GitHub · 2026-11-27 21:50 UTC · [original](https://github.com/Slaktarn700/SlaktarnVI/pull/8) `lordra9-svg:fix/data-dir-outside-repo` → `main` · +52 −8 · 5 files · 1 commits · closed without merging ## 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.
The runtime refuses to write game-derived data inside a VIctory source tree
(docs/asset-policy.md), so a checkout failed at the first run with the scripts'
default linux/victory-data/ (issue #3). Put the data directory under
$XDG_DATA_HOME/victory (default ~/.local/share/victory) when the linux/ folder
is still in a tree with .victory-root; a linux/ folder copied out of the tree
keeps its own victory-data/ as before. The launcher's settings and shader
cache use the same rule.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 03:06:23 +00:00
github-bot closed this pull request 2026-12-01 03:06:23 +00:00
Author
Owner

@⁠Slaktarn700 on GitHub · 2026-11-29 11:17 UTC · original

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** on GitHub · 2026-11-29 11:17 UTC · [original](https://github.com/Slaktarn700/SlaktarnVI/pull/8#issuecomment-7255013935) 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.
Author
Owner

@⁠Slaktarn700 on GitHub · 2026-11-29 22:01 UTC · original

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.

**@⁠Slaktarn700** on GitHub · 2026-11-29 22:01 UTC · [original](https://github.com/Slaktarn700/SlaktarnVI/pull/8#issuecomment-7263334689) 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

This discussion has been locked. Commenting is limited to contributors.
No description provided.