conformance build.ps1: find Visual Studio's CMake and name no Visual Studio version #229

Closed
Andretuta wants to merge 2 commits from upstream-pr/229 into main
Andretuta commented 2026-11-24 02:49:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:49:02Z.


Carried over from old PR 9962 by leeahmy in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9962, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
leeahmy: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116616512

What and why

tools/conformance/native/scripts/build.ps1 fails on a PC with only Visual Studio Build Tools:

  • It takes CMake from PATH or C:\Program Files\CMake only, so without either it ends with The term 'C:\Program Files\CMake\bin\cmake.exe' is not recognized, although Visual Studio includes CMake. Found by evilclanker9000: https://github.com/ProjectLeonida/Leonida/issues/9401#issuecomment-7114627674
  • It always asks for Visual Studio 17 2022, which fails where only Visual Studio 2026 is installed.

The script now looks for CMake in the order scripts/build_runtime.ps1 does (Visual Studio's through vswhere, then one on PATH with Visual Studio generators), then in %ProgramFiles%\CMake. It passes no -G, so CMake takes the newest Visual Studio it knows. CMAKE_GENERATOR is unset for the configure, because -G used to override it. With no CMake at all it prints one line and exits 1.

Behaviour change: Visual Studio's CMake is now preferred to one on PATH. negative-control.ps1 has the same lookup and generator and is not changed here.

Tested

Windows 11 (10.0.26200), Visual Studio 2026 Build Tools (CMake 4.1.2), Windows PowerShell 5.1, no CMake on PATH, NVIDIA GeForce RTX 5080 (610.88 / 32.0.16.1088), main 2d53a8055. AMD was not run.

  • The script builds conform_native with the Visual Studio 18 2026 generator, exit 0, and the result passes 36 of 36 checks (18 readback, 18 PNG). main's script exits 1 before it configures.
  • The same with CMAKE_GENERATOR=Ninja set, in a clean folder and in an existing build folder.
  • Also run for real: a checkout path with spaces, brackets and non-ASCII characters; from another folder; CMake on PATH with no vswhere; no CMake at all (one line, exit 1); a compile error and a configure error (exit 1). CMAKE_GENERATOR is restored in the calling session.
  • Commit 42e44cf08 merged onto main d083a2cc3 (clean merge): the script builds, 36 of 36 checks pass, and the new test (5 of 5), test_conformance_run_script.py (7 of 7) and, with the executable this script built, test_conformance_native_paths.py (7 of 7) pass.
  • New tests/test_conformance_build_script.py: 5 of 5. It runs a copy of the script with stand-ins for CMake and builds nothing. Control: with main's script, all 5 fail.
  • All 460 standalone tests/test_*.py on 2d53a8055: the same 28 fail as on main, none new. The pytest-only files were not run.
  • check_no_game_data.py, compileall and git diff --check are clean.
  • Not run: a PC with Visual Studio 2022, PowerShell 7, and scripts/verify.ps1 (it expects the author's adapters).

AI-assisted: yes (Claude Code)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: no translator rule.)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465142668 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/229). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:49:02Z. --- > Carried over from **old PR 9962** by `leeahmy` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9962`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `leeahmy`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116616512 ### What and why `tools/conformance/native/scripts/build.ps1` fails on a PC with only Visual Studio Build Tools: - It takes CMake from `PATH` or `C:\Program Files\CMake` only, so without either it ends with `The term 'C:\Program Files\CMake\bin\cmake.exe' is not recognized`, although Visual Studio includes CMake. Found by evilclanker9000: https://github.com/ProjectLeonida/Leonida/issues/9401#issuecomment-7114627674 - It always asks for `Visual Studio 17 2022`, which fails where only Visual Studio 2026 is installed. The script now looks for CMake in the order `scripts/build_runtime.ps1` does (Visual Studio's through `vswhere`, then one on `PATH` with Visual Studio generators), then in `%ProgramFiles%\CMake`. It passes no `-G`, so CMake takes the newest Visual Studio it knows. `CMAKE_GENERATOR` is unset for the configure, because `-G` used to override it. With no CMake at all it prints one line and exits 1. Behaviour change: Visual Studio's CMake is now preferred to one on `PATH`. `negative-control.ps1` has the same lookup and generator and is not changed here. ### Tested Windows 11 (10.0.26200), Visual Studio 2026 Build Tools (CMake 4.1.2), Windows PowerShell 5.1, no CMake on `PATH`, NVIDIA GeForce RTX 5080 (610.88 / 32.0.16.1088), `main` `2d53a8055`. AMD was not run. - The script builds `conform_native` with the `Visual Studio 18 2026` generator, exit 0, and the result passes 36 of 36 checks (18 readback, 18 PNG). `main`'s script exits 1 before it configures. - The same with `CMAKE_GENERATOR=Ninja` set, in a clean folder and in an existing build folder. - Also run for real: a checkout path with spaces, brackets and non-ASCII characters; from another folder; CMake on `PATH` with no `vswhere`; no CMake at all (one line, exit 1); a compile error and a configure error (exit 1). `CMAKE_GENERATOR` is restored in the calling session. - Commit `42e44cf08` merged onto `main` `d083a2cc3` (clean merge): the script builds, 36 of 36 checks pass, and the new test (5 of 5), `test_conformance_run_script.py` (7 of 7) and, with the executable this script built, `test_conformance_native_paths.py` (7 of 7) pass. - New `tests/test_conformance_build_script.py`: 5 of 5. It runs a copy of the script with stand-ins for CMake and builds nothing. Control: with `main`'s script, all 5 fail. - All 460 standalone `tests/test_*.py` on `2d53a8055`: the same 28 fail as on `main`, none new. The pytest-only files were not run. - `check_no_game_data.py`, `compileall` and `git diff --check` are clean. - Not run: a PC with Visual Studio 2022, PowerShell 7, and `scripts/verify.ps1` (it expects the author's adapters). AI-assisted: yes (Claude Code) ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (Not applicable: no translator rule.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MoonEyes commented 2026-11-27 19:43:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T19:43:13Z.


Thanks a lot for carrying this over, @Andretuta. The same change is open in #1822, rebased on current main with the commits by leeahmy (old PR 9962) kept: build.ps1 and tests/test_conformance_build_script.py change in the same way, line for line.

I am closing this draft to keep the queue clear. Please continue the discussion in #1822, or reopen this one if something is missing there.

AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226804416 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/229#issuecomment-7226804416). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T19:43:13Z. --- Thanks a lot for carrying this over, @Andretuta. The same change is open in #1822, rebased on current `main` with the commits by `leeahmy` (old PR 9962) kept: `build.ps1` and `tests/test_conformance_build_script.py` change in the same way, line for line. I am closing this draft to keep the queue clear. Please continue the discussion in #1822, or reopen this one if something is missing there. AI-assisted (Claude Code, Claude Opus 5.5)

Pull request closed

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!229
No description provided.