[PR #1484] build_runtime: link user32 into vk_sandbox in the cl.exe fallback (BUILD-FALLBACK-SANDBOX-USER32) #1514

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1484
Author: @kawaii-shakal
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: build-fallback-sandbox-user32


📝 Commits (3)

  • 9336540 build_runtime: link user32 into vk_sandbox in the cl.exe fallback (BUILD-FALLBACK-SANDBOX-USER32)
  • becc491 Merge remote-tracking branch 'origin/main' into build-fallback-sandbox-user32
  • 5c79445 Merge upstream main into build-fallback-sandbox-user32

📊 Changes

2 files changed (+18 additions, -1 deletions)

View changed files

📝 scripts/build_runtime.ps1 (+1 -1)
📝 tests/test_build_runtime_fallback.py (+17 -0)

📄 Description

Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7149457522 (BUILD-FALLBACK-SANDBOX-USER32)

What and why

scripts/build_runtime.ps1 has a fallback for machines without CMake and Ninja: it builds each program with its own cl line. CMake's Visual Studio and Ninja generators link the standard Windows libraries into every program (CMAKE_CXX_STANDARD_LIBRARIES: kernel32, user32, gdi32, ...). A plain cl line links none of them.

vk_sandbox opens a window, so its fallback link failed with 14 unresolved __imp_* symbols (CreateWindowExW, PeekMessageW, RegisterClassW, GetAsyncKeyState, ...). build_runtime.ps1 then exited 1, and so did make_game.py --stages ...,runtime, which calls it.

  • scripts/build_runtime.ps1: /link user32.lib on the vk_sandbox line.
  • tests/test_build_runtime_fallback.py: new test_a_program_that_opens_a_window_links_user32. It checks every fallback cl line whose test source calls the window API and requires user32.lib on it. Without the fix it fails on vk_sandbox.cpp.

Tested

  • python -I tests/test_build_runtime_fallback.py: 11 of 11 pass. The new test fails without the script change.
  • I ran the fallback for real through make_game.py --stages check,shaders,runtime, on a machine with VS 2026 and the Vulkan SDK but no Ninja. That run used a checkout of a28927849 with the same one-line change, because that is the commit my translated shaders came from; the vk_sandbox line is identical on current main. Before the change it failed with the LNK2019 / LNK1120 above. After it, every fallback program built, including vk_sandbox.exe, and the stage finished in 46 s.
  • Environment: Windows 11 Pro 26300, MSVC 19.50, Vulkan SDK from VULKAN_SDK, native (no WSL).

AI-assisted: yes (Claude Code, Claude Opus 5.5).

🤖 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/1484 **Author:** [@kawaii-shakal](https://github.com/kawaii-shakal) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `build-fallback-sandbox-user32` --- ### 📝 Commits (3) - [`9336540`](https://github.com/ubiquitarianism/leonida/commit/9336540a5b2ee852360a6be3f753a72c4202b7d6) build_runtime: link user32 into vk_sandbox in the cl.exe fallback (BUILD-FALLBACK-SANDBOX-USER32) - [`becc491`](https://github.com/ubiquitarianism/leonida/commit/becc4918809abd06b9808a1ac8bad3896ffe6f4d) Merge remote-tracking branch 'origin/main' into build-fallback-sandbox-user32 - [`5c79445`](https://github.com/ubiquitarianism/leonida/commit/5c79445cc4399935534362e8cd482cdd58a6deb7) Merge upstream main into build-fallback-sandbox-user32 ### 📊 Changes **2 files changed** (+18 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `scripts/build_runtime.ps1` (+1 -1) 📝 `tests/test_build_runtime_fallback.py` (+17 -0) </details> ### 📄 Description Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7149457522 (BUILD-FALLBACK-SANDBOX-USER32) ### What and why `scripts/build_runtime.ps1` has a fallback for machines without CMake and Ninja: it builds each program with its own `cl` line. CMake's Visual Studio and Ninja generators link the standard Windows libraries into every program (`CMAKE_CXX_STANDARD_LIBRARIES`: kernel32, user32, gdi32, ...). A plain `cl` line links none of them. `vk_sandbox` opens a window, so its fallback link failed with 14 unresolved `__imp_*` symbols (`CreateWindowExW`, `PeekMessageW`, `RegisterClassW`, `GetAsyncKeyState`, ...). `build_runtime.ps1` then exited 1, and so did `make_game.py --stages ...,runtime`, which calls it. - `scripts/build_runtime.ps1`: `/link user32.lib` on the `vk_sandbox` line. - `tests/test_build_runtime_fallback.py`: new `test_a_program_that_opens_a_window_links_user32`. It checks every fallback `cl` line whose test source calls the window API and requires `user32.lib` on it. Without the fix it fails on `vk_sandbox.cpp`. ### Tested - `python -I tests/test_build_runtime_fallback.py`: 11 of 11 pass. The new test fails without the script change. - I ran the fallback for real through `make_game.py --stages check,shaders,runtime`, on a machine with VS 2026 and the Vulkan SDK but no Ninja. That run used a checkout of `a28927849` with the same one-line change, because that is the commit my translated shaders came from; the `vk_sandbox` line is identical on current main. Before the change it failed with the LNK2019 / LNK1120 above. After it, every fallback program built, including `vk_sandbox.exe`, and the stage finished in 46 s. - Environment: Windows 11 Pro 26300, MSVC 19.50, Vulkan SDK from `VULKAN_SDK`, native (no WSL). AI-assisted: yes (Claude Code, Claude Opus 5.5). 🤖 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#1514
No description provided.