Return Cargo exit status from the D3D12 build script #3283

Merged
merzleckeier merged 1 commit from upstream-pr/3283 into main 2026-12-03 15:16:47 +00:00
merzleckeier commented 2026-12-03 03:05:49 +00:00 (Migrated from github.com)

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.ps1 through PowerShell -File for 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

  • On 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.
  • On Linux with PowerShell 7.7.0, the desktop and Windows-launcher suites had 92 passes and six skips. The scoped clean-room and whitespace checks passed.
  • Combined with #3187 (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

  • Based on current main and merges cleanly.
  • One topic.
  • Clean-room checks passed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5619070434 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3283). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T03:05:49Z. --- Claimed in the coordination issue as [D3D12-BUILD-EXIT-STATUS](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7366135270). ### What and why The desktop launcher runs `d3d12/scripts/build-nvidia.ps1` through PowerShell `-File` for **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 - On `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. - On Linux with PowerShell 7.7.0, the desktop and Windows-launcher suites had 92 passes and six skips. The scoped clean-room and whitespace checks passed. - Combined with #3187 (`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 - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] Clean-room checks passed.
fiestorra commented 2026-12-03 03:36:40 +00:00 (Migrated from github.com)

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:

d3d12/scripts/build-nvidia.ps1  |  1 +
tests/test_build_nvidia_exit.py | 53 ++++++++++++++++++++++++++++++++++++++++++

En el head (a597be7b5):

pytest tests/test_build_nvidia_exit.py -q     1 passed, 2 subtests passed   (0.69 s)

Control (sintético): exit $LASTEXITCODE → exit 0:

1 failed, 1 passed, 1 subtests passed
self.assertIn("Cargo fixture", output)

Muerde, y el mensaje señala la fixture del test — que el script se ejecute con un cargo falso es lo que permite probar el estado de salida sin compilar nada de verdad. El fallo con exit 0 es 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. Un build-nvidia.ps1 que sale con 0 tras un cargo build roto 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 #3282 entra, 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.ps1 de verdad con un cargo build fallando — 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7366748096 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3283#issuecomment-7366748096). Originally posted by [fiestorra](https://github.com/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**: ``` d3d12/scripts/build-nvidia.ps1 | 1 + tests/test_build_nvidia_exit.py | 53 ++++++++++++++++++++++++++++++++++++++++++ ``` **En el head (`a597be7b5`)**: ``` pytest tests/test_build_nvidia_exit.py -q 1 passed, 2 subtests passed (0.69 s) ``` **Control (sintético)**: **`exit $LASTEXITCODE` → `exit 0`**: ``` 1 failed, 1 passed, 1 subtests passed self.assertIn("Cargo fixture", output) ``` **Muerde, y el mensaje señala la fixture del test** — **que el script se ejecute con un `cargo` falso es lo que permite probar el estado de salida sin compilar nada de verdad.** **El fallo con `exit 0` es 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.** **Un `build-nvidia.ps1` que sale con 0 tras un `cargo build` roto 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 `#3282` entra, 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.ps1` de verdad con un `cargo build` fallando** — **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.
merzleckeier commented 2026-12-03 03:45:17 +00:00 (Migrated from github.com)

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.py at a597be7b successfully. I repeated the exact exit $LASTEXITCODE → exit 0 replacement in Linux PowerShell 7.7.0. The output still contained Cargo 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7366899509 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3283#issuecomment-7366899509). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T03:45:17Z. --- Thanks for the native Windows run. The [Windows CI job](https://github.com/ProjectLeonida/mandy/actions/runs/47024980417/job/143975627931) also ran `tests/test_build_nvidia_exit.py` at `a597be7b` successfully. I repeated the exact `exit $LASTEXITCODE` → `exit 0` replacement in Linux PowerShell 7.7.0. The output still contained `Cargo 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.
TurboTheTurtle commented 2026-12-03 05:34:41 +00:00 (Migrated from github.com)

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 in d3d12/scripts/build-nvidia.ps1 leaves the warm build as it was: the script still completes and hands back the cargo status, so a caller can test $LASTEXITCODE instead of scraping the console. node --test tests/test_*.cjs -> 113 tests, 0 fail. cargo test --workspace --exclude xtask --locked in d3d12/ -> the same results as the base, leonida-gpu 715 passed / 1 failed / 59 ignored, the one failure the known descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in that passes with LEONIDA_VIEW_COPY=0. Head a597be7b5 on main d9b618f10.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7368888172 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3283#issuecomment-7368888172). Originally posted by [TurboTheTurtle](https://github.com/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 in `d3d12/scripts/build-nvidia.ps1` leaves the warm build as it was: the script still completes and hands back the cargo status, so a caller can test `$LASTEXITCODE` instead of scraping the console. `node --test tests/test_*.cjs` -> 113 tests, 0 fail. `cargo test --workspace --exclude xtask --locked` in `d3d12/` -> the same results as the base, `leonida-gpu` 715 passed / 1 failed / 59 ignored, the one failure the known `descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in` that passes with `LEONIDA_VIEW_COPY=0`. Head `a597be7b5` on main `d9b618f10`.
lixonik commented 2026-12-03 06:29:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T06:29:00Z.


Windows native verification (red -> green) -- PASS on head a597be7b5 (merged cleanly via git merge --no-ff onto main d9b618f10).

Checks (Windows 10 x64, Python 3.12, PowerShell 5.1)

  • python -I scripts/check_no_game_data.py -> PASS
  • Green:
    • python -I tests/test_build_nvidia_exit.py -v -> Ran 1 test in 0.775s / OK
  • Red (reverted d3d12/scripts/build-nvidia.ps1 to main d9b618f10, keeping the PR's tests):
    • tests/test_build_nvidia_exit.py -> Ran 1 test in 0.476s / FAILED (failures=1) (exit 1)

AI-assisted: yes (Antigravity -- Gemini 4 Neon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7369885208 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3283#issuecomment-7369885208). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-03T06:29:00Z. --- **Windows native verification (`red -> green`) -- PASS** on head `a597be7b5` (merged cleanly via `git merge --no-ff` onto `main` `d9b618f10`). ### Checks (Windows 10 x64, Python 3.12, PowerShell 5.1) - `python -I scripts/check_no_game_data.py` -> **PASS** - **Green:** - `python -I tests/test_build_nvidia_exit.py -v` -> **Ran 1 test in 0.775s / OK** - **Red** (reverted `d3d12/scripts/build-nvidia.ps1` to `main` `d9b618f10`, keeping the PR's tests): - `tests/test_build_nvidia_exit.py` -> **Ran 1 test in 0.476s / FAILED (failures=1)** (exit `1`) AI-assisted: yes (Antigravity -- Gemini 4 Neon).
aegish-zagi commented 2026-12-03 14:40:44 +00:00 (Migrated from github.com)

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)

  • PR: #3283 | head a597be7b | merge with current main 128579e9e: clean (ort merge, no conflicts)
  • Tests run: python3 -I tests/test_build_nvidia_exit.py
  • Result here: OK (skipped=1) on both the merged PR tree and on main with the PR's test file — the test is @unittest.skipUnless(POWERSHELL, "requires PowerShell") and this Linux VM has no pwsh/powershell, so the red/green pair never executes here. I am not counting a skip as a pass.
  • Diff audit: one line in d3d12/scripts/build-nvidia.ps1 plus the new test. The test itself is well-formed for a PowerShell host: it stubs cargo with 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.
  • Platform: Linux, Python 3.12.3, Profile Z (no GPU, no PowerShell)

AI-assisted: yes (Muse Wonder, Muse by Meta)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7381847230 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3283#issuecomment-7381847230). Originally posted by [aegish-zagi](https://github.com/aegish-zagi) on 2026-12-03T14:40:44Z. --- VERIFY-3283 — NOT VERIFIED on this platform (test skips; audit only) - PR: #3283 | head `a597be7b` | merge with current main `128579e9e`: clean (ort merge, no conflicts) - Tests run: `python3 -I tests/test_build_nvidia_exit.py` - Result here: OK (skipped=1) on both the merged PR tree and on main with the PR's test file — the test is `@unittest.skipUnless(POWERSHELL, "requires PowerShell")` and this Linux VM has no `pwsh`/`powershell`, so the red/green pair never executes here. I am not counting a skip as a pass. - Diff audit: one line in `d3d12/scripts/build-nvidia.ps1` plus the new test. The test itself is well-formed for a PowerShell host: it stubs `cargo` with 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. - Platform: Linux, Python 3.12.3, Profile Z (no GPU, no PowerShell) AI-assisted: yes (Muse Wonder, Muse by Meta)
merzleckeier commented 2026-12-03 14:43:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T14:43:06Z.


I ran the skipped test on current 128579e9 using PowerShell 7.6.6 on Linux. With the new test on main, the stub returned 7 and build-nvidia.ps1 returned 0. Both subcases passed on #3283 a597be7b (tree 25e0f866) and with #3342 6c8e856d stacked on top (clean merge, tree f5169051).

In the stack I also exercised the CARGO_HOME fallback with stale PATH, 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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7381912285 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3283#issuecomment-7381912285). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T14:43:06Z. --- I ran the skipped test on current `128579e9` using PowerShell 7.6.6 on Linux. With the new test on main, the stub returned 7 and `build-nvidia.ps1` returned 0. Both subcases passed on #3283 `a597be7b` (tree `25e0f866`) and with #3342 `6c8e856d` stacked on top (clean merge, tree `f5169051`). In the stack I also exercised the `CARGO_HOME` fallback with stale `PATH`, 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).
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
ProjectLeonida/mandy!3283
No description provided.