mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #2066] build: find a Preview or Insiders Visual Studio when no stable one has the C++ tools (BUILD-VSWHERE-PRERELEASE) #2072
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2072
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2066
Author: @c0pperlane
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:vswhere-prerelease📝 Commits (1)
34ea846build: find a Preview or Insiders Visual Studio when no stable one has the C++ tools (BUILD-VSWHERE-PRERELEASE)📊 Changes
7 files changed (+162 additions, -10 deletions)
View changed files
📝
make_game.py(+11 -7)📝
scripts/build_llvm_mc.ps1(+2 -0)📝
scripts/build_runtime.ps1(+2 -0)➕
tests/test_build_vs_lookup.py(+93 -0)📝
tests/test_hw_oracle.py(+31 -0)📝
tests/test_make_game_preflight.py(+16 -0)📝
tools/hw_oracle/runner.py(+7 -3)📄 Description
Claimed in the coordination issue as: BUILD-VSWHERE-PRERELEASE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7171910784)
Depends on: #1871 (conflicts: both change the vswhere lookup in scripts/build_llvm_mc.ps1; whichever lands second writes the fallback as
if (-not $vs) { $vs = & $vswhere -latest -prerelease ... })What and why
vswhere lists a Preview or Insiders install only when asked with
-prerelease, so a machine whose only Visual Studio is a prerelease build was told it had no C++ x64 tools (finding). Four lookups had this:scripts/build_llvm_mc.ps1,scripts/build_runtime.ps1,make_game.py(visual_cpp_tools_ok, the runtime preflight) andtools/hw_oracle/runner.py(find_vcvars). Each now does what.github/workflows/runtime.ymlalready does: a stable lookup first, then-prereleaseonly when that returns nothing. A machine with both keeps its stable install (-latest -prereleasealone would let a newer Preview win).git grep -i vswherefinds no other call (Build.bat, Mods.bat and the other scripts have none).Tests:
tests/test_build_vs_lookup.py(new) runs each script's lookup as written against a stubvswhere.exebuilt with the .NET Framework C# compiler (astest_build_runtime_cmake.pybuilds its recorder). Cases: prerelease only, stable and prerelease, neither.tests/test_make_game_preflight.pyandtests/test_hw_oracle.pystubsubprocess.runfor the same cases.Tested
Windows 11 Pro (10.0.26300), Python 3.12.10, rebased on main at
e48ff037. Each new test fails on main and passes with this change:python -I tests/test_build_vs_lookup.py: on main FAILED (4 subtests: "Visual Studio with the C++ x64 tools wasn't found." for both scripts); with the change OKpython -I tests/test_hw_oracle.py Unavailable.test_vcvars_of_a_prerelease_visual_studio: on main FAILED (None); with the change OKpython -I tests/test_make_game_preflight.py PreflightPrerequisiteTest.test_visual_cpp_tools_accepts_a_prerelease_installation: on main FAILED (False); with the change OKFull files with the change, all OK: test_build_vs_lookup (1), test_hw_oracle (60, 3 skipped), test_make_game_preflight (99, 2 skipped), test_build_llvm_mc_batch (1), test_build_runtime_batch (1), test_build_runtime_cmake (1), test_build_runtime_fallback (10), test_build_percent_path (3), test_text_write_line_endings (3), test_make_game_platform (46, 2 skipped), test_make_game_dry_run (24), test_make_game_pipeline_preflight (20, 1 skipped).
python -m compileall -q make_game.py tools tests,python -I make_game.py --helpandpython -I scripts/check_no_game_data.pyon every changed file: exit 0. The two .ps1 files keep CRLF (git ls-files --eol).Not tested on a machine with only a prerelease Visual Studio (vswhere is stubbed in every test); the finding's author confirmed
-prereleasefinds an Insiders install.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.