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

Open
opened 2026-11-26 20:17:22 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/229
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9962


📝 Commits (2)

  • 42e44cf conformance build.ps1: find Visual Studio's CMake and name no Visual Studio version
  • 8368be1 test_conformance_build_script: pass with a non-ASCII temporary folder

📊 Changes

2 files changed (+153 additions, -3 deletions)

View changed files

➕ tests/test_conformance_build_script.py (+117 -0)
📝 tools/conformance/native/scripts/build.ps1 (+36 -3)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/229 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9962` --- ### 📝 Commits (2) - [`42e44cf`](https://github.com/ubiquitarianism/leonida/commit/42e44cf08d4b02b42c3ef000746819e9fac059de) conformance build.ps1: find Visual Studio's CMake and name no Visual Studio version - [`8368be1`](https://github.com/ubiquitarianism/leonida/commit/8368be1dd059fa50823aefcd4251609ab85e203e) test_conformance_build_script: pass with a non-ASCII temporary folder ### 📊 Changes **2 files changed** (+153 additions, -3 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_conformance_build_script.py` (+117 -0) 📝 `tools/conformance/native/scripts/build.ps1` (+36 -3) </details> ### 📄 Description > 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#282
No description provided.