d3d12: build-nvidia.ps1 builds the msvc target when Rust's host is not MSVC (BUILD-NVIDIA-MSVC-TARGET) #3426
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
2 participants
Due date
No due date set.
Reference
leonida/mandy!3426
Loading…
Reference in a new issue
No description provided.
Delete branch "underlight3d/mandy:build-msvc-target"
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: BUILD-NVIDIA-MSVC-TARGET (https://git.leonida.now/leonida/mandy/issues/3312#issuecomment-25051). Related: #3238 (exports from a gnullvm build, a different route).
What and why
d3d12/scripts/build-nvidia.ps1rancargo buildwithout--target, andd3d12/rust-toolchain.tomlinstalls the msvc target without selecting it. With rustup's default hostx86_64-pc-windows-gnu,leonida.execame out a GNU build: about 128 MB (122 MiB), mostly DWARF debug info, against about 22 MB. It has no export table and loadsd3d12.dllat start instead of delay-loading it (build.rsgives/EXPORTand/DELAYLOADto the msvc linker only), so the Agility SDK cannot be picked up. Mandy Setup installs rustup for the msvc host, so this mainly helps people who set up Rust themselves.The script now asks
rustc -vVind3d12. If the host is not*-pc-windows-msvc(GNU, gnullvm, i686…):libcore. If not, it stops withrustup target add x86_64-pc-windows-msvc, to run ind3d12(so it lands on the pinned toolchain). If rustc gives no sysroot, or one that does not exist (for example a user folder with non-ASCII characters, read in the console code page), cargo is left to report.--target x86_64-pc-windows-msvc.leonida.exetotarget\diag, where the launcher and the play scripts already look. It first checks the msvc exe exists (otherwise the old files are kept and it exits 1), then removes cargo's hard-linked file before copying (so the GNU build's file indepsis not overwritten through the link), and dates the copy at copy time soplay-nvidia.ps1refreshesleonida_sm.exe. The pdb follows; if it cannot be replaced, that is only a warning.$ErrorActionPreference = "Stop"(asplay-d3d12.ps1sets before calling this script).With an msvc host, or when rustc cannot say, cargo gets the same arguments as before. Launcher files are untouched; @OreoFR agreed, and the missing-target message is his request.
Tested
tests/test_build_nvidia_msvc_target.py(new; stand-incargoandrustcthat record their arguments and working folder): 14 tests. Onmain's script 12 fail for the reason they state; 14 pass here. Each of 14 deliberate breaks of the new script is caught by a test.tests/test_build_nvidia_exit.pygets a failingrustcstand-in, so the PC's own Rust does not decide its result.x86_64-pc-windows-gnu, Rust 1.98.1, the script run with no arguments as the launcher runs it: exit 0, "Built:" printed, a 21,789,696-byte msvcleonida.exeintarget\diagexportingD3D12SDKVersion, one link, dated at copy time,built-with.txtwritten, and cargo's hard-linked file indepsleft with its own contents.[IO.Path]::Combine).GPUs tested: n/a (build script; the exe was not started in the game).
AI-assisted: yes (Claude Code, Claude Opus 5.5 for the code and tests; two independent read-only reviewer agents, Claude Opus 5.5, one on the code and one on the evidence and mutations; the code reviewer re-reviewed the fixes and found them ready).
Checklist
mainand merges cleanly.🤖 Generated with Claude Code
https://claude.ai/code/session_01WtKdZ5UBfzFHFUgnKaKoSc
a700d029einto build-msvc-target (BUILD-NVIDIA-MSVC-TARGET) 56930c702aMerged by OreoFR (agent) at MoonEyes' request, after his judge accepted it.
Local CI on head
621520c8emerged into maina700d029e: PASS. It found no Rust change and skipped the Rust step. The other checks passed:make_game.py --help;enlighted then merged
maininto the branch, giving head56930c702. Its tree is identical to the tree this CI tested:git merge-treeof621520c8ewitha700d029egivesdf0529168. Merged as662d061e1.Next: MoonEyes rebases #3187 on this.