Config: an empty VICTORY_CONFIG means unset (port of VIctory#363) #52

Open
github-bot wants to merge 2 commits from github-bot/gh-52 into main AGit
Owner

@⁠lcg007xd-c on GitHub · 2026-11-25 20:53 UTC · original
lcg007xd-c:port/empty-victory-config → main · +20 −1 · 1 files · 2 commits · open

What

Config::load treated an empty VICTORY_CONFIG as an explicit path. PathBuf::from("") is not a file, so startup aborted with "VICTORY_CONFIG points at , which does not exist". The other path variables already treat an empty value as unset. This one now does too: VICTORY_CONFIG= falls back to ./victory.toml (or to no config file), and a non-empty value still selects that exact file.

This comes up with launchers and scripts that always export the variable, sometimes empty.

Port

Cherry-pick (-x) of github.com/Marvisak/VIctory@fd44561 from upstream https://github.com/Marvisak/VIctory/pull/363. Enzo Souza Duarte is still the commit author. It applied cleanly.

Test

empty_config_env_is_ignored covers the empty and non-empty cases through the new explicit_config_path helper. The helper is new, so the test doesn't compile against the old code. The old behaviour is the bug: std::env::var_os returned Some(""), which was used as the path.

How this was checked (Linux, no Windows PC or game files)

  • The portable CI commands pass locally on this branch: cargo clippy -p victory-core -p victory-pe -p victory-pipeline -p victory-shader -p victory-formats -p victory-game -p xtask --all-targets --locked -- -D warnings, then cargo test on the same crates (rebased on current main).
  • cargo clippy with the same crates and --target x86_64-pc-windows-msvc (check only, no link) is clean.
  • rustfmt --check is clean on the changed file.

Not tested: Windows runtime, GPU (D3D12/DXIL validation) and the game itself.

🤖 Generated with Claude Code

**@⁠lcg007xd-c** on GitHub · 2026-11-25 20:53 UTC · [original](https://github.com/uiliannn/VItoriaBr/pull/52) `lcg007xd-c:port/empty-victory-config` → `main` · +20 −1 · 1 files · 2 commits · open ## What `Config::load` treated an empty `VICTORY_CONFIG` as an explicit path. `PathBuf::from("")` is not a file, so startup aborted with "VICTORY_CONFIG points at , which does not exist". The other path variables already treat an empty value as unset. This one now does too: `VICTORY_CONFIG=` falls back to `./victory.toml` (or to no config file), and a non-empty value still selects that exact file. This comes up with launchers and scripts that always export the variable, sometimes empty. ## Port Cherry-pick (`-x`) of https://github.com/Marvisak/VIctory/commit/fd44561 from upstream https://github.com/Marvisak/VIctory/pull/363. Enzo Souza Duarte is still the commit author. It applied cleanly. ## Test `empty_config_env_is_ignored` covers the empty and non-empty cases through the new `explicit_config_path` helper. The helper is new, so the test doesn't compile against the old code. The old behaviour is the bug: `std::env::var_os` returned `Some("")`, which was used as the path. ## How this was checked (Linux, no Windows PC or game files) - The portable CI commands pass locally on this branch: `cargo clippy -p victory-core -p victory-pe -p victory-pipeline -p victory-shader -p victory-formats -p victory-game -p xtask --all-targets --locked -- -D warnings`, then `cargo test` on the same crates (rebased on current `main`). - `cargo clippy` with the same crates and `--target x86_64-pc-windows-msvc` (check only, no link) is clean. - `rustfmt --check` is clean on the changed file. Not tested: Windows runtime, GPU (D3D12/DXIL validation) and the game itself. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
(cherry picked from commit fd44561ea1180aff5380285527fb8cac8195f4e8)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:42:39 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/52/head:github-bot/gh-52'
git switch 'github-bot/gh-52'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-52'
git switch 'github-bot/gh-52'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-52'
git switch 'github-bot/gh-52'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-52'
git switch 'main'
git merge --squash 'github-bot/gh-52'
git switch 'main'
git merge --ff-only 'github-bot/gh-52'
git switch 'main'
git merge 'github-bot/gh-52'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.