launcher: name a missing Rust or C++ build tools before the first build (LAUNCHER-RUST-PREREQ) #3187
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
3 participants
Due date
No due date set.
Reference
leonida/mandy!3187
Loading…
Reference in a new issue
No description provided.
Delete branch "github-pr/3187"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: LAUNCHER-RUST-PREREQ (released by @tiguan26 on 30 Nov)
Fixes: #3025
Fixes: #3131
Fixes: #3117
What and why
A first start through
Launcher.batbuildsleonida.exewithd3d12\scripts\build-nvidia.ps1. Without Rust the window showed only PowerShell's localizedCommandNotFoundExceptionforcargo; without the Visual Studio C++ build tools cargo stopped at its first link.build-nvidia.ps1now, before building:CARGO_HOME\bin(a Rust installed after the window opened), else says Rust is missing (rustup.rs,winget install Rustlang.Rustup) and exits 1;-latest -prerelease -products *, the same lookup asscripts/build_llvm_mc.ps1) for the x64 C++ tools,VCINSTALLDIRfrom a Developer prompt counting too, else names the Build Tools winget command and exits 1.scripts/play-d3d12.ps1's message after a failed build now points at the lines above it.Tested
tests/test_build_nvidia_cargo.py: missing Rust, cargo only inCARGO_HOME\bin, missing C++ tools (Windows), C++ tools found by a stand-in vswhere (Windows). All four fail onmain(checked on Windows: the fourth fails too, becausemainhas noCARGO_HOMEinlookup) and pass with this change.python -I scripts/check_no_game_data.pyon the changed files,tests/test_text_write_line_endings.py,test_docs_*.py: OK.GPUs tested: n/a (build script only)
AI-assisted: yes. Author: Claude Opus (Claude Code). Reviewer: a separate read-only Claude Opus reviewer agent (twice, findings applied).
finding:
d3d12/scripts/play-nvidia.ps1:138has its own$noCargocheck without theCARGO_HOME\binlookup; one shared helper would remove the duplicate. No game files or specific hardware needed.Checklist
mainand merges cleanly.docs/design.md(n/a)Generated by Claude Code
Verified here: it applies and its own tests pass.
What it fixes is the kind of report that reads as a bug and is a missing tool: #3025 and #3131 both arrive as "it does not work", and the launcher's first build fails on a missing Rust or C++ toolchain in the window, before anything explains it. A line that names what is missing, before the build starts, is the whole of the value here - and it is tested against the message, which is the part that would otherwise rot silently.
What I could not test: the path where the tool really is missing. This machine has both toolchains, so the test's synthetic case is as far as I can go - and that is the honest limit: I verified that the launcher says the right thing, not that it says it on a machine that needs it.
And the checker would read this as
red not constructible-tests/test_build_nvidia_cargo.pyis a new file, so the red side has nothing to build from. That is not a fault in the pull request; it is the case the docs describe, and I am noting it so the next reader of the verdict does not chase it.For the merge:
BLOCKED, and it is two launcher scripts plus a test - the review is short, which after a night of 2,277-line pull requests is worth saying.AI-assisted: yes - DeepSeek v4.1 (flash).
VERIFY-3187 — Windows nativo, con Build Tools instaladas (el caso que el PR describe)
8af4eb4424910c5c2emainb41763227—git merge-tree --write-treeclean,git merge --no-ffclean (auto-mergedplay-d3d12.ps1, which #3172 changed since the base)Ran (native Windows, Python 3.13)
Negative control (
d3d12/scripts/build-nvidia.ps1reverted tomain, the PR's test kept):The real check, on a machine that has only the Build Tools (
vswhere.exepresent,VCINSTALLDIRunset — this one):That is the flag combination this repository has already been bitten by: without
-products *the samevswhereprints nothing on a Build-Tools-only machine, and the script would then tell a user with the tools installed to install them. The PR's line gets it right.What I could not test
Launcher.batend to end: not run; the change is insidebuild-nvidia.ps1.Verdict: red then green, and the
vswhereinvocation the PR adds returns the right path on a Build-Tools-only install.Written with an AI assistant.
RUN (independent check on Windows, #3187 head
8af4eb442b8f73c17b5224a72808d61895e5cf99and #3220 head0beb7d26d85be96f280c4baa6a66a351fea47a6a, both merged withgit merge --no-ffintomain16243cd6eb16d70eefa31fd42213daf5a3583ea4)Windows 11, Windows PowerShell 5.1, Python 3.14, run with
python -I. No cargo build, no game data. Nothing was run against the real repo working tree (detached worktree only).Green
main:python -I tests/test_build_nvidia_cargo.pyruns 4 tests, 4 OK (missing Rust, cargo only inCARGO_HOME\bin, missing C++ tools, C++ tools found by the stand-in vswhere).Red
main'sd3d12/scripts/build-nvidia.ps1put back: 4 of 4 fail (restored afterwards).CARGO_HOME\bin, which main never looks in. The tests are fine; the sentence is wrong (3 red + 1 control should read 4 red).Together with #3220
play-nvidia.ps1andtests/test_win_launchers.pyare not in #3187).test_build_nvidia_cargo.py4/4 OK;tests/test_win_launchers.py10/10 OK (run twice, once as a script, once through unittest discover).play-nvidia.ps1 -Build diagwith no cargo anywhere and no build: "No build and no cargo: install Rust (README.md)", exit 1.build-nvidia.ps1is never reached, so #3187's check is not hidden, but its better message (rustup.rs, winget) is not shown on this path either.build-nvidia.ps1prints the Build Tools message and exits 1;play-nvidia.ps1does not look at that exit code, goes on, prints "No ...leonida.exe. Build it first", exit 1. The player sees both lines, exit code is 1, and the real reason stays on screen. OK.scripts/play-d3d12.ps1(the launcher): it callsbuild-nvidia.ps1itself whenleonida.exeis missing and throws with the new "the lines above say why" text on exit 1. OK.play-nvidia.ps1failures nowexit 1instead ofreturn(#3220), so Launcher.bat shows a failure code for those. OK.Gaps
play-nvidia.ps1:137$noCargo = -not (Get-Command cargo ...)has noCARGO_HOME\binlookup. I ran the mergedplay-nvidia.ps1directly with cargo only in a fakeCARGO_HOME\binand no build: it prints "No build and no cargo" and exits 1, althoughbuild-nvidia.ps1would have found that cargo. A player with Rust only underCARGO_HOME(installed after the window opened, or a customCARGO_HOME) who runsplay-nvidia.ps1by hand (docs/windows-memory.md does) is refused.play-d3d12.ps1the gap mostly does not show:build-nvidia.ps1runs first when the exe is missing and prependsCARGO_HOME\binto the processPATH, whichplay-nvidia.ps1then inherits.build-nvidia.ps1has not run in that process: it says "no cargo" and silently keeps the non-DLSS build.finding:. A shared helper or the same 4 lines inplay-nvidia.ps1fixes it; I would not block #3187 on it, but #3187 should not be read as "cargo only under CARGO_HOME works everywhere".play-nvidia.ps1:148ignores the exit code ofbuild-nvidia.ps1. With an existing stale exe, a failed rebuild (new exit 1) is followed by running the old build. Pre-existing, not worse after the PRs.Fixes: #3025andFixes: #3131. Both outputs are the sameCommandNotFoundExceptionforcargofromplay-d3d12.ps1(the Russian-locale text is in #3131). Covered when cargo is absent or only under the default or customCARGO_HOME. #3117 (English text, same exception, same launcher, same "Building with DLSS" line) is covered the same way and is not claimed: addFixes: #3117. Caveat for all three: if the reporter has Rust installed somewhere else not on PATH, they now get "Rust is not installed" with a misleading hint; nothing in the logs shows that case.-latest -prerelease -products *,VCINSTALLDIR, message change inplay-d3d12.ps1). Only the "fourth test passes on main" sentence is wrong. I did not check the claimed release of the item by @tiguan26.no_cargowithPATH = '', so it passes with or without #3187; no test covers play-nvidia with cargo only inCARGO_HOME\bin.Verdict
#3187: OK to merge on green CI; the code does what it says and the tests fail on main and pass on the branch. Fix the body (4 red, not 3 + a control; add
Fixes: #3117). #3220: OK. Merged together: no conflict, no check hides another, the player gets exit 1 with a readable message in every case I tried. Open follow-up: theplay-nvidia.ps1CARGO_HOME\bingap (finding 1).AI-assisted (Claude Code), models: Claude Opus 5.5 (checker), separate Claude Opus 5.5 judge. Note: #3187 is by MoonEyes, so this is not a third-party check.
RUN (gate-style, build and in game): head 8af4eb442 merged alone with
git merge --no-ffontomainef35d683e (no conflict). RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro (build 26300), Visual Studio 2022 Build Tools and Rust installed.First build as a user would run it.
d3d12\scripts\build-nvidia.ps1(the scriptLauncher.batruns on a first start) was started with a plain PowerShell, with no Developer prompt, noCARGO_TARGET_DIR, noCARGO_BUILD_TARGETand notargetfolder yet. cargo was found, vswhere found the C++ tools, and neither new message was printed. The build ran to the end in 199 s (exit 0) and wrotebuilt-with.txt. The case without Rust or without the C++ tools was not tried on this machine; the four cases oftests/test_build_nvidia_cargo.pywere not rerun here.Observed on the way, not caused by this change: rustup's default host on this machine is
x86_64-pc-windows-gnuandd3d12/rust-toolchain.tomldoes not select a target, so that build made a GNU executable (133.5 MB, no.pdb), while the new comment says the toolchain's target isx86_64-pc-windows-msvc. The vswhere check runs whichever host the toolchain builds for. On a machine with a GNU default host and no Visual Studio it would stop the build at the new message; whether that build could have gone through without Visual Studio was not tried.In game. The runs used an MSVC build of the same tree (
diagnostics,mimalloc, targetx86_64-pc-windows-msvc, 21.7 MB). Launcher defaults except-PrecompileUsed(on thismainthe launcher's default precompiles every recorded pipeline, which takes hours on a first start), Series S settings,-NoDlss -NoFrameGen, standing at the save. A warm-up run first, in a data folder of its own (thismainchanged the translator since the last gate run). Then one run with the memory safety stop, ended 300 s after reaching the world:Warnings: only kinds that a run of the previous
main(f3865cae8) with another pull request (#3128) printed too, in about the same numbers; no new kind. No pipeline refused other than the 29 "creation method that is not implemented" lines that run has as well. The last frame saved (8192) shows the world drawn normally. The play script's new failure line was not reached (the build did not fail).Also checked earlier on the same merge, without building: the pull request's own tests pass (
tests/test_build_nvidia_cargo.py: 4 passed with pytest, 4 OK with unittest). The launcher from this branch, with no exe present, was run three times with the environment narrowed: with Rust hidden (systemPATH, emptyCARGO_HOME) it printed the new "Rust is not installed" message and then stopped with its build failure line; with the Build Tools hidden (vswherenot found) it printed the Visual Studio Build Tools message and stopped the same way; with the real tools and a stand-incargoit printed nothing new and calledcargo build --locked --profile diag -p leonida --features diagnostics,mimalloc. These were simulated on this PC, not on machines that really lack the tools.Verdict: PASS. The new checks let a machine with Rust and the C++ tools build as before, and the game runs from that launcher path with no new warning or failure. Not covered here: the two failure cases on a real machine, a Rust installed after the window opened (
CARGO_HOME\binlookup), Developer prompts (VCINSTALLDIR),-RayTracing, DLSS and frame generation, other GPUs, Wine/Proton.AI-assisted: Claude Code (Claude Opus 5.5)
Merged by OreoFR (agent). MoonEyes asked for it and rebased it on main after #3426. His judge accepted it.
The branch was updated through "Update branch", with MoonEyes' written OK, to head
d982eca41on maine1096be03. Local CI then ran on that exact head: PASS. The PR changes no Rust, so the Rust step was skipped. Passing checks:make_game.py --help;Merged as
e451c353a.