docs/env.md: every VICTORY_* switch, generated by cargo xtask env; warn on unknown ones #83
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/83"
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?
Imported from uiliannn/VItoriaBr. Originally posted by lcg007xd-c on 2026-11-25T22:08:54Z.
What
The code reads 256
VICTORY_*environment switches. The README, the other docs andvictory.example.tomldescribe 54 of them (issue #1 points at the undocumented ones). There was no list, so nothing tells a user that a switch is spelled wrong or has been renamed. It just does nothing.cargo xtask envwritesdocs/env.md. It lists everyVICTORY_*name that appears as a whole string literal in the Rust source, the files that read it, and whether the hand-written docs describe it. The table doesn't try to describe each switch. It shows where to look, and which ones still need writing up.env_table_is_currentprints a warning naming the command that fixes it, and passes. WithVICTORY_STRICT_TESTS=1(the switch the shader test skips use) it fails.cargo xtask env --checkalways fails on a stale table.VICTORY_*variable that isn't in the table, for example:warning: VICTORY_RELAYS is set but is no known switch (docs/env.md): a typo?.Friction
A PR that adds a switch without rerunning
cargo xtask envonly gets a test warning. No one's PR goes red over it. Until the table is regenerated, the startup warning also names that new switch, and its wording ("a typo?") allows for that.Tests
env_table_is_current, plusonly_whole_literals_count:"VICTORY_X"counts, but a message that starts with the prefix doesn't.the_table_lists_the_log_filterandunknown_names_with_the_prefix_are_reportedin victory-core.git grepof quotedVICTORY_names: the two lists are identical. A CRLF checkout of the table still passes. With one row removed, the test warns by default and fails when strict.--target x86_64-pc-windows-msvc) pass locally.Not tested: the warning when running the real binary on Windows. It's one
eprintln!inlogging::init, which every binary calls.🤖 Generated with Claude Code
Imported from uiliannn/VItoriaBr. Originally posted by lmouz823-lang on 2026-11-28T04:41:12Z.
I can take native Windows entry-point validation at exact head
de13cf4fb97c522f75b952b9a64cb60362bdfe10. I will check mixed-case known and unknown environment names through public logging::init in fresh processes, alongside switches::unread, since Windows environment lookup is case-insensitive. If this reproduces false warnings or missed typos, I will propose a small Windows-only comparison fix with a regression, preserve the reported spelling, and verify the generated environment table. I will report the precise head, existing merge-conflict status, before/after evidence and any skipped scope here. AI-assisted with Codex.Imported from uiliannn/VItoriaBr. Originally posted by lmouz823-lang on 2026-11-28T04:52:15Z.
Native Windows validation found and fixed a name-comparison issue on exact head
de13cf4fb97c522f75b952b9a64cb60362bdfe10. The attached patch targets that head, whose current merge status conflicts with main.Windows environment variable names are case-insensitive. The original prefix and
HashSetchecks inswitches::unreaduse exact spelling. This gives both an incorrect warning for a known mixed-case variable and a missed warning for an unknown variable with a lower-case prefix. Microsoft environment-variable documentationI reproduced this through a tiny external binary calling the public
logging::init("info"). Each case uses a fresh child process and external working directory. The driver clears inherited VICTORY variables and RUST_LOG, sets one test-owned value, prints the actual name fromvars_os()and the result of reading its canonical upper-case name, then captures the startup warning.CANONICAL_READuses the current case's name in upper case, sovictory_LOGGis read asVICTORY_LOGG. Every canonical read returnedSome("info"), including the mixed-case names.VICTORY_LOGVICTORY_logVictory_LOGVICTORY_LOGGvictory_LOGGPR83_UNRELATEDThe fix creates an ASCII upper-case comparison key on Windows, preserving the original spelling in the returned warning names and their existing sort order. The non-Windows branch compares the original spelling. The added Windows-only regression supplies synthetic names and checks that both typo spellings survive while the known spellings are accepted. Its names are built from PREFIX so the environment-table generator cannot mistake test typos for supported switches.
cargo xtask env --checkreports current on both head and patch.docs/env.mdis byte-identical. Core Clippy with-D warnings, rustfmt on the changed file, andgit diff --checkpass.Environment was Windows 11 build 26200, Rust 1.98.1 MSVC, default test profile and an isolated build directory. No cases in the six-scenario startup matrix were skipped, and the final core suite has no ignored tests. Native Unix execution and integration onto current main remain unverified.
AI assistance from Codex covered the patch, probe, execution and this report.
Focused patch against this PR head
External probe and reproduction
Public logging entry-point reproduction
Create an external probe directory with the three files below. Replace
<checkout>in the manifest with the exact PR checkout path using forward slashes. Set$probeDirto that external directory. Run the matrix on the unmodified head withbefore, then apply the patch, rebuild and useafter.The
beforematrix asserts both observed incorrect warnings and the four successful controls. Theaftermatrix requires all six warnings to follow Windows environment-name semantics.Cargo.toml
src/main.rs
public-probe-matrix.py
Core regression commands follow.
Pull request closed