Config: ignore an empty VICTORY_CONFIG #363
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!363
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/363/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@enzoduarte1 on GitHub · 2026-11-24 02:36 UTC · original
enzoduarte1:config/empty-config-env→main· +20 −1 · 1 files · 1 commits · merged 2026-11-25 00:19 UTCWhat
Config::loadtreats an emptyVICTORY_CONFIGas an explicit path:PathBuf::from("")is not a file, so startup fails withVICTORY_CONFIG points at , which does not exist. The other path variables inresolveignore empty values; PR #341 makesVICTORY_TEST_TITLESconsistent with them.The environment lookup now goes through a small helper that filters empty values, so
VICTORY_CONFIG=falls back to./victory.toml(or no config file) instead of aborting. A non-empty value still selects that exact file. A unit test covers empty and non-empty values.Tested
x86_64-pc-windows-gnu(this machine has no MSVC linker).cargo test -p victory-core: 9 passed, 0 failed.cargo test --workspace --exclude victory-loader: all suites passed.cargo clippy -p victory-core --all-targets -- -D warnings: clean.cargo clippy --workspace --all-targets: finishes successfully; it still reports the pre-existing warnings that PR #355 fixes.rustfmt --edition 2024 --check crates/victory-core/src/config.rsandgit diff --check: clean.cargo xtask policy: 151 files ok. No game files or data taken from them were added.cargo test -p victory-loader --test load_probe. Its fixture passes MSVC's/DELAYLOADlink flag, which MinGW's linker rejects here; the same failure occurs on unmodifiedmain.cargo fmt --all --checkalso has unrelated pre-existing diffs, so no other files were reformatted.Checklist
cargo fmt,cargo clippy --workspace --all-targetsandcargo test --workspacepass — see the toolchain limitations above; the changed crate is clean.cargo xtask policypasses. The change adds no game files or data taken from them (docs/asset-policy.md).@SkippySteve on GitHub · 2026-11-24 03:06 UTC · original
Thanks for this. The bug is real: on
main,VICTORY_CONFIG=is turned intoPathBuf::from(""), and startup stops withVICTORY_CONFIG points at , which does not exist. The fix is right too.What I checked
4874c3f), Linux,cargo test -p victory-core config: 5 passed, including the newempty_config_env_is_ignored.resolvedoes, so the test doesn't change the process environment. Good.This overlaps with #241
#241 (Core host UX: XDG data dir, config-relative paths) already has this fix. Its
explicit_configdoes the same.filter(|v| !v.is_empty())onVICTORY_CONFIG, and the module docs now say "a variable that is set but empty counts as unset". Its testvictory_config_expands_tilde_and_ignores_emptycovers the empty value. It also expands a leading~and gives a clearer error when the value names a folder.The two PRs change the same lines of
Config::load, so merging one gives the other a conflict incrates/victory-core/src/config.rs. I checked this with a trial merge.Suggestion
Either way, nothing needs to change in this PR.
@enzoduarte1 on GitHub · 2026-11-24 03:34 UTC · original
Thanks for checking this. Agreed: if PR 241 lands first, this change is redundant and can be closed; otherwise it can land on its own and PR 241 can drop its copy of the filter. I will leave the call to the maintainers — nothing needs changing here.