Skip to content

Port upstream #363: an empty VIPORT_CONFIG means unset - #32

Merged
DesertGamer merged 1 commit into
DesertGamer:mainfrom
lcg007xd-c:port/upstream-363-empty-config
Nov 25, 2026
Merged

DesertGamer merged 1 commit into
DesertGamer:mainfrom
lcg007xd-c:port/upstream-363-empty-config

Conversation

@lcg007xd-c

Copy link
Copy Markdown
Contributor

What this changes

This ports Marvisak/VIctory#363 by Enzo Souza Duarte. It is cherry-picked with -x, so the commit keeps their authorship.

Config::load takes VIPORT_CONFIG as set even when it is empty. Then it requires a file named "". On main, with VIPORT_CONFIG= (empty) in the environment:

Config::load() -> Err("reading : No such file or directory (os error 2)")

So viport fails at start-up instead of using ./viport.toml. That happens, for example, after set VIPORT_CONFIG= in a shell, or in a launcher that always passes the variable. All the other path variables already treat an empty value as unset (env_path in Config::resolve). Upstream made VICTORY_CONFIG behave the same way.

VIPort has the upstream merge of #363 in its history, but the change is not in the tree. It was lost in a later merge.

The change adds explicit_config_path, which drops an empty value, plus #363's unit test. Both conflicts came from the rename: the new lines use VIPORT_CONFIG, and the helper sits after VIPort's newer read_config_file.

Checked

  • No game data of any kind (files, extracts, screenshots, dumps, saves): see docs/asset-policy.md
  • No binary files or archives
  • No new dependency, build.rs, git hook, .cargo config, CI change or script (or an issue explains why)
  • No download, no started program, no network connection added (or an issue explains why)
  • cargo test --workspace passes (only viport-core on Linux, see below)
  • cargo clippy --workspace --all-targets --locked -- -D warnings passes (for viport-core)
  • The code I wrote is formatted with rustfmt; I did not reformat lines I did not change

What I ran

On Linux, Rust 1.98.1:

  • On main, a throwaway test (not in this PR) that sets VIPORT_CONFIG="" and calls Config::load() gives the error above.
  • On this branch, cargo test -p viport-core --locked: 15 passed, including config::tests::empty_config_env_is_ignored.
  • cargo clippy -p viport-core --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings: clean.

Not run: the viport binary on Windows.

Overlaps

None. No open PR touches viport-core/src/config.rs.

🤖 Generated with Claude Code

@DesertGamer
DesertGamer merged commit e87e4c5 into DesertGamer:main Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants