Launchers: built at every start, and the log says which commit the program was built from #824

Open
0xkn0wh3r3 wants to merge 3 commits from upstream-pr/824 into main
0xkn0wh3r3 commented 2026-11-28 07:13:15 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 0xkn0wh3r3 on 2026-11-28T07:13:15Z.


The launchers built victory.exe only when it was missing. A checkout that had changed since the last build ran the old program, and the log header's source: <branch> at <commit> described the checkout at launch, not what the program was built from. A run built from an older commit looked like a run of the new one in its log, and nothing said so.

What changes

  • scripts/play-foxhound.ps1, scripts/play.ps1 and victory play run the cargo build before every launch, the two scripts through one shared helper (scripts/victory-build.ps1). When nothing changed it finishes in a few seconds. Without cargo, an existing program is used, with a warning that it may be older than the checkout.
  • apps/victory/build.rs builds in the commit the program was built from, and whether the tree had changes. The log header now names both that commit and the checkout, and warns when they differ.

Also in this PR

The first commit adds -LogDir, -LogTag, -LogLevel/-LogFilter and -LogFileOnly to the launchers (where a run logs, a name for it, how much, and files only for measuring). The rebuild change touches the same lines of play-foxhound.ps1 and is built on it. Rebased on current main, keeping its -FrameGenReady argument in the restart line.

Tested

  • cargo test -p victory: all pass.
  • Clippy raises nothing in the changed code.
  • The release build runs, and the built program carries its commit.
  • The changed PowerShell scripts parse.
  • Not yet tried by launching the game from this branch.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5537765535 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/824). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-28T07:13:15Z. --- The launchers built `victory.exe` only when it was missing. A checkout that had changed since the last build ran the old program, and the log header's `source: <branch> at <commit>` described the checkout at launch, not what the program was built from. A run built from an older commit looked like a run of the new one in its log, and nothing said so. **What changes** - `scripts/play-foxhound.ps1`, `scripts/play.ps1` and `victory play` run the cargo build before every launch, the two scripts through one shared helper (`scripts/victory-build.ps1`). When nothing changed it finishes in a few seconds. Without cargo, an existing program is used, with a warning that it may be older than the checkout. - `apps/victory/build.rs` builds in the commit the program was built from, and whether the tree had changes. The log header now names both that commit and the checkout, and warns when they differ. **Also in this PR** The first commit adds `-LogDir`, `-LogTag`, `-LogLevel`/`-LogFilter` and `-LogFileOnly` to the launchers (where a run logs, a name for it, how much, and files only for measuring). The rebuild change touches the same lines of `play-foxhound.ps1` and is built on it. Rebased on current `main`, keeping its `-FrameGenReady` argument in the restart line. **Tested** - `cargo test -p victory`: all pass. - Clippy raises nothing in the changed code. - The release build runs, and the built program carries its commit. - The changed PowerShell scripts parse. - Not yet tried by launching the game from this branch.
kibagami-nc commented 2026-11-28 17:46:15 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kibagami-nc on 2026-11-28T17:46:15Z.


A user ran into exactly what this fixes, in #1342. After a git pull, the F1 menu had no MOUSE AND KEYBOARD, KEY BINDINGS or save import/export, and VICTORY_MNK=1 did nothing. play-foxhound.ps1 builds only while target\release\victory.exe is missing, so the build from before the pull kept starting. A fresh clone made it all appear. The commit line in the log that this adds would have shown the stale build at once.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243273842 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/824#issuecomment-7243273842). Originally posted by [kibagami-nc](https://github.com/kibagami-nc) on 2026-11-28T17:46:15Z. --- A user ran into exactly what this fixes, in #1342. After a `git pull`, the F1 menu had no MOUSE AND KEYBOARD, KEY BINDINGS or save import/export, and `VICTORY_MNK=1` did nothing. `play-foxhound.ps1` builds only while `target\release\victory.exe` is missing, so the build from before the pull kept starting. A fresh clone made it all appear. The commit line in the log that this adds would have shown the stale build at once.
ANDREANIADS commented 2026-11-28 17:56:55 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ANDREANIADS on 2026-11-28T17:56:55Z.


