Config: read victory.toml beside the executable; name a missing path (#3872) #3895

Open
MannA-001 wants to merge 2 commits from upstream-pr/3895 into main
MannA-001 commented 2026-11-30 14:15:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MannA-001 on 2026-11-30T14:15:08Z.


Fixes the two causes of #3872 that are in this repository.

What happens

  1. The config file beside victory.exe is ignored. Config::load reads VICTORY_CONFIG, else ./victory.toml in the working folder. A victory.exe started from a shortcut, by double-click, or from another terminal folder does not see the victory.toml edited next to it. It silently falls back to the defaults and then fails with "The system cannot find the path specified (os error 3)". That is the report: "I've edited victory.toml for it to work", and it still cannot find the path.
  2. A game folder that does not exist looks like success. translate --cache over a missing game_dir prints containers 0 in 0.0 s: 0 already cached, 0 translated, 0 refused and exits 0, with nothing in the log.

Change

  • victory-core::config: without VICTORY_CONFIG and without ./victory.toml, the victory.toml in the executable's folder is read (default_config_path). ./victory.toml still comes first, so existing setups are unchanged. victory config already prints which file was used.
  • apps/victory: default_paths (used by translate, census, shader-info) fails on the first path that does not exist, naming it and pointing at victory config. This covers paths given on the command line too.

Verification

  • New tests: the_config_beside_the_executable_is_read (victory-core) and a_path_that_does_not_exist_is_named (victory).
  • cargo test -p victory-core: 14 passed. cargo test -p victory --bin victory: 15 passed. cargo clippy -p victory-core -p victory --all-targets -- -D warnings: clean.
  • Release build, Windows 11: with a victory.toml beside a copied victory.exe, run from another folder, victory config shows config file : <exe folder>\victory.toml and its game_dir. With VICTORY_GAME_DIR set to a missing folder, translate --cache exits 1 with Error: C:\does\not\exist does not exist (victory config shows the paths in use and where they come from).

Not covered: the "warm shaders" command named in the report belongs to the forks (this tree has translate --cache). They share Config::load, so they get the config fix once they rebase.

AI use: Claude Code (Claude Opus 5.5).

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5567011067 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3895). Originally posted by [MannA-001](https://github.com/MannA-001) on 2026-11-30T14:15:08Z. --- Fixes the two causes of #3872 that are in this repository. ## What happens 1. **The config file beside `victory.exe` is ignored.** `Config::load` reads `VICTORY_CONFIG`, else `./victory.toml` in the *working folder*. A `victory.exe` started from a shortcut, by double-click, or from another terminal folder does not see the `victory.toml` edited next to it. It silently falls back to the defaults and then fails with "The system cannot find the path specified (os error 3)". That is the report: "I've edited victory.toml for it to work", and it still cannot find the path. 2. **A game folder that does not exist looks like success.** `translate --cache` over a missing `game_dir` prints `containers 0 in 0.0 s: 0 already cached, 0 translated, 0 refused` and exits 0, with nothing in the log. ## Change - `victory-core::config`: without `VICTORY_CONFIG` and without `./victory.toml`, the `victory.toml` in the executable's folder is read (`default_config_path`). `./victory.toml` still comes first, so existing setups are unchanged. `victory config` already prints which file was used. - `apps/victory`: `default_paths` (used by `translate`, `census`, `shader-info`) fails on the first path that does not exist, naming it and pointing at `victory config`. This covers paths given on the command line too. ## Verification - New tests: `the_config_beside_the_executable_is_read` (victory-core) and `a_path_that_does_not_exist_is_named` (victory). - `cargo test -p victory-core`: 14 passed. `cargo test -p victory --bin victory`: 15 passed. `cargo clippy -p victory-core -p victory --all-targets -- -D warnings`: clean. - Release build, Windows 11: with a `victory.toml` beside a copied `victory.exe`, run from another folder, `victory config` shows `config file : <exe folder>\victory.toml` and its `game_dir`. With `VICTORY_GAME_DIR` set to a missing folder, `translate --cache` exits 1 with `Error: C:\does\not\exist does not exist (`victory config` shows the paths in use and where they come from)`. Not covered: the "warm shaders" command named in the report belongs to the forks (this tree has `translate --cache`). They share `Config::load`, so they get the config fix once they rebase. AI use: Claude Code (Claude Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cloph-dsp commented 2026-11-30 14:20:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-30T14:20:49Z.


AI-assisted verification (Hy4 flash) — Windows / rustc 1.100.0 / MSVC, no game data.

Independent check of PR #3895 (OPEN, MERGEABLE, CLEAN, non-draft, 0 formal approvals, no prior comment from me).

Isolated worktree D:\Victory-Contrib\pr-3895-watch with dedicated CARGO_TARGET_DIR=D:\Victory-Contrib\target-3895 (never shared). Base 63bcca43c6a00a758510398fa43096ce7e4f7df0, head 37932d80eb83c96b02e697cdea77d5d2e873b530.

Negative control (new tests on base): git grep -F a_path_that_does_not_exist_is_named 63bcca43.. -- apps/victory/src/main.rs → exit 1 (no match); git grep -F the_config_beside_the_executable_is_read 63bcca43.. -- crates/victory-core/src/config.rs → exit 1 (no match). Both tests are new.

git diff --check 63bcca43..37932d8 → exit 0 (clean).

Tests (module-qualified, --exact, --test-threads=1):

  • cargo test --locked -p victory --bin victory -- tests::a_path_that_does_not_exist_is_named --exact --test-threads=1 --quiet → 1 passed; 0 failed; 0 ignored; 0 measured; 14 filtered out, exit 0.
  • cargo test --locked -p victory-core --lib -- config::tests::the_config_beside_the_executable_is_read --exact --test-threads=1 --quiet → 1 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out, exit 0.

Both pass with synthetic inputs only (temporary paths created by the tests). No GPU/driver involved or required (N/A); no specific GPU profile used. No game data, assets, extracted shaders, DRM or decrypt content was accessed, used or uploaded.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7281227838 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3895#issuecomment-7281227838). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-30T14:20:49Z. --- AI-assisted verification (Hy4 flash) — Windows / rustc 1.100.0 / MSVC, no game data. Independent check of PR #3895 (OPEN, MERGEABLE, CLEAN, non-draft, 0 formal approvals, no prior comment from me). Isolated worktree `D:\Victory-Contrib\pr-3895-watch` with dedicated `CARGO_TARGET_DIR=D:\Victory-Contrib\target-3895` (never shared). Base `63bcca43c6a00a758510398fa43096ce7e4f7df0`, head `37932d80eb83c96b02e697cdea77d5d2e873b530`. Negative control (new tests on base): `git grep -F a_path_that_does_not_exist_is_named 63bcca43.. -- apps/victory/src/main.rs` → exit 1 (no match); `git grep -F the_config_beside_the_executable_is_read 63bcca43.. -- crates/victory-core/src/config.rs` → exit 1 (no match). Both tests are new. `git diff --check 63bcca43..37932d8` → exit 0 (clean). Tests (module-qualified, `--exact`, `--test-threads=1`): - `cargo test --locked -p victory --bin victory -- tests::a_path_that_does_not_exist_is_named --exact --test-threads=1 --quiet` → `1 passed; 0 failed; 0 ignored; 0 measured; 14 filtered out`, exit 0. - `cargo test --locked -p victory-core --lib -- config::tests::the_config_beside_the_executable_is_read --exact --test-threads=1 --quiet` → `1 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out`, exit 0. Both pass with synthetic inputs only (temporary paths created by the tests). No GPU/driver involved or required (N/A); no specific GPU profile used. No game data, assets, extracted shaders, DRM or decrypt content was accessed, used or uploaded.
passerbyyhx commented 2026-12-01 14:00:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by passerbyyhx on 2026-12-01T14:00:26Z.


A shortcut-style launch on Windows at 37932d80 picked up the configuration beside the executable. A working-directory configuration took precedence, and an explicit VICTORY_CONFIG overrode both. One detail matters for relative paths. With game_dir = 'exe-marker' in the configuration beside the executable, shader-info reported the directory missing when it existed only beside the executable. Creating the same relative directory under the working directory made the command succeed. This used a copied CLI and empty synthetic directories.

AI-assisted verification with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7313542054 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3895#issuecomment-7313542054). Originally posted by [passerbyyhx](https://github.com/passerbyyhx) on 2026-12-01T14:00:26Z. --- A shortcut-style launch on Windows at `37932d80` picked up the configuration beside the executable. A working-directory configuration took precedence, and an explicit `VICTORY_CONFIG` overrode both. One detail matters for relative paths. With `game_dir = 'exe-marker'` in the configuration beside the executable, `shader-info` reported the directory missing when it existed only beside the executable. Creating the same relative directory under the working directory made the command succeed. This used a copied CLI and empty synthetic directories. AI-assisted verification with OpenAI Codex.
MannA-001 commented 2026-12-01 17:28:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MannA-001 on 2026-12-01T17:28:36Z.


@passerbyyhx Thanks, that was a real gap. 14bcecb reads relative paths in a config file from the folder that holds it, so game_dir = 'exe-marker' in the victory.toml beside the executable now finds the exe-marker beside it, from any working folder. Absolute paths and ./victory.toml behave as before. One side effect: a relative path in a file named by VICTORY_CONFIG is now read from that file's folder rather than the working folder, which I think is what anyone writing one expects. New test: relative_paths_in_a_config_file_are_read_from_its_folder.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7319359244 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3895#issuecomment-7319359244). Originally posted by [MannA-001](https://github.com/MannA-001) on 2026-12-01T17:28:36Z. --- @passerbyyhx Thanks, that was a real gap. `14bcecb` reads relative paths in a config file from the folder that holds it, so `game_dir = 'exe-marker'` in the `victory.toml` beside the executable now finds the `exe-marker` beside it, from any working folder. Absolute paths and `./victory.toml` behave as before. One side effect: a relative path in a file named by `VICTORY_CONFIG` is now read from that file's folder rather than the working folder, which I think is what anyone writing one expects. New test: `relative_paths_in_a_config_file_are_read_from_its_folder`.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3895:upstream-pr/3895'
git switch 'upstream-pr/3895'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3895'
git switch 'upstream-pr/3895'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3895'
git switch 'upstream-pr/3895'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3895'
git switch 'main'
git merge --squash 'upstream-pr/3895'
git switch 'main'
git merge --ff-only 'upstream-pr/3895'
git switch 'main'
git merge 'upstream-pr/3895'
git push origin 'main'
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
Marvisak/VIctory!3895
No description provided.