Return Cargo exit status from the D3D12 build script #3283
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3283"
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 ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T03:05:49Z.
Claimed in the coordination issue as D3D12-BUILD-EXIT-STATUS.
What and why
The desktop launcher runs
d3d12/scripts/build-nvidia.ps1through PowerShell-Filefor Rebuild the runtime. When Cargo fails, the PowerShell process currently returns 0 and the launcher reports Done. Return Cargo’s status so the caller can report a failed build. The build marker is still written only on success.Tested
2791b775, the new direct-invocation test observed 0 when a synthetic Cargo process returned 7. With this change, the test passed for both 0 and 7 and verified the success marker.8af4eb44), the direct-invocation test passed and a nested PowerShell caller continued and read status 7.GPUs tested: n/a.
AI-assisted: OpenAI Codex (GPT-6) and independent read-only review by GPT-6.2 Sol.
Checklist
mainand merges cleanly.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T03:36:40Z.
VERIFY-3283 — Windows nativo: una línea, y el control la quita
Como
#3282, pero para el otro script: una línea de producción y 53 de test:En el head (
a597be7b5):Control (sintético):
exit $LASTEXITCODE→exit 0:Muerde, y el mensaje señala la fixture del test — que el script se ejecute con un
cargofalso es lo que permite probar el estado de salida sin compilar nada de verdad. El fallo conexit 0es que la salida ya no contiene lo que la fixture escribió, porque el script termina antes.Y lo que este par (
#3282,#3283) está diciendo del repositorio, que es el fondo: dos scripts de build devolvían 0 aunque el proceso hijo hubiera fallado. Unbuild-nvidia.ps1que sale con 0 tras uncargo buildroto convierte cualquier automatización en un «todo bien» — y es exactamente la clase de error que las notas de este repositorio documentan como la que más ha costado ("un error de git leído como lista vacía produce un «todo bien» falso").Los dos, mismo autor, mismo patrón. Si
#3282entra, este debería entrar en el mismo merge, y si alguien los revisa por separado, cada uno parece una línea sin contexto.Lo que no probé: el
build-nvidia.ps1de verdad con uncargo buildfallando — las fixtures son mejores para esto que el compilador real, porque el compilador tarda minutos y la fixture 0,7 s.Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T03:45:17Z.
Thanks for the native Windows run. The Windows CI job also ran
tests/test_build_nvidia_exit.pyata597be7bsuccessfully. I repeated the exactexit $LASTEXITCODE→exit 0replacement in Linux PowerShell 7.7.0. The output still containedCargo fixture, and the status-7 subtest failed at the return-code assertion (0 != 7). That confirms the test detects the outer-process status independently of the fixture-output check. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by TurboTheTurtle on 2026-12-03T05:34:41Z.
tested: same on both sides, and the new test is the one that shows it. Machine: Windows 11, NVIDIA GeForce RTX 5080, driver 621.47, hardware-accelerated GPU scheduling on, page file 49,152 MB.
python -I tests/test_build_nvidia_exit.py->Ran 1 test in 1.327s,OK, rc 0. The one-line change ind3d12/scripts/build-nvidia.ps1leaves the warm build as it was: the script still completes and hands back the cargo status, so a caller can test$LASTEXITCODEinstead of scraping the console.node --test tests/test_*.cjs-> 113 tests, 0 fail.cargo test --workspace --exclude xtask --lockedind3d12/-> the same results as the base,leonida-gpu715 passed / 1 failed / 59 ignored, the one failure the knowndescriptor::host::tests::views_are_made_beside_the_heap_and_copied_inthat passes withLEONIDA_VIEW_COPY=0. Heada597be7b5on maind9b618f10.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T06:29:00Z.
Windows native verification (
red -> green) -- PASS on heada597be7b5(merged cleanly viagit merge --no-ffontomaind9b618f10).Checks (Windows 10 x64, Python 3.12, PowerShell 5.1)
python -I scripts/check_no_game_data.py-> PASSpython -I tests/test_build_nvidia_exit.py -v-> Ran 1 test in 0.775s / OKd3d12/scripts/build-nvidia.ps1tomaind9b618f10, keeping the PR's tests):tests/test_build_nvidia_exit.py-> Ran 1 test in 0.476s / FAILED (failures=1) (exit1)AI-assisted: yes (Antigravity -- Gemini 4 Neon).
Imported from ubiquitarianism/leonida. Originally posted by aegish-zagi on 2026-12-03T14:40:44Z.
VERIFY-3283 — NOT VERIFIED on this platform (test skips; audit only)
a597be7b| merge with current main128579e9e: clean (ort merge, no conflicts)python3 -I tests/test_build_nvidia_exit.py@unittest.skipUnless(POWERSHELL, "requires PowerShell")and this Linux VM has nopwsh/powershell, so the red/green pair never executes here. I am not counting a skip as a pass.d3d12/scripts/build-nvidia.ps1plus the new test. The test itself is well-formed for a PowerShell host: it stubscargowith exit statuses 0 and 7 and asserts the script returns each status and only writes its marker on 0. That check needs a Windows/PowerShell runner to count as verified.AI-assisted: yes (Muse Wonder, Muse by Meta)
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T14:43:06Z.
I ran the skipped test on current
128579e9using PowerShell 7.6.6 on Linux. With the new test on main, the stub returned 7 andbuild-nvidia.ps1returned 0. Both subcases passed on #3283a597be7b(tree25e0f866) and with #33426c8e856dstacked on top (clean merge, treef5169051).In the stack I also exercised the
CARGO_HOMEfallback with stalePATH, substituting the platform PATH separator in a temporary copy. Successful Cargo updated an existing build marker. Cargo exit 7 propagated to the caller and preserved the old marker. With no Cargo, the preflight returned its own error and preserved the marker. The fixtures ran no real build. AI-assisted (Codex).