At 608971e, Build-Victory can report built for an older executable when CARGO_TARGET_DIR is set. Keep commit A’s target/release/victory.exe, move the checkout to B, set CARGO_TARGET_DIR to another directory, then call Build-Victory $repo release. Cargo succeeds in the other directory. The helper checks the existing A file and returns built. Get-VictorySource correctly warns that A differs from B.

In a local copy, adding --target-dir (Join-Path $Repo 'target') to both Cargo invocations made the selected release and diag files report B. Tested with PowerShell 7.4.19 on Linux, real Cargo/Git and a synthetic version-only executable. Clean/incremental builds, a compiler error with an old file present, and both no-Cargo paths behaved as documented. No launcher or game run.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243411110 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/824#issuecomment-7243411110). Originally posted by [ANDREANIADS](https://github.com/ANDREANIADS) on 2026-11-28T17:56:55Z. --- At `608971e`, `Build-Victory` can report `built` for an older executable when `CARGO_TARGET_DIR` is set. Keep commit A’s `target/release/victory.exe`, move the checkout to B, set `CARGO_TARGET_DIR` to another directory, then call `Build-Victory $repo release`. Cargo succeeds in the other directory. The helper checks the existing A file and returns `built`. `Get-VictorySource` correctly warns that A differs from B. In a local copy, adding `--target-dir (Join-Path $Repo 'target')` to both Cargo invocations made the selected release and diag files report B. Tested with PowerShell 7.4.19 on Linux, real Cargo/Git and a synthetic version-only executable. Clean/incremental builds, a compiler error with an old file present, and both no-Cargo paths behaved as documented. No launcher or game run.
ANDREANIADS commented 2026-11-28 18:35:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ANDREANIADS on 2026-11-28T18:35:05Z.


Correction to my --target-dir suggestion: specifying the host triple still adds a directory level. With CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu or [build] target set to that host, Cargo built B at target/<triple>/<profile>/victory, while Build-Victory returned built for A at target/<profile>/victory.exe. Reproduced in release and diag with PowerShell 7.4.19 on Linux and a version-only Rust binary (the .exe name was a local symlink).

A local guard checked compiler-artifact.executable for the victory bin in Cargo’s JSON output and stopped on an unexpected directory. It rejected all four mismatches and accepted both default layouts, without relocating adjacent dependencies or overriding the configured target. One wording detail: victory play uses current_exe() and warns about a source mismatch. Only the two PowerShell launchers call Build-Victory. No launcher or game was run.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243901813 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/824#issuecomment-7243901813). Originally posted by [ANDREANIADS](https://github.com/ANDREANIADS) on 2026-11-28T18:35:05Z. --- Correction to my `--target-dir` suggestion: specifying the host triple still adds a directory level. With `CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu` or `[build] target` set to that host, Cargo built B at `target/<triple>/<profile>/victory`, while `Build-Victory` returned `built` for A at `target/<profile>/victory.exe`. Reproduced in release and diag with PowerShell 7.4.19 on Linux and a version-only Rust binary (the `.exe` name was a local symlink). A local guard checked `compiler-artifact.executable` for the `victory` bin in Cargo’s JSON output and stopped on an unexpected directory. It rejected all four mismatches and accepted both default layouts, without relocating adjacent dependencies or overriding the configured target. One wording detail: `victory play` uses `current_exe()` and warns about a source mismatch. Only the two PowerShell launchers call `Build-Victory`. No launcher or game was run.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/824:upstream-pr/824'
git switch 'upstream-pr/824'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/824'
git switch 'upstream-pr/824'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/824'
git switch 'upstream-pr/824'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/824'
git switch 'main'
git merge --squash 'upstream-pr/824'
git switch 'main'
git merge --ff-only 'upstream-pr/824'
git switch 'main'
git merge 'upstream-pr/824'
git push origin 'main'
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
trustno1-coder/VIctory-NVIDIA!824
No description provided.