Repository navigation
Config: ignore an empty VICTORY_CONFIG - #363
Conversation
|
Thanks for this. The bug is real: on What I checked
This overlaps with #241 The two PRs change the same lines of Suggestion
Either way, nothing needs to change in this PR. |
|
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. |
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 4874c3f on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed).
An empty VICTORY_CONFIG now means unset, the same rule the other path variables in resolve already follow (env_path filters empty values). A non-empty value is still taken as the exact file, so a mistyped path still fails loudly. The helper takes the env lookup as a closure, matching how resolve is tested.
No issues found.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4874c3f to
fd44561
Compare
Merges Marvisak#188 Marvisak#213 Marvisak#214 Marvisak#219 Marvisak#221 Marvisak#311 Marvisak#324 Marvisak#363 Marvisak#406 Marvisak#454 Marvisak#529 Marvisak#560 Marvisak#708 Marvisak#937 Marvisak#941 Marvisak#963 Marvisak#1111 Marvisak#1159 Marvisak#1304 Marvisak#1306 onto main (ffe310e), each head unchanged, no conflicts. One change of mine: the long-format import descriptor code Marvisak#963 adds nests `if size == 0` in an `if let`, which clippy::collapsible_if rejects under -D warnings; it is now one `if let ... && size == 0` (clippy --fix, no change of behaviour). cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, is clean and cargo test --workspace --locked passes (388 passed, 7 ignored; main has 342 passed, 6 ignored). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
What
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 Chore: clear two workspace Clippy errors #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).