Core host UX: XDG data dir, config-relative paths, and clearer VICTORY_LOG handling #241

Closed
SkippySteve wants to merge 97 commits from upstream-pr/241 into main
SkippySteve commented 2026-11-24 01:43:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T01:43:22Z.


Host-side UX fixes in victory-core for where Victory keeps files and how it reports its settings. This PR now also includes #243, which changed the same function, #277, which makes victory config show the data folder, and #266, which warns when VICTORY_LOG/RUST_LOG does not parse. #243, #277 and #266 are closed in its favour.

Problem

  1. Config::data_dir is documented as "never inside the cache, which may be deleted at any time". Without LOCALAPPDATA (a native non-Windows host, e.g. the Linux crates/tools), default_dir used the cache base for both, so the default data dir was $XDG_CACHE_HOME/victory/data (~/.cache/victory/data). Clearing ~/.cache, as desktop cleaners and users routinely do, would delete what titles saved.
  2. A base variable that was set but empty (XDG_CACHE_HOME=, common in shells and wrapper scripts) or relative still won. The base then became relative to the working directory, usually the repo checkout, and cache_subdir failed with the asset-policy error instead of using ~/.cache.

Change (crates/victory-core/src/config.rs only)

  • With an absolute LOCALAPPDATA: unchanged (…\victory\cache, …\victory\data).
  • Without it: cache → $XDG_CACHE_HOME/victory (else ~/.cache/victory), data → $XDG_DATA_HOME/victory (else ~/.local/share/victory).
  • Empty or relative LOCALAPPDATA / XDG_CACHE_HOME / XDG_DATA_HOME / HOME values are skipped and the next candidate is tried, as the XDG spec asks. If none is usable you get the existing "set VICTORY_CACHE_DIR and VICTORY_DATA_DIR" error.
  • default_dir now reads through the same env closure that Config::resolve already takes, so the defaults can be unit-tested. load() still passes the real environment.
  • VICTORY_CACHE_DIR / VICTORY_DATA_DIR and victory.toml still take precedence.

Tests (hermetic: none read the host's real HOME/XDG_*/LOCALAPPDATA, and they use C:\… paths on Windows so they stay absolute)

  • local_app_data_holds_cache_and_data, data_is_not_under_the_xdg_cache, empty_or_relative_values_are_ignored, default_dir_prefers_localappdata_then_xdg_then_home, no_user_directory_is_an_error.
  • The two existing resolve tests now get HOME through the closure. Before, they failed under env -u HOME.

Validated on Linux (config part): cargo test -p victory-core passes, and also passes with HOME, XDG_CACHE_HOME and XDG_DATA_HOME unset. cargo clippy -p victory-core --all-targets -- -D warnings is clean for the host and for x86_64-pc-windows-msvc. config.rs passes rustfmt, and cargo xtask policy is ok. I haven't run it on Windows. No game data was used.

victory config shows the data folder (was #277, apps/victory/src/main.rs)
The data folder (saves, settings, crashes.log) is resolved by Config like the cache folder, but victory config neither printed it nor ran the outside-the-repository check on it, so a VICTORY_DATA_DIR or [paths].data_dir pointing into the source tree went unreported. It now prints data_dir and checks it with ensure_outside_repo alongside cache_dir. Two lines; apps/victory does not yet build on Linux (#235), so this part is checked by review only.

Warn when VICTORY_LOG / RUST_LOG does not parse (was #266, crates/victory-core/src/logging.rs)
A filter that tracing-subscriber rejects, for example VICTORY_LOG=victory_loader=loud, was dropped silently and the binary logged at its default level, so a typo looked like the target had nothing to log. logging::init now prints one line on stderr naming the variable, its value and the parse error, then falls back to the default level as before:

victory: ignoring VICTORY_LOG="victory_loader=loud" (...); logging at "info"

Picking the filter moves into choose_filter, so it can be tested without changing the process environment. Precedence is unchanged (VICTORY_LOG, then RUST_LOG, then the default). Five new tests: unset, VICTORY_LOG over RUST_LOG, the RUST_LOG fallback, and a bad value in each variable.

Config file paths and empty variables (config.rs, victory.example.toml)

  • Relative paths in the config file (game_dir, cache_dir, data_dir, test_titles) are now relative to the file. Before, with VICTORY_CONFIG pointing at another folder, cache_dir = "cache" landed under the working directory, which is often the repository, so the asset policy refused it. ./victory.toml behaves as before.
  • An empty VICTORY_CONFIG counts as unset instead of failing with "points at , which does not exist". An empty VICTORY_TEST_TITLES no longer replaces the file's list with nothing. The other VICTORY_* variables already ignored empty values.
  • victory.example.toml says this and gives the right VICTORY_TEST_TITLES separator (; on Windows, : elsewhere).
  • Tests: relative_file_paths_are_relative_to_the_file, the_default_config_file_keeps_paths_as_written, empty_test_titles_variable_falls_back_to_the_file.

Logging: empty filters and the diagnostics cap (logging.rs)

  • An empty (or blank) VICTORY_LOG/RUST_LOG counts as unset. Before, VICTORY_LOG= made an empty filter that hid everything but errors and also hid RUST_LOG.
  • A filter asking for debug or trace on a build without the diagnostics feature was capped at info without saying so. It now prints one line on stderr: victory: the log filter asks for trace output, but this build logs info and above; rebuild with --features diagnostics for debug and trace.
  • Tests: empty_values_count_as_unset, a_filter_above_the_cap_is_reported.

~ in configured paths (config.rs, victory.example.toml)

  • Neither TOML nor a quoted shell value expands ~. So game_dir = "~/Games/gta" in victory.toml named a folder literally called ~ next to the file, and VICTORY_GAME_DIR="~/Games/gta" named one under the working directory. That's an easy mistake on Linux/Proton setups.
  • A leading ~ component in [paths] values and in VICTORY_GAME_DIR/VICTORY_CACHE_DIR/VICTORY_DATA_DIR/VICTORY_TEST_TITLES now means the home directory: HOME, else USERPROFILE, if it is absolute. ~user/… and a ~ that is not the first component are left as written. A leading ~ with no usable home directory is refused (see below).
  • Tests: a_leading_tilde_is_the_home_directory, tilde_in_the_file_is_home_not_next_to_the_file, tilde_in_variables_is_home, home_dir_falls_back_to_userprofile_and_skips_relative.

VICTORY_CONFIG as a folder, non-UTF-8 log variables, Linux defaults (config.rs, logging.rs, victory.example.toml)

  • VICTORY_CONFIG pointing at the folder that holds victory.toml was reported as "which does not exist". It now says … which is a folder, not a config file; did you mean <folder>/victory.toml? (the hint only when that file is there). The file lookup moves into config_file so it can be tested.
  • A VICTORY_LOG/RUST_LOG value that is not valid UTF-8 was dropped silently by std::env::var(..).ok(). It is now reported on stderr (victory: ignoring RUST_LOG="w\xFF": it is not valid UTF-8) and treated as unset.
  • victory.example.toml gave only the %LOCALAPPDATA% defaults. It now also gives the Linux ones ($XDG_CACHE_HOME/victory or ~/.cache/victory, $XDG_DATA_HOME/victory or ~/.local/share/victory) and says VICTORY_CONFIG names the file, not its folder.
  • Tests: victory_config_must_name_a_file (uses a folder under the system temp dir), a_non_utf8_variable_is_reported_and_unset.

The data folder must not be inside the cache (config.rs, victory.example.toml)

  • data_dir is documented as never inside the cache, but explicit settings could still put it there, e.g. VICTORY_CACHE_DIR=~/victory with VICTORY_DATA_DIR=~/victory/data, or VICTORY_CACHE_DIR=~ with the default ~/.local/share/victory. Clearing the cache would then delete saves.
  • Config::resolve now fails with the data folder … is inside the cache folder …, which may be deleted at any time; set VICTORY_DATA_DIR or [paths].data_dir to a folder outside it. It compares the paths as written, so nothing has to exist yet. A sibling like /v-data next to /v is allowed, and so is the cache inside the data folder.
  • Test: data_inside_the_cache_is_refused. tilde_in_variables_is_home now sets the cache to ~/cache, because a cache of ~ would hold the default data folder.

~ in VICTORY_CONFIG (config.rs, victory.example.toml)

  • The other path variables expand a leading ~, but VICTORY_CONFIG did not, so a quoted VICTORY_CONFIG="~/victory.toml" failed with VICTORY_CONFIG points at ~/victory.toml, which does not exist. It now goes through the same expand_home (via a small explicit_config helper, so it can be tested without touching the real environment); empty still counts as unset. load() resolves the home directory once and reuses it.
  • Test: victory_config_expands_tilde_and_ignores_empty. This also covers what open #363 asks for (empty VICTORY_CONFIG), which this PR already did.

Validated (whole PR) on Linux: cargo test -p victory-core passes (33 tests), also with HOME/XDG_CACHE_HOME/XDG_DATA_HOME unset and with --features diagnostics. cargo clippy -p victory-core --all-targets -- -D warnings is clean with and without --features diagnostics, and for x86_64-pc-windows-msvc. cargo fmt -p victory-core --check is clean and cargo xtask policy is ok.

Say where each setting came from (config.rs, apps/victory/src/main.rs)

  • With a variable, the config file and a default for every path, it was not obvious which one won, and the data-inside-cache error did not say which setting to change.
  • Config now has origins (Origin::Env("VICTORY_CACHE_DIR"), Origin::File or Origin::Default) for game_dir, cache_dir, data_dir and test_titles. Empty variables still count as unset and are never the origin.
  • victory config prints it next to each value, e.g. cache_dir : /home/me/.cache/victory [default].
  • The data-inside-cache error now reads the data folder … (from default) is inside the cache folder … (from config file) ….
  • Tests: origins_name_the_setting_that_won, data_inside_the_cache_names_both_origins. With them, cargo test -p victory-core passes 33 tests (also with HOME/XDG_* unset and with --features diagnostics). clippy -D warnings is clean for the host, with diagnostics, and for x86_64-pc-windows-msvc. fmt is clean and cargo xtask policy is ok. As before, the main.rs lines are checked by review only (#235).

Refuse a Windows drive path on a non-Windows host (config.rs, victory.example.toml)

  • victory.example.toml ships game_dir = 'D:\victory-data\game'. On Linux that is not absolute, so a copy used unedited was anchored under the config file's folder (usually the repository) and only showed up later as a policy violation or a folder that does not exist.
  • [paths] values and VICTORY_GAME_DIR/VICTORY_CACHE_DIR/VICTORY_DATA_DIR/VICTORY_TEST_TITLES are now checked before use. On a non-Windows host, X:, X:\… or X:/… fails with [paths].game_dir is D:\victory-data\game, a Windows path, but this host is not Windows; set it to a path on this machine (in <file>). VICTORY_TEST_TITLES is checked before it is split, because : would cut D:\a in two. Windows is unchanged. The example file now says its paths are Windows examples.
  • Test: windows_drive_paths_are_refused_off_windows. On Linux cargo test -p victory-core passes 34 tests, also with HOME/XDG_* unset and with --features diagnostics. clippy -D warnings is clean for the host, with diagnostics, and for x86_64-pc-windows-msvc. fmt is clean and cargo xtask policy is ok.

A [paths] key at the top level of the config file (config.rs)

  • game_dir = '/games/gta' with no [paths] header (an easy first victory.toml), or a key written above the header, failed with only unknown field \game_dir`, expected `paths`. It now says game_dir must be under the [paths] table: put a `[paths]` line above it (see victory.example.toml), naming every misplaced key. Other parse errors ([path], gamedir = ...`) keep toml's own message.
  • Test: top_level_path_keys_say_where_they_belong; example_config_parses goes through the same parser. On Linux cargo test -p victory-core passes 35 tests, also with HOME/XDG_* unset and with --features diagnostics. clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

. and .. in the data/cache check (config.rs)

  • The data-inside-cache check compared the paths as written, so VICTORY_DATA_DIR=~/.cache/victory/../data (a sibling of the cache) was refused, and a cache of ~/victory/tmp/.. was not seen to hold ~/victory/data. Both paths now have . and .. folded lexically before the comparison (lexical). It still does not touch the disk or follow symlinks, and the error still shows the paths as written.
  • Tests: data_inside_the_cache_ignores_dot_dot, lexical_folds_dot_and_dot_dot. On Linux cargo test -p victory-core passes 37 tests, also with HOME/XDG_* unset and with --features diagnostics (run with TMPDIR outside the repository, which policy::tests::accepts_unrelated_directories needs). clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

Keep the game folder apart from the cache and data folders (config.rs, victory.example.toml)

  • The game folder is the user's own dump and is only read. Nothing stopped it from being inside the cache (VICTORY_CACHE_DIR=~/gta with VICTORY_GAME_DIR=~/gta/game), where clearing the cache would delete the dump, or the cache/data folder from being inside it (a victory.toml kept in the dump with cache_dir = "cache"), which writes derived files and saves into the dump.
  • Config::resolve now refuses both when a game folder is set, e.g. the cache folder … (from config file) is inside the game folder … (from config file), which holds your dump and is only read; set VICTORY_CACHE_DIR or [paths].cache_dir to a folder outside it. Compared like the data-inside-cache check: lexically, ./.. folded, no disk access. Siblings (/v and /v-cache) are fine. The example file says so.
  • Tests: game_folder_is_kept_apart_from_cache_and_data, a_config_file_inside_the_dump_cannot_put_the_cache_there (synthetic paths only). On Linux cargo test -p victory-core passes 39 tests, also with HOME/XDG_* unset and with --features diagnostics (TMPDIR outside the repository). clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

Control characters in a path setting (config.rs)

  • A variable read from a .env file with Windows line endings (set -a; . ./victory.env, a container env file, a Proton/Wine wrapper script) ends in an invisible \r. VICTORY_GAME_DIR=/games/gta\r was then reported later only as "does not exist", which looks right on screen.
  • Every path setting (VICTORY_GAME_DIR/VICTORY_CACHE_DIR/VICTORY_DATA_DIR/VICTORY_TEST_TITLES, VICTORY_CONFIG and the [paths] values) is now checked before use. One holding a control character fails with VICTORY_GAME_DIR is "/games/gta\r", which contains the control character '\r' (a Windows line ending: was it read from a file saved with CRLF line endings?); remove it. The value is quoted so the character shows. Spaces and non-ASCII names are unaffected.
  • Test: control_characters_in_paths_are_refused (synthetic paths only). On Linux cargo test -p victory-core passes 43 tests, also with HOME/XDG_* unset and with --features diagnostics (TMPDIR outside the repository). clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

Quoted path settings (config.rs)

  • Only a shell strips quotes. docker run --env-file, systemd EnvironmentFile=, IDE run configurations and Windows set VICTORY_GAME_DIR="D:\games" keep them, so VICTORY_GAME_DIR="/games/gta" arrived as "/games/gta" with the quotes. That is not absolute, so it was taken as a folder named " under the working directory (often the repository) and reported later only as "does not exist" or "inside the repository".
  • Every path setting (the four variables, VICTORY_CONFIG, the [paths] values) that starts and ends with the same " or ' now fails with VICTORY_GAME_DIR is "/games/gta", quotes included; the quotes are not removed when the value comes from an env file or a launcher rather than a shell, so remove them. A quote elsewhere in a name (/games/Rockstar's) is unaffected.
  • Test: quoted_paths_are_refused (synthetic paths only). On Linux cargo test -p victory-core passes 44 tests, also with HOME/XDG_* unset and with --features diagnostics (TMPDIR outside the repository). clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

Whitespace around a path setting (config.rs)

  • An env file or launcher keeps the spaces a shell would split off, so VICTORY_GAME_DIR= /games/gta arrived with a leading space. That is not absolute, so it was taken as a folder named under the config file's folder or the working directory (often the repository). A trailing space (or a no-break space pasted from a web page) was reported later only as "does not exist", which looks right on screen.
  • Every path setting that starts or ends with whitespace now fails with VICTORY_GAME_DIR is " /games/gta", which starts with whitespace; remove it. VICTORY_TEST_TITLES is also checked entry by entry, so /a: /b is caught. Spaces inside a name (/Program Files/x) are unaffected.
  • Test: surrounding_whitespace_in_paths_is_refused (synthetic paths only). On Linux cargo test -p victory-core passes 45 tests, clippy -D warnings is clean for victory-core and fmt is clean.

Unexpanded variables in a path setting (config.rs, victory.example.toml)

  • Only a shell expands $HOME (and only cmd expands %LOCALAPPDATA%). TOML, docker run --env-file, systemd EnvironmentFile= and launcher or IDE run configurations keep them as written. So game_dir = "$HOME/Games/gta", or data_dir = '%LOCALAPPDATA%\victory\data' copied from the defaults the example file lists, was relative. It was taken as a folder named $HOME under the config file's folder or the working directory (often the repository).
  • Every path setting (the four variables, VICTORY_CONFIG, the [paths] values) that names a variable now fails with VICTORY_GAME_DIR is $HOME/Games/gta, which names the variable $HOME; variables are not expanded in the config file or when the value comes from an env file or a launcher rather than a shell, so write the path out in full (a leading ~ is the home directory). It recognises a whole $NAME component, ${NAME} and %NAME% (including %ProgramFiles(x86)%). Real names such as $Recycle.Bin, share$, $HOME.old and 100% are unaffected. The example file now says variables are not expanded.
  • Test: unexpanded_variables_in_paths_are_refused (synthetic paths only). On Linux cargo test -p victory-core passes 46 tests, also with HOME/XDG_* unset and with --features diagnostics (TMPDIR outside the repository). clippy -D warnings is clean for the host, with diagnostics, and for x86_64-pc-windows-msvc. fmt is clean and cargo xtask policy is ok.

Empty values in the config file (config.rs, victory.example.toml)

  • An empty variable already counted as unset, but an empty value in the file did not. game_dir = '' (a blank a template leaves to fill in) was anchored at the config file's folder, often the repository, and with ./victory.toml it became the empty path, which is the working directory. test_titles = [''] did the same for one entry.
  • Empty game_dir, cache_dir, data_dir and test_titles entries in [paths] now count as unset, so the defaults apply and victory config reports [default], not [config file]. The example file says so.
  • Test: empty_file_values_count_as_unset (synthetic paths only). On Linux cargo test -p victory-core passes 47 tests, also with HOME/XDG_* unset and with --features diagnostics (TMPDIR and the build folder outside the repository). clippy -D warnings is clean for the host and for x86_64-pc-windows-msvc. fmt is clean and cargo xtask policy is ok.

A folder setting that names a file (config.rs)

  • VICTORY_GAME_DIR=~/games/gta/default.xex (the executable picked in a file dialog or pasted from a launcher's target, rather than its folder) was accepted and only failed later, per file, with "Not a directory". A cache or data folder that names an existing file failed on first use with "File exists", naming neither the setting nor the fix.
  • Each of the game, cache and data folders that names an existing file now fails at load with the game folder /games/gta/default.xex (from VICTORY_GAME_DIR) is a file, not a folder; set VICTORY_GAME_DIR or [paths].game_dir to the folder holding the dump, perhaps /games/gta. A path that does not exist yet is still fine.
  • Test: a_folder_setting_naming_a_file_is_refused (an empty scratch file under the system temp folder, removed afterwards; no game data). On Linux cargo test -p victory-core passes 48 tests, also with HOME/XDG_* unset and with --features diagnostics (TMPDIR and the build folder outside the repository). clippy -D warnings is clean for the host and for x86_64-pc-windows-msvc. fmt is clean and cargo xtask policy is ok.

A leading ~ with no home directory (config.rs)

  • With HOME and USERPROFILE unset or relative (env -i, a bare systemd unit, some containers), a leading ~ was kept as written. VICTORY_CACHE_DIR=~/cache then named a folder literally called ~ under the working directory (often the repository), and [paths].game_dir = '~/gta' one next to the config file. Such a folder is created on first use and easy to delete by mistake with rm -rf ~.
  • A leading ~ in any path setting (the four variables, VICTORY_CONFIG, the [paths] values) now fails at load when there is no home directory: VICTORY_CACHE_DIR is ~/cache, but there is no home directory to put in place of ~ (HOME is unset or not absolute); set HOME or write the full path. ~user/…, a non-leading ~, and paths without ~ are unaffected.
  • Test: a_leading_tilde_without_a_home_is_refused (synthetic paths only); a_leading_tilde_is_the_home_directory and victory_config_expands_tilde_and_ignores_empty updated. On Linux cargo test -p victory-core passes 49 tests, also with HOME/XDG_* unset (TMPDIR and the build folder outside the repository). clippy -D warnings is clean for the host and for x86_64-pc-windows-msvc. fmt is clean and cargo xtask policy is ok.

A file:// URI instead of a path (config.rs)

  • Copying a folder in a Linux file manager, or taking it from a .desktop file or a launcher's config, gives file:///home/me/Games/My%20Games/gta. Nothing decoded it: the value is relative, so it was taken as a folder named file: under the config file's folder or the working directory (often the repository), with %20 kept as three characters.
  • Every path setting (the four variables, VICTORY_CONFIG, the [paths] values) that starts with file: (any case) now fails at load: VICTORY_GAME_DIR is file:///games/My%20Games/gta, a file: URI rather than a path; write the path instead, perhaps /games/My Games/gta. The suggestion decodes %XX, accepts an empty or localhost host and turns /C:/games into C:/games; for another host (a network share) or a bad escape it is left out. /files, filed and file are unaffected.
  • Test: file_uris_are_refused (synthetic paths only). On Linux cargo test -p victory-core passes 50 tests, also with HOME/XDG_* unset (TMPDIR and the build folder outside the repository). clippy -D warnings is clean for the host and for x86_64-pc-windows-msvc. fmt is clean and cargo xtask policy is ok.

Relative path settings (config.rs)

  • A relative variable such as VICTORY_DATA_DIR=data (or a relative value in ./victory.toml, whose folder is the empty path) was kept relative. The data-inside-cache and game-folder checks compare paths as written, so VICTORY_CACHE_DIR=/home/me/victory with VICTORY_DATA_DIR=data, started from /home/me/victory, put saves inside the cache unnoticed, and victory config showed data rather than the folder used.
  • Config::load now joins any path still relative after resolution to the working directory before the checks, so they see the real folder and victory config shows it. Paths in a VICTORY_CONFIG file elsewhere are still relative to that file.
  • Test: relative_paths_are_joined_to_the_working_directory (synthetic paths only). On Linux cargo test -p victory-core passes 54 tests, also with HOME/XDG_* unset (TMPDIR and the build folder outside the repository). clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

Cache or data folder at the drive root or the home folder (config.rs)

  • VICTORY_CACHE_DIR=$HOME/$APP with APP unset is ~/, and VICTORY_DATA_DIR=$XDG_DATA_HOME/ with XDG_DATA_HOME unset is /. Both were accepted. The cache may be deleted at any time, so clearing a cache of ~ would delete the home folder, and a data folder of ~ puts saves, settings and crashes.log loose in it.
  • A cache or data folder that is the root of a drive, the home folder, or a folder holding it (/home) now fails at load: the cache folder /home/me (from VICTORY_CACHE_DIR) is your home folder; set VICTORY_CACHE_DIR or [paths].cache_dir to a folder used only by Victory, or leave it unset for the default. It is compared lexically like the other folder checks (~/games/.. counts as home), and folders inside home, siblings of it and /home/me2 are unaffected. The defaults never hit it.
  • Test: cache_or_data_at_the_root_or_home_is_refused (synthetic paths only). data_inside_the_cache_names_both_origins used the home folder as its cache, so it now uses another folder. On Linux cargo test -p victory-core passes 55 tests, also with HOME/XDG_* unset (TMPDIR and the build folder outside the repository). clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

A misspelled path variable (config.rs)

  • VICTORY_GAMEDIR=/games/gta, VICTORY_DATA_PATH=… or a lowercase victory_cache_dir was ignored without a word, and the default was used. Saves then went to ~/.local/share/victory, not the folder the user named, and the game folder was reported as not set.
  • Config::load now checks the names in the environment first. A near miss of VICTORY_GAME_DIR/VICTORY_CACHE_DIR/VICTORY_DATA_DIR/VICTORY_TEST_TITLES/VICTORY_CONFIG fails while the real variable is unset or empty: VICTORY_GAMEDIR is set, but Victory reads VICTORY_GAME_DIR, which is not set; rename VICTORY_GAMEDIR to VICTORY_GAME_DIR. A near miss is one of these: the same letters ignoring case, _ and -; a _DIR variable with the suffix dropped or spelt _PATH/_DIRECTORY/_FOLDER; VICTORY_TEST_TITLE or VICTORY_TITLES; or VICTORY_CONFIG_FILE/_PATH. When the real variable is set, the near miss is left alone. Other VICTORY_* variables (VICTORY_LOG, VICTORY_WARP, …) are unaffected.
  • Test: misspelled_variables_are_refused (synthetic names, no process environment). On Linux cargo test -p victory-core passes 58 tests, also with HOME/XDG_* unset (TMPDIR and the build folder outside the repository). clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

VICTORY_TEST_TITLES joined with the wrong separator (config.rs, victory.example.toml)

  • VICTORY_TEST_TITLES=/t/one;/t/two (a list copied from a Windows .bat) or /t/one,/t/two on Linux, or C:\t\one:D:\t\two on Windows, was not split, so it became one title named one;/t/two under /t. Both titles were dropped without a word, and the run reported only that the path does not exist.
  • Each entry is now checked after splitting. If a ; or , (: or , on Windows) is followed, after any spaces, by the start of another absolute path (/ or ~, or a drive path on Windows), loading fails: VICTORY_TEST_TITLES holds "/t/one;/t/two", which looks like several titles joined with ';'; on this host they are separated by ':'. A folder whose name just contains a ; or , (/games/a,b) is not affected, and neither is test_titles in the file, which is a TOML array.
  • Test: test_titles_joined_with_the_wrong_separator_are_refused covers both hosts through an on_windows parameter, using synthetic paths only. On Linux, cargo test -p victory-core passes 59 tests, also with HOME/XDG_* unset (TMPDIR and the build folder outside the repository). clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

A Windows backslash path off Windows (config.rs)

  • VICTORY_GAME_DIR=\Games\gta, ..\games\gta or [paths].data_dir = '~\saves', copied from a Windows guide or a .bat file, has no drive letter, so the drive-path check let it through. Off Windows the backslashes are ordinary characters, so it became one relative folder named \Games\gta under the config file's folder or the working directory (often the repository), and ~\saves was reported as another user's home.
  • Every path setting (the four variables, VICTORY_CONFIG, the [paths] values) that starts with a single \, or with .\, ..\ or ~\, now fails off Windows: VICTORY_GAME_DIR is \Games\gta, which uses Windows backslashes, but this host is not Windows; write it with /, perhaps /Games/gta. A backslash later in a name (games\gta, /games/a\b), UNC paths (already refused as network paths) and anything on Windows are unaffected.
  • Test: windows_backslash_paths_are_refused_off_windows (synthetic paths only); windows_network_paths_are_refused_off_windows no longer lists \games as allowed. On Linux cargo test -p victory-core passes 60 tests, also with HOME/XDG_* unset (TMPDIR and the build folder outside the repository). clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

Keep the test titles apart from the cache and data folders (config.rs)

  • The game folder was already kept apart from the cache and data folders, but the VICTORY_TEST_TITLES / [paths].test_titles entries, which are also dumps Victory only reads, were not. With one parent folder for everything (VICTORY_CACHE_DIR=~/xbox, VICTORY_TEST_TITLES=~/xbox/title-a), clearing the cache would delete a title, and a cache or data folder inside a title would mix derived files and saves into that dump.
  • Each title is now checked the same way: the test title /x/title-a (from VICTORY_TEST_TITLES) is inside the cache folder /x (from VICTORY_CACHE_DIR), which may be deleted at any time; ..., and the data folder ... is inside the test title .... Compared lexically like the other folder checks (./.. folded, case folded on Windows/macOS); siblings such as /x-cache are fine.
  • Test: test_titles_are_kept_apart_from_cache_and_data (synthetic paths only). On Linux cargo test -p victory-core passes 61 tests, also with HOME/XDG_* unset (TMPDIR and the build folder outside the repository). clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

A test title that names a file (config.rs)

  • The game folder was already refused when it names a file (VICTORY_GAME_DIR=~/games/gta/default.xex), but VICTORY_TEST_TITLES / [paths].test_titles entries, which are dumps too, were not: picking the executable instead of its folder was accepted and only failed later, per file, with "Not a directory".
  • Each title is now checked the same way: the test title /x/title-a/default.xex (from VICTORY_TEST_TITLES) is a file, not a folder; set VICTORY_TEST_TITLES or [paths].test_titles to the folder holding the dump, perhaps /x/title-a. A title that does not exist yet is still accepted.
  • Test: a_folder_setting_naming_a_file_is_refused now covers a title from the variable and from the file (empty scratch file under TMPDIR, removed afterwards). On Linux cargo test -p victory-core passes 61 tests, also with HOME/XDG_* unset and with --features diagnostics. clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

A test title listed twice, or the game folder in the list (config.rs)

  • victory census, translate and shader take the game folder followed by the test titles when given no paths, so a title listed twice (VICTORY_TEST_TITLES=/x/a:/x/b:/x/a, or the same folder written as /x/a and /x/b/../a, or C:\Xbox\A and c:\xbox\a on Windows) or the game folder pasted into test_titles was scanned and translated twice, doubling the time and the report.
  • Now refused: the test title /x/a (from VICTORY_TEST_TITLES) is listed twice (also as /x/a); remove one from VICTORY_TEST_TITLES or [paths].test_titles, and the test title /x/a (from config file) is the game folder /x/a (from VICTORY_GAME_DIR); .... Compared lexically like the other folder checks (case folded on Windows/macOS only). A title nested inside another title or inside the game folder is a different folder and is still accepted.
  • Test: test_titles_must_be_distinct_and_not_the_game_folder (synthetic paths only); a_folder_setting_naming_a_file_is_refused no longer lists the game folder as a title. On Linux cargo test -p victory-core passes 62 tests, also with HOME/XDG_* unset (TMPDIR and the build folder outside the repository). clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

A data folder inside the user's cache (config.rs)

  • The data folder was only kept out of Victory's own cache folder, so VICTORY_DATA_DIR=~/.cache/victory-saves, or XDG_DATA_HOME set under XDG_CACHE_HOME (~/.cache/share, which moves the default data folder there while the cache folder is a sibling), was accepted, and clearing ~/.cache (the problem this PR started from) deleted the saves.
  • Now refused: the data folder /home/me/.cache/saves (from VICTORY_DATA_DIR) is inside your cache folder /home/me/.cache (~/.cache), which may be deleted at any time; set VICTORY_DATA_DIR or [paths].data_dir to a folder outside it, such as one under ~/.local/share, with a variant naming XDG_DATA_HOME when both are defaults. The cache base is $XDG_CACHE_HOME (absolute), else $HOME/.cache; the check is skipped when that base is the home folder or holds it. Compared lexically like the other folder checks.
  • Test: data_inside_the_user_cache_is_refused (synthetic paths only). On Linux cargo test -p victory-core passes 63 tests, also with HOME/XDG_* unset. clippy -D warnings is clean for the host and x86_64-pc-windows-msvc, fmt is clean and cargo xtask policy is ok.

A trailing slash or /. no longer hides a file or a dead link in a folder setting
lstat("link/") follows the link, and Path::ancestors goes from default.xex/ straight to its parent. So VICTORY_GAME_DIR=…/default.xex/, or a cache, data or test-title setting naming a dangling or looping link with a trailing / or /., was accepted as a folder still to create. It then failed later with "Not a directory" or "File exists". The folder check now walks the path with trailing separators and interior . dropped (.. is kept), and the setting is still stored as written. Test: a_trailing_slash_or_dot_does_not_hide_a_file_or_a_link_that_leads_nowhere (Unix, scratch folder under the temp dir). I confirmed it fails without the fix.

Supersedes #243, #277 and #266.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:issue:6572687058 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/241). Originally posted by [SkippySteve](https://github.com/SkippySteve) on 2026-11-24T01:43:22Z. --- Host-side UX fixes in `victory-core` for where Victory keeps files and how it reports its settings. This PR now also includes #243, which changed the same function, #277, which makes `victory config` show the data folder, and #266, which warns when `VICTORY_LOG`/`RUST_LOG` does not parse. #243, #277 and #266 are closed in its favour. **Problem** 1. `Config::data_dir` is documented as "never inside the cache, which may be deleted at any time". Without `LOCALAPPDATA` (a native non-Windows host, e.g. the Linux crates/tools), `default_dir` used the *cache* base for both, so the default data dir was `$XDG_CACHE_HOME/victory/data` (`~/.cache/victory/data`). Clearing `~/.cache`, as desktop cleaners and users routinely do, would delete what titles saved. 2. A base variable that was **set but empty** (`XDG_CACHE_HOME=`, common in shells and wrapper scripts) or **relative** still won. The base then became relative to the working directory, usually the repo checkout, and `cache_subdir` failed with the asset-policy error instead of using `~/.cache`. **Change** (`crates/victory-core/src/config.rs` only) - With an absolute `LOCALAPPDATA`: unchanged (`…\victory\cache`, `…\victory\data`). - Without it: cache → `$XDG_CACHE_HOME/victory` (else `~/.cache/victory`), data → `$XDG_DATA_HOME/victory` (else `~/.local/share/victory`). - Empty or relative `LOCALAPPDATA` / `XDG_CACHE_HOME` / `XDG_DATA_HOME` / `HOME` values are skipped and the next candidate is tried, as the XDG spec asks. If none is usable you get the existing "set VICTORY_CACHE_DIR and VICTORY_DATA_DIR" error. - `default_dir` now reads through the same `env` closure that `Config::resolve` already takes, so the defaults can be unit-tested. `load()` still passes the real environment. - `VICTORY_CACHE_DIR` / `VICTORY_DATA_DIR` and `victory.toml` still take precedence. **Tests** (hermetic: none read the host's real `HOME`/`XDG_*`/`LOCALAPPDATA`, and they use `C:\…` paths on Windows so they stay absolute) - `local_app_data_holds_cache_and_data`, `data_is_not_under_the_xdg_cache`, `empty_or_relative_values_are_ignored`, `default_dir_prefers_localappdata_then_xdg_then_home`, `no_user_directory_is_an_error`. - The two existing `resolve` tests now get `HOME` through the closure. Before, they failed under `env -u HOME`. **Validated** on Linux (config part): `cargo test -p victory-core` passes, and also passes with `HOME`, `XDG_CACHE_HOME` and `XDG_DATA_HOME` unset. `cargo clippy -p victory-core --all-targets -- -D warnings` is clean for the host and for `x86_64-pc-windows-msvc`. `config.rs` passes rustfmt, and `cargo xtask policy` is ok. I haven't run it on Windows. No game data was used. **`victory config` shows the data folder (was #277, `apps/victory/src/main.rs`)** The data folder (saves, settings, crashes.log) is resolved by `Config` like the cache folder, but `victory config` neither printed it nor ran the outside-the-repository check on it, so a `VICTORY_DATA_DIR` or `[paths].data_dir` pointing into the source tree went unreported. It now prints `data_dir` and checks it with `ensure_outside_repo` alongside `cache_dir`. Two lines; `apps/victory` does not yet build on Linux (#235), so this part is checked by review only. **Warn when `VICTORY_LOG` / `RUST_LOG` does not parse (was #266, `crates/victory-core/src/logging.rs`)** A filter that tracing-subscriber rejects, for example `VICTORY_LOG=victory_loader=loud`, was dropped silently and the binary logged at its default level, so a typo looked like the target had nothing to log. `logging::init` now prints one line on stderr naming the variable, its value and the parse error, then falls back to the default level as before: ``` victory: ignoring VICTORY_LOG="victory_loader=loud" (...); logging at "info" ``` Picking the filter moves into `choose_filter`, so it can be tested without changing the process environment. Precedence is unchanged (`VICTORY_LOG`, then `RUST_LOG`, then the default). Five new tests: unset, `VICTORY_LOG` over `RUST_LOG`, the `RUST_LOG` fallback, and a bad value in each variable. **Config file paths and empty variables (`config.rs`, `victory.example.toml`)** - Relative paths in the config file (`game_dir`, `cache_dir`, `data_dir`, `test_titles`) are now relative to the file. Before, with `VICTORY_CONFIG` pointing at another folder, `cache_dir = "cache"` landed under the working directory, which is often the repository, so the asset policy refused it. `./victory.toml` behaves as before. - An empty `VICTORY_CONFIG` counts as unset instead of failing with "points at , which does not exist". An empty `VICTORY_TEST_TITLES` no longer replaces the file's list with nothing. The other `VICTORY_*` variables already ignored empty values. - `victory.example.toml` says this and gives the right `VICTORY_TEST_TITLES` separator (`;` on Windows, `:` elsewhere). - Tests: `relative_file_paths_are_relative_to_the_file`, `the_default_config_file_keeps_paths_as_written`, `empty_test_titles_variable_falls_back_to_the_file`. **Logging: empty filters and the `diagnostics` cap (`logging.rs`)** - An empty (or blank) `VICTORY_LOG`/`RUST_LOG` counts as unset. Before, `VICTORY_LOG=` made an empty filter that hid everything but errors and also hid `RUST_LOG`. - A filter asking for debug or trace on a build without the `diagnostics` feature was capped at info without saying so. It now prints one line on stderr: `victory: the log filter asks for trace output, but this build logs info and above; rebuild with --features diagnostics for debug and trace`. - Tests: `empty_values_count_as_unset`, `a_filter_above_the_cap_is_reported`. **`~` in configured paths (`config.rs`, `victory.example.toml`)** - Neither TOML nor a quoted shell value expands `~`. So `game_dir = "~/Games/gta"` in `victory.toml` named a folder literally called `~` next to the file, and `VICTORY_GAME_DIR="~/Games/gta"` named one under the working directory. That's an easy mistake on Linux/Proton setups. - A leading `~` component in `[paths]` values and in `VICTORY_GAME_DIR`/`VICTORY_CACHE_DIR`/`VICTORY_DATA_DIR`/`VICTORY_TEST_TITLES` now means the home directory: `HOME`, else `USERPROFILE`, if it is absolute. `~user/…` and a `~` that is not the first component are left as written. A leading `~` with no usable home directory is refused (see below). - Tests: `a_leading_tilde_is_the_home_directory`, `tilde_in_the_file_is_home_not_next_to_the_file`, `tilde_in_variables_is_home`, `home_dir_falls_back_to_userprofile_and_skips_relative`. **`VICTORY_CONFIG` as a folder, non-UTF-8 log variables, Linux defaults (`config.rs`, `logging.rs`, `victory.example.toml`)** - `VICTORY_CONFIG` pointing at the folder that holds `victory.toml` was reported as "which does not exist". It now says `… which is a folder, not a config file; did you mean <folder>/victory.toml?` (the hint only when that file is there). The file lookup moves into `config_file` so it can be tested. - A `VICTORY_LOG`/`RUST_LOG` value that is not valid UTF-8 was dropped silently by `std::env::var(..).ok()`. It is now reported on stderr (`victory: ignoring RUST_LOG="w\xFF": it is not valid UTF-8`) and treated as unset. - `victory.example.toml` gave only the `%LOCALAPPDATA%` defaults. It now also gives the Linux ones (`$XDG_CACHE_HOME/victory` or `~/.cache/victory`, `$XDG_DATA_HOME/victory` or `~/.local/share/victory`) and says `VICTORY_CONFIG` names the file, not its folder. - Tests: `victory_config_must_name_a_file` (uses a folder under the system temp dir), `a_non_utf8_variable_is_reported_and_unset`. **The data folder must not be inside the cache (`config.rs`, `victory.example.toml`)** - `data_dir` is documented as never inside the cache, but explicit settings could still put it there, e.g. `VICTORY_CACHE_DIR=~/victory` with `VICTORY_DATA_DIR=~/victory/data`, or `VICTORY_CACHE_DIR=~` with the default `~/.local/share/victory`. Clearing the cache would then delete saves. - `Config::resolve` now fails with `the data folder … is inside the cache folder …, which may be deleted at any time; set VICTORY_DATA_DIR or [paths].data_dir to a folder outside it`. It compares the paths as written, so nothing has to exist yet. A sibling like `/v-data` next to `/v` is allowed, and so is the cache inside the data folder. - Test: `data_inside_the_cache_is_refused`. `tilde_in_variables_is_home` now sets the cache to `~/cache`, because a cache of `~` would hold the default data folder. **`~` in `VICTORY_CONFIG` (`config.rs`, `victory.example.toml`)** - The other path variables expand a leading `~`, but `VICTORY_CONFIG` did not, so a quoted `VICTORY_CONFIG="~/victory.toml"` failed with `VICTORY_CONFIG points at ~/victory.toml, which does not exist`. It now goes through the same `expand_home` (via a small `explicit_config` helper, so it can be tested without touching the real environment); empty still counts as unset. `load()` resolves the home directory once and reuses it. - Test: `victory_config_expands_tilde_and_ignores_empty`. This also covers what open #363 asks for (empty `VICTORY_CONFIG`), which this PR already did. **Validated (whole PR)** on Linux: `cargo test -p victory-core` passes (33 tests), also with `HOME`/`XDG_CACHE_HOME`/`XDG_DATA_HOME` unset and with `--features diagnostics`. `cargo clippy -p victory-core --all-targets -- -D warnings` is clean with and without `--features diagnostics`, and for `x86_64-pc-windows-msvc`. `cargo fmt -p victory-core --check` is clean and `cargo xtask policy` is ok. **Say where each setting came from (`config.rs`, `apps/victory/src/main.rs`)** - With a variable, the config file and a default for every path, it was not obvious which one won, and the data-inside-cache error did not say which setting to change. - `Config` now has `origins` (`Origin::Env("VICTORY_CACHE_DIR")`, `Origin::File` or `Origin::Default`) for `game_dir`, `cache_dir`, `data_dir` and `test_titles`. Empty variables still count as unset and are never the origin. - `victory config` prints it next to each value, e.g. `cache_dir : /home/me/.cache/victory [default]`. - The data-inside-cache error now reads `the data folder … (from default) is inside the cache folder … (from config file) …`. - Tests: `origins_name_the_setting_that_won`, `data_inside_the_cache_names_both_origins`. With them, `cargo test -p victory-core` passes 33 tests (also with `HOME`/`XDG_*` unset and with `--features diagnostics`). clippy `-D warnings` is clean for the host, with `diagnostics`, and for `x86_64-pc-windows-msvc`. fmt is clean and `cargo xtask policy` is ok. As before, the `main.rs` lines are checked by review only (#235). **Refuse a Windows drive path on a non-Windows host (`config.rs`, `victory.example.toml`)** - `victory.example.toml` ships `game_dir = 'D:\victory-data\game'`. On Linux that is not absolute, so a copy used unedited was anchored under the config file's folder (usually the repository) and only showed up later as a policy violation or a folder that does not exist. - `[paths]` values and `VICTORY_GAME_DIR`/`VICTORY_CACHE_DIR`/`VICTORY_DATA_DIR`/`VICTORY_TEST_TITLES` are now checked before use. On a non-Windows host, `X:`, `X:\…` or `X:/…` fails with `[paths].game_dir is D:\victory-data\game, a Windows path, but this host is not Windows; set it to a path on this machine` (in `<file>`). `VICTORY_TEST_TITLES` is checked before it is split, because `:` would cut `D:\a` in two. Windows is unchanged. The example file now says its paths are Windows examples. - Test: `windows_drive_paths_are_refused_off_windows`. On Linux `cargo test -p victory-core` passes 34 tests, also with `HOME`/`XDG_*` unset and with `--features diagnostics`. clippy `-D warnings` is clean for the host, with `diagnostics`, and for `x86_64-pc-windows-msvc`. fmt is clean and `cargo xtask policy` is ok. **A `[paths]` key at the top level of the config file (`config.rs`)** - `game_dir = '/games/gta'` with no `[paths]` header (an easy first `victory.toml`), or a key written above the header, failed with only `unknown field \`game_dir\`, expected \`paths\``. It now says `game_dir must be under the [paths] table: put a \`[paths]\` line above it (see victory.example.toml)`, naming every misplaced key. Other parse errors (`[path]`, `gamedir = ...`) keep toml's own message. - Test: `top_level_path_keys_say_where_they_belong`; `example_config_parses` goes through the same parser. On Linux `cargo test -p victory-core` passes 35 tests, also with `HOME`/`XDG_*` unset and with `--features diagnostics`. clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **`.` and `..` in the data/cache check (`config.rs`)** - The data-inside-cache check compared the paths as written, so `VICTORY_DATA_DIR=~/.cache/victory/../data` (a sibling of the cache) was refused, and a cache of `~/victory/tmp/..` was not seen to hold `~/victory/data`. Both paths now have `.` and `..` folded lexically before the comparison (`lexical`). It still does not touch the disk or follow symlinks, and the error still shows the paths as written. - Tests: `data_inside_the_cache_ignores_dot_dot`, `lexical_folds_dot_and_dot_dot`. On Linux `cargo test -p victory-core` passes 37 tests, also with `HOME`/`XDG_*` unset and with `--features diagnostics` (run with `TMPDIR` outside the repository, which `policy::tests::accepts_unrelated_directories` needs). clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **Keep the game folder apart from the cache and data folders (`config.rs`, `victory.example.toml`)** - The game folder is the user's own dump and is only read. Nothing stopped it from being inside the cache (`VICTORY_CACHE_DIR=~/gta` with `VICTORY_GAME_DIR=~/gta/game`), where clearing the cache would delete the dump, or the cache/data folder from being inside it (a `victory.toml` kept in the dump with `cache_dir = "cache"`), which writes derived files and saves into the dump. - `Config::resolve` now refuses both when a game folder is set, e.g. `the cache folder … (from config file) is inside the game folder … (from config file), which holds your dump and is only read; set VICTORY_CACHE_DIR or [paths].cache_dir to a folder outside it`. Compared like the data-inside-cache check: lexically, `.`/`..` folded, no disk access. Siblings (`/v` and `/v-cache`) are fine. The example file says so. - Tests: `game_folder_is_kept_apart_from_cache_and_data`, `a_config_file_inside_the_dump_cannot_put_the_cache_there` (synthetic paths only). On Linux `cargo test -p victory-core` passes 39 tests, also with `HOME`/`XDG_*` unset and with `--features diagnostics` (`TMPDIR` outside the repository). clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **Control characters in a path setting (`config.rs`)** - A variable read from a `.env` file with Windows line endings (`set -a; . ./victory.env`, a container env file, a Proton/Wine wrapper script) ends in an invisible `\r`. `VICTORY_GAME_DIR=/games/gta\r` was then reported later only as "does not exist", which looks right on screen. - Every path setting (`VICTORY_GAME_DIR`/`VICTORY_CACHE_DIR`/`VICTORY_DATA_DIR`/`VICTORY_TEST_TITLES`, `VICTORY_CONFIG` and the `[paths]` values) is now checked before use. One holding a control character fails with `VICTORY_GAME_DIR is "/games/gta\r", which contains the control character '\r' (a Windows line ending: was it read from a file saved with CRLF line endings?); remove it`. The value is quoted so the character shows. Spaces and non-ASCII names are unaffected. - Test: `control_characters_in_paths_are_refused` (synthetic paths only). On Linux `cargo test -p victory-core` passes 43 tests, also with `HOME`/`XDG_*` unset and with `--features diagnostics` (`TMPDIR` outside the repository). clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **Quoted path settings (`config.rs`)** - Only a shell strips quotes. `docker run --env-file`, systemd `EnvironmentFile=`, IDE run configurations and Windows `set VICTORY_GAME_DIR="D:\games"` keep them, so `VICTORY_GAME_DIR="/games/gta"` arrived as `"/games/gta"` with the quotes. That is not absolute, so it was taken as a folder named `"` under the working directory (often the repository) and reported later only as "does not exist" or "inside the repository". - Every path setting (the four variables, `VICTORY_CONFIG`, the `[paths]` values) that starts and ends with the same `"` or `'` now fails with `VICTORY_GAME_DIR is "/games/gta", quotes included; the quotes are not removed when the value comes from an env file or a launcher rather than a shell, so remove them`. A quote elsewhere in a name (`/games/Rockstar's`) is unaffected. - Test: `quoted_paths_are_refused` (synthetic paths only). On Linux `cargo test -p victory-core` passes 44 tests, also with `HOME`/`XDG_*` unset and with `--features diagnostics` (`TMPDIR` outside the repository). clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **Whitespace around a path setting (`config.rs`)** - An env file or launcher keeps the spaces a shell would split off, so `VICTORY_GAME_DIR= /games/gta` arrived with a leading space. That is not absolute, so it was taken as a folder named ` ` under the config file's folder or the working directory (often the repository). A trailing space (or a no-break space pasted from a web page) was reported later only as "does not exist", which looks right on screen. - Every path setting that starts or ends with whitespace now fails with `VICTORY_GAME_DIR is " /games/gta", which starts with whitespace; remove it`. `VICTORY_TEST_TITLES` is also checked entry by entry, so `/a: /b` is caught. Spaces inside a name (`/Program Files/x`) are unaffected. - Test: `surrounding_whitespace_in_paths_is_refused` (synthetic paths only). On Linux `cargo test -p victory-core` passes 45 tests, clippy `-D warnings` is clean for victory-core and fmt is clean. **Unexpanded variables in a path setting (`config.rs`, `victory.example.toml`)** - Only a shell expands `$HOME` (and only `cmd` expands `%LOCALAPPDATA%`). TOML, `docker run --env-file`, systemd `EnvironmentFile=` and launcher or IDE run configurations keep them as written. So `game_dir = "$HOME/Games/gta"`, or `data_dir = '%LOCALAPPDATA%\victory\data'` copied from the defaults the example file lists, was relative. It was taken as a folder named `$HOME` under the config file's folder or the working directory (often the repository). - Every path setting (the four variables, `VICTORY_CONFIG`, the `[paths]` values) that names a variable now fails with `VICTORY_GAME_DIR is $HOME/Games/gta, which names the variable $HOME; variables are not expanded in the config file or when the value comes from an env file or a launcher rather than a shell, so write the path out in full (a leading ~ is the home directory)`. It recognises a whole `$NAME` component, `${NAME}` and `%NAME%` (including `%ProgramFiles(x86)%`). Real names such as `$Recycle.Bin`, `share$`, `$HOME.old` and `100%` are unaffected. The example file now says variables are not expanded. - Test: `unexpanded_variables_in_paths_are_refused` (synthetic paths only). On Linux `cargo test -p victory-core` passes 46 tests, also with `HOME`/`XDG_*` unset and with `--features diagnostics` (`TMPDIR` outside the repository). clippy `-D warnings` is clean for the host, with `diagnostics`, and for `x86_64-pc-windows-msvc`. fmt is clean and `cargo xtask policy` is ok. **Empty values in the config file (`config.rs`, `victory.example.toml`)** - An empty variable already counted as unset, but an empty value in the file did not. `game_dir = ''` (a blank a template leaves to fill in) was anchored at the config file's folder, often the repository, and with `./victory.toml` it became the empty path, which is the working directory. `test_titles = ['']` did the same for one entry. - Empty `game_dir`, `cache_dir`, `data_dir` and `test_titles` entries in `[paths]` now count as unset, so the defaults apply and `victory config` reports `[default]`, not `[config file]`. The example file says so. - Test: `empty_file_values_count_as_unset` (synthetic paths only). On Linux `cargo test -p victory-core` passes 47 tests, also with `HOME`/`XDG_*` unset and with `--features diagnostics` (`TMPDIR` and the build folder outside the repository). clippy `-D warnings` is clean for the host and for `x86_64-pc-windows-msvc`. fmt is clean and `cargo xtask policy` is ok. **A folder setting that names a file (`config.rs`)** - `VICTORY_GAME_DIR=~/games/gta/default.xex` (the executable picked in a file dialog or pasted from a launcher's target, rather than its folder) was accepted and only failed later, per file, with "Not a directory". A cache or data folder that names an existing file failed on first use with "File exists", naming neither the setting nor the fix. - Each of the game, cache and data folders that names an existing file now fails at load with `the game folder /games/gta/default.xex (from VICTORY_GAME_DIR) is a file, not a folder; set VICTORY_GAME_DIR or [paths].game_dir to the folder holding the dump, perhaps /games/gta`. A path that does not exist yet is still fine. - Test: `a_folder_setting_naming_a_file_is_refused` (an empty scratch file under the system temp folder, removed afterwards; no game data). On Linux `cargo test -p victory-core` passes 48 tests, also with `HOME`/`XDG_*` unset and with `--features diagnostics` (`TMPDIR` and the build folder outside the repository). clippy `-D warnings` is clean for the host and for `x86_64-pc-windows-msvc`. fmt is clean and `cargo xtask policy` is ok. **A leading `~` with no home directory (`config.rs`)** - With `HOME` and `USERPROFILE` unset or relative (`env -i`, a bare systemd unit, some containers), a leading `~` was kept as written. `VICTORY_CACHE_DIR=~/cache` then named a folder literally called `~` under the working directory (often the repository), and `[paths].game_dir = '~/gta'` one next to the config file. Such a folder is created on first use and easy to delete by mistake with `rm -rf ~`. - A leading `~` in any path setting (the four variables, `VICTORY_CONFIG`, the `[paths]` values) now fails at load when there is no home directory: `VICTORY_CACHE_DIR is ~/cache, but there is no home directory to put in place of `~` (HOME is unset or not absolute); set HOME or write the full path`. `~user/…`, a non-leading `~`, and paths without `~` are unaffected. - Test: `a_leading_tilde_without_a_home_is_refused` (synthetic paths only); `a_leading_tilde_is_the_home_directory` and `victory_config_expands_tilde_and_ignores_empty` updated. On Linux `cargo test -p victory-core` passes 49 tests, also with `HOME`/`XDG_*` unset (`TMPDIR` and the build folder outside the repository). clippy `-D warnings` is clean for the host and for `x86_64-pc-windows-msvc`. fmt is clean and `cargo xtask policy` is ok. **A `file://` URI instead of a path (`config.rs`)** - Copying a folder in a Linux file manager, or taking it from a `.desktop` file or a launcher's config, gives `file:///home/me/Games/My%20Games/gta`. Nothing decoded it: the value is relative, so it was taken as a folder named `file:` under the config file's folder or the working directory (often the repository), with `%20` kept as three characters. - Every path setting (the four variables, `VICTORY_CONFIG`, the `[paths]` values) that starts with `file:` (any case) now fails at load: `VICTORY_GAME_DIR is file:///games/My%20Games/gta, a file: URI rather than a path; write the path instead, perhaps /games/My Games/gta`. The suggestion decodes `%XX`, accepts an empty or `localhost` host and turns `/C:/games` into `C:/games`; for another host (a network share) or a bad escape it is left out. `/files`, `filed` and `file` are unaffected. - Test: `file_uris_are_refused` (synthetic paths only). On Linux `cargo test -p victory-core` passes 50 tests, also with `HOME`/`XDG_*` unset (`TMPDIR` and the build folder outside the repository). clippy `-D warnings` is clean for the host and for `x86_64-pc-windows-msvc`. fmt is clean and `cargo xtask policy` is ok. **Relative path settings (`config.rs`)** - A relative variable such as `VICTORY_DATA_DIR=data` (or a relative value in `./victory.toml`, whose folder is the empty path) was kept relative. The data-inside-cache and game-folder checks compare paths as written, so `VICTORY_CACHE_DIR=/home/me/victory` with `VICTORY_DATA_DIR=data`, started from `/home/me/victory`, put saves inside the cache unnoticed, and `victory config` showed `data` rather than the folder used. - `Config::load` now joins any path still relative after resolution to the working directory before the checks, so they see the real folder and `victory config` shows it. Paths in a `VICTORY_CONFIG` file elsewhere are still relative to that file. - Test: `relative_paths_are_joined_to_the_working_directory` (synthetic paths only). On Linux `cargo test -p victory-core` passes 54 tests, also with `HOME`/`XDG_*` unset (`TMPDIR` and the build folder outside the repository). clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **Cache or data folder at the drive root or the home folder (`config.rs`)** - `VICTORY_CACHE_DIR=$HOME/$APP` with `APP` unset is `~/`, and `VICTORY_DATA_DIR=$XDG_DATA_HOME/` with `XDG_DATA_HOME` unset is `/`. Both were accepted. The cache may be deleted at any time, so clearing a cache of `~` would delete the home folder, and a data folder of `~` puts saves, settings and crashes.log loose in it. - A cache or data folder that is the root of a drive, the home folder, or a folder holding it (`/home`) now fails at load: `the cache folder /home/me (from VICTORY_CACHE_DIR) is your home folder; set VICTORY_CACHE_DIR or [paths].cache_dir to a folder used only by Victory, or leave it unset for the default`. It is compared lexically like the other folder checks (`~/games/..` counts as home), and folders inside home, siblings of it and `/home/me2` are unaffected. The defaults never hit it. - Test: `cache_or_data_at_the_root_or_home_is_refused` (synthetic paths only). `data_inside_the_cache_names_both_origins` used the home folder as its cache, so it now uses another folder. On Linux `cargo test -p victory-core` passes 55 tests, also with `HOME`/`XDG_*` unset (`TMPDIR` and the build folder outside the repository). clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **A misspelled path variable (`config.rs`)** - `VICTORY_GAMEDIR=/games/gta`, `VICTORY_DATA_PATH=…` or a lowercase `victory_cache_dir` was ignored without a word, and the default was used. Saves then went to `~/.local/share/victory`, not the folder the user named, and the game folder was reported as not set. - `Config::load` now checks the names in the environment first. A near miss of `VICTORY_GAME_DIR`/`VICTORY_CACHE_DIR`/`VICTORY_DATA_DIR`/`VICTORY_TEST_TITLES`/`VICTORY_CONFIG` fails while the real variable is unset or empty: `VICTORY_GAMEDIR is set, but Victory reads VICTORY_GAME_DIR, which is not set; rename VICTORY_GAMEDIR to VICTORY_GAME_DIR`. A near miss is one of these: the same letters ignoring case, `_` and `-`; a `_DIR` variable with the suffix dropped or spelt `_PATH`/`_DIRECTORY`/`_FOLDER`; `VICTORY_TEST_TITLE` or `VICTORY_TITLES`; or `VICTORY_CONFIG_FILE`/`_PATH`. When the real variable is set, the near miss is left alone. Other `VICTORY_*` variables (`VICTORY_LOG`, `VICTORY_WARP`, …) are unaffected. - Test: `misspelled_variables_are_refused` (synthetic names, no process environment). On Linux `cargo test -p victory-core` passes 58 tests, also with `HOME`/`XDG_*` unset (`TMPDIR` and the build folder outside the repository). clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **`VICTORY_TEST_TITLES` joined with the wrong separator (`config.rs`, `victory.example.toml`)** - `VICTORY_TEST_TITLES=/t/one;/t/two` (a list copied from a Windows `.bat`) or `/t/one,/t/two` on Linux, or `C:\t\one:D:\t\two` on Windows, was not split, so it became one title named `one;/t/two` under `/t`. Both titles were dropped without a word, and the run reported only that the path does not exist. - Each entry is now checked after splitting. If a `;` or `,` (`:` or `,` on Windows) is followed, after any spaces, by the start of another absolute path (`/` or `~`, or a drive path on Windows), loading fails: `VICTORY_TEST_TITLES holds "/t/one;/t/two", which looks like several titles joined with ';'; on this host they are separated by ':'`. A folder whose name just contains a `;` or `,` (`/games/a,b`) is not affected, and neither is `test_titles` in the file, which is a TOML array. - Test: `test_titles_joined_with_the_wrong_separator_are_refused` covers both hosts through an `on_windows` parameter, using synthetic paths only. On Linux, `cargo test -p victory-core` passes 59 tests, also with `HOME`/`XDG_*` unset (`TMPDIR` and the build folder outside the repository). clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **A Windows backslash path off Windows (`config.rs`)** - `VICTORY_GAME_DIR=\Games\gta`, `..\games\gta` or `[paths].data_dir = '~\saves'`, copied from a Windows guide or a `.bat` file, has no drive letter, so the drive-path check let it through. Off Windows the backslashes are ordinary characters, so it became one relative folder named `\Games\gta` under the config file's folder or the working directory (often the repository), and `~\saves` was reported as another user's home. - Every path setting (the four variables, `VICTORY_CONFIG`, the `[paths]` values) that starts with a single `\`, or with `.\`, `..\` or `~\`, now fails off Windows: `VICTORY_GAME_DIR is \Games\gta, which uses Windows backslashes, but this host is not Windows; write it with `/`, perhaps /Games/gta`. A backslash later in a name (`games\gta`, `/games/a\b`), UNC paths (already refused as network paths) and anything on Windows are unaffected. - Test: `windows_backslash_paths_are_refused_off_windows` (synthetic paths only); `windows_network_paths_are_refused_off_windows` no longer lists `\games` as allowed. On Linux `cargo test -p victory-core` passes 60 tests, also with `HOME`/`XDG_*` unset (`TMPDIR` and the build folder outside the repository). clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **Keep the test titles apart from the cache and data folders (`config.rs`)** - The game folder was already kept apart from the cache and data folders, but the `VICTORY_TEST_TITLES` / `[paths].test_titles` entries, which are also dumps Victory only reads, were not. With one parent folder for everything (`VICTORY_CACHE_DIR=~/xbox`, `VICTORY_TEST_TITLES=~/xbox/title-a`), clearing the cache would delete a title, and a cache or data folder inside a title would mix derived files and saves into that dump. - Each title is now checked the same way: `the test title /x/title-a (from VICTORY_TEST_TITLES) is inside the cache folder /x (from VICTORY_CACHE_DIR), which may be deleted at any time; ...`, and `the data folder ... is inside the test title ...`. Compared lexically like the other folder checks (`.`/`..` folded, case folded on Windows/macOS); siblings such as `/x-cache` are fine. - Test: `test_titles_are_kept_apart_from_cache_and_data` (synthetic paths only). On Linux `cargo test -p victory-core` passes 61 tests, also with `HOME`/`XDG_*` unset (`TMPDIR` and the build folder outside the repository). clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **A test title that names a file (`config.rs`)** - The game folder was already refused when it names a file (`VICTORY_GAME_DIR=~/games/gta/default.xex`), but `VICTORY_TEST_TITLES` / `[paths].test_titles` entries, which are dumps too, were not: picking the executable instead of its folder was accepted and only failed later, per file, with "Not a directory". - Each title is now checked the same way: `the test title /x/title-a/default.xex (from VICTORY_TEST_TITLES) is a file, not a folder; set VICTORY_TEST_TITLES or [paths].test_titles to the folder holding the dump, perhaps /x/title-a`. A title that does not exist yet is still accepted. - Test: `a_folder_setting_naming_a_file_is_refused` now covers a title from the variable and from the file (empty scratch file under `TMPDIR`, removed afterwards). On Linux `cargo test -p victory-core` passes 61 tests, also with `HOME`/`XDG_*` unset and with `--features diagnostics`. clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **A test title listed twice, or the game folder in the list (`config.rs`)** - `victory census`, `translate` and `shader` take the game folder followed by the test titles when given no paths, so a title listed twice (`VICTORY_TEST_TITLES=/x/a:/x/b:/x/a`, or the same folder written as `/x/a` and `/x/b/../a`, or `C:\Xbox\A` and `c:\xbox\a` on Windows) or the game folder pasted into `test_titles` was scanned and translated twice, doubling the time and the report. - Now refused: `the test title /x/a (from VICTORY_TEST_TITLES) is listed twice (also as /x/a); remove one from VICTORY_TEST_TITLES or [paths].test_titles`, and `the test title /x/a (from config file) is the game folder /x/a (from VICTORY_GAME_DIR); ...`. Compared lexically like the other folder checks (case folded on Windows/macOS only). A title nested inside another title or inside the game folder is a different folder and is still accepted. - Test: `test_titles_must_be_distinct_and_not_the_game_folder` (synthetic paths only); `a_folder_setting_naming_a_file_is_refused` no longer lists the game folder as a title. On Linux `cargo test -p victory-core` passes 62 tests, also with `HOME`/`XDG_*` unset (`TMPDIR` and the build folder outside the repository). clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **A data folder inside the user's cache (`config.rs`)** - The data folder was only kept out of Victory's own cache folder, so `VICTORY_DATA_DIR=~/.cache/victory-saves`, or `XDG_DATA_HOME` set under `XDG_CACHE_HOME` (`~/.cache/share`, which moves the default data folder there while the cache folder is a sibling), was accepted, and clearing `~/.cache` (the problem this PR started from) deleted the saves. - Now refused: `the data folder /home/me/.cache/saves (from VICTORY_DATA_DIR) is inside your cache folder /home/me/.cache (~/.cache), which may be deleted at any time; set VICTORY_DATA_DIR or [paths].data_dir to a folder outside it, such as one under ~/.local/share`, with a variant naming `XDG_DATA_HOME` when both are defaults. The cache base is `$XDG_CACHE_HOME` (absolute), else `$HOME/.cache`; the check is skipped when that base is the home folder or holds it. Compared lexically like the other folder checks. - Test: `data_inside_the_user_cache_is_refused` (synthetic paths only). On Linux `cargo test -p victory-core` passes 63 tests, also with `HOME`/`XDG_*` unset. clippy `-D warnings` is clean for the host and `x86_64-pc-windows-msvc`, fmt is clean and `cargo xtask policy` is ok. **A trailing slash or `/.` no longer hides a file or a dead link in a folder setting** `lstat("link/")` follows the link, and `Path::ancestors` goes from `default.xex/` straight to its parent. So `VICTORY_GAME_DIR=…/default.xex/`, or a cache, data or test-title setting naming a dangling or looping link with a trailing `/` or `/.`, was accepted as a folder still to create. It then failed later with "Not a directory" or "File exists". The folder check now walks the path with trailing separators and interior `.` dropped (`..` is kept), and the setting is still stored as written. Test: `a_trailing_slash_or_dot_does_not_hide_a_file_or_a_link_that_leads_nowhere` (Unix, scratch folder under the temp dir). I confirmed it fails without the fix. Supersedes #243, #277 and #266. AI-assisted (Claude Code).
catminou4 commented 2026-11-24 06:47:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T06:47:22Z.

Review: APPROVED


Verified locally on macOS 26 arm64, rustc 1.98.1 (aarch64-apple-darwin) at head 9ad8b9d:

  • cargo test -p victory-core --locked: 65 passed, 0 failed (main: 8 — the new config/logging path tests all run green on macOS).

The app-crate part (main.rs, XDG dirs) can't be exercised on macOS because main's app crate doesn't compile here (known host_resource cfg issue, fixed by #235/#523), but the core logic — where the behavior lives — is fully tested. Approving.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034834697 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/241#pullrequestreview-6034834697). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T06:47:22Z. **Review:** APPROVED --- Verified locally on macOS 26 arm64, rustc 1.98.1 (aarch64-apple-darwin) at head 9ad8b9d: - `cargo test -p victory-core --locked`: **65 passed, 0 failed** (main: 8 — the new config/logging path tests all run green on macOS). The app-crate part (main.rs, XDG dirs) can't be exercised on macOS because main's app crate doesn't compile here (known `host_resource` cfg issue, fixed by #235/#523), but the core logic — where the behavior lives — is fully tested. Approving.
SkippySteve commented 2026-11-24 06:55:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T01:48:21Z.


I've merged #243 (skip empty or relative LOCALAPPDATA/XDG/HOME values, hermetic tests) into this branch, since both PRs changed the same function. I've closed #243 so only one PR changes config.rs. cargo test -p victory-core passes (13 tests) and clippy is clean with -D warnings (host and Windows MSVC).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7119463165 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/241#issuecomment-7119463165). Originally posted by [SkippySteve](https://github.com/SkippySteve) on 2026-11-24T01:48:21Z. --- I've merged #243 (skip empty or relative LOCALAPPDATA/XDG/HOME values, hermetic tests) into this branch, since both PRs changed the same function. I've closed #243 so only one PR changes `config.rs`. `cargo test -p victory-core` passes (13 tests) and clippy is clean with `-D warnings` (host and Windows MSVC).
MichaelSmithAI commented 2026-11-24 12:04:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T11:15:32Z.


One upgrade detail for native Linux users: with a marker in the former default ~/.cache/victory/data, the CLI selects the new XDG data directory and leaves the marker behind. Pointing VICTORY_DATA_DIR back into the cache is rejected, as intended. An ordinary Wine prefix continued to use its existing AppData paths.

A short migration note beside the new defaults would help people find existing saves: before clearing the cache, check the former data directory ($XDG_CACHE_HOME/victory/data, normally ~/.cache/victory/data). If it contains data to keep, back it up, run victory config to find the new data_dir, and copy the contents there, preserving any newer files. The CLI check used synthetic data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129864423 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/241#issuecomment-7129864423). Originally posted by [MichaelSmithAI](https://github.com/MichaelSmithAI) on 2026-11-24T11:15:32Z. --- One upgrade detail for native Linux users: with a marker in the former default `~/.cache/victory/data`, the CLI selects the new XDG data directory and leaves the marker behind. Pointing `VICTORY_DATA_DIR` back into the cache is rejected, as intended. An ordinary Wine prefix continued to use its existing AppData paths. A short migration note beside the new defaults would help people find existing saves: before clearing the cache, check the former data directory (`$XDG_CACHE_HOME/victory/data`, normally `~/.cache/victory/data`). If it contains data to keep, back it up, run `victory config` to find the new `data_dir`, and copy the contents there, preserving any newer files. The CLI check used synthetic data.
alexdeliu commented 2026-11-24 18:05:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by alexdeliu on 2026-11-24T17:23:27Z.


Merged onto main @ ffe310eb (PR head e8fbe936), this does not build on Windows: the tests in crates/victory-core/src/config.rs (around lines 7568-7612) use std::os::unix::{fs::symlink, fs::FileTypeExt, net::UnixListener} without #[cfg(unix)], so cargo clippy --all-targets fails with E0433: cannot find unix in os and E0599: no method is_socket. Gating those tests on #[cfg(unix)] should be enough.

Checked with CI's steps (both clippy runs with -D warnings, cargo test --workspace) on Windows 11, AMD RX 9070. Every open PR: https://gist.github.com/alexdeliu/ef9ef0ebc1776ff104b5aa8eaea18e87

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139121302 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/241#issuecomment-7139121302). Originally posted by [alexdeliu](https://github.com/alexdeliu) on 2026-11-24T17:23:27Z. --- Merged onto `main` @ `ffe310eb` (PR head `e8fbe936`), this does not build on Windows: the tests in `crates/victory-core/src/config.rs` (around lines 7568-7612) use `std::os::unix::{fs::symlink, fs::FileTypeExt, net::UnixListener}` without `#[cfg(unix)]`, so `cargo clippy --all-targets` fails with `E0433: cannot find unix in os` and `E0599: no method is_socket`. Gating those tests on `#[cfg(unix)]` should be enough. <sub>Checked with CI's steps (both clippy runs with `-D warnings`, `cargo test --workspace`) on Windows 11, AMD RX 9070. Every open PR: https://gist.github.com/alexdeliu/ef9ef0ebc1776ff104b5aa8eaea18e87</sub>
Marvisak commented 2026-11-25 01:07:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:23:19Z.


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: apps/victory/src/main.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148457120 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/241#issuecomment-7148457120). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:23:19Z. --- <!-- victory-triage v1 head=e8fbe9363d475bf392627d69837be765445b6db2 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `apps/victory/src/main.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-25 02:02:37 +00:00

Pull request closed

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!241
No description provided.