feat(dev): dev_build.py on Windows too, with tools.lock's Windows build tools #1095
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1095
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:feat/dev-build-windows"
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?
Type: feat · Risk: low · Tested on: Windows 11, Ryzen 5 (Zen 2); Linux (python:3.12 container, game-free checks) · Needs: Linux, a real
dev_build.py env/vkrunWhy
scripts/dev_build.pyis how agents and people build on a shared PC (one base per main commit, packs, runtimes, all through the job queue), but it refused Windows outright, so on a Windows PC everyone fell back to hand-setdev_packs.pyandmake_game.pyruns with their own tool folders and stores, and no two checkouts shared a base. This makes the same commands work on Windows, with the build tools a player's Windows build uses.What changed
dev_build.pynow runs on Windows as well as Linux: the same commands, with Windows' folders, tools.lock'swindows-x64tools set as the Windows builder sets them, and a Windows check of the renderer. Linux behaves as before (the same folders, tools, Python, messages and checks).home,cache,own_dir,config_file):LONGSHOT_DEV_HOMEdefaults to%LOCALAPPDATA%\Longshot\dev, the stores todev_packs.py's Windows defaults (%LOCALAPPDATA%\Longshot\objects,lifts), the settings file is%APPDATA%\Longshot\dev_build.json(besidejob_queue.json), and a checkout's own files go inbuild-windows\(added to.gitignore). The tmpfs check is already a no-op on Windows (job_queue.on_ram).tools_lock_key,builder_dir,windows_toolchain,windows_tool_dirs): tools.lock's lines for this system. On Windowsscripts/tools.py install(in-process, under a lock, downloads intoLONGSHOT_DEV_HOME\builder\downloads) installs thewindows-x64set once per tools.lock, and the build getsLONGSHOT_MINGW,EMSDKandRX_CPMset to it, asbuilder/LongshotBuilder/Runner.csandmake_game.py bundled_mingwset them.LONGSHOT_DEV_DEPS(abuild-linux/depsfolder) stays Linux-only and is refused on Windows with a message.python_candidates,find_python): on Windows the build tools' ownpython\python.exe(which has capstone, unicorn, zstandard, numpy), unlessLONGSHOT_DEV_PYTHONnames another.windows_prebuilt):SDL2.dllandSDL3.dllfrom the tools'third_partyare copied into the tree a base, pack or build reads (third_party\sdl2) when they are not there, as the Windows builder's tools folder has them. Nothing in the repository builds them; git ignores*.dll, sodev_packs.pysees no change in the tree.cmd_vk,check_dll_exports):longshot_vk.dllon Windows. An undefined symbol already fails the link there, so instead ofnm -Dit checks with llvm-objdump (llvm-mingw's) that the DLL exportsmkwvk_init, whichhost/rx_backend.clooks up.--copy-tocopies the DLL.launcher_ngx_sdk,game_roots): the Longshot Launcher's NGX SDK at%LOCALAPPDATA%\LongshotLauncher\ngx-sdk(nvsdk_ngx_s.lib, itsLauncherHome.NgxSdk), and game folders in~\Gamesand~\Games\Longshot(the launcher's default builds folder).LONGSHOT_DEV_ROMFS/LONGSHOT_DEV_EXEFSand the config'sromfs/exefsare still the explicit way.BaseLock: msvcrt's lock on Windows (fcntl on Linux, as before).envprints PowerShell$env:lines on Windows (exportlines on Linux, as before).tests/test_dev_build.py(new): both systems' folders, tools.lock keys, tool variables againstRunner.csandtools.py REQUIRED, the Python, NGX, shell lines, the prebuilt copy, the export parser againsthost/rx_backend.c, and the base lock.docs/development.md, Sharing a PC: the job queue: a paragraph on Windows.Measurements
Nothing to measure: a development script and its tests, and the game is not touched.
Flags and settings
None (no new switch:
LONGSHOT_DEV_HOME,LONGSHOT_DEV_PYTHON,LONGSHOT_DEV_DEPS,LONGSHOT_DEV_ROMFSandLONGSHOT_DEV_EXEFSwere already there, and only their Windows defaults are new.LONGSHOT_MINGW,EMSDKandRX_CPMare the build's existing variables, whichdev_build.pynow sets on Windows as the Windows builder does).Testing
Tested:
dev-homeon D: (LONGSHOT_DEV_HOME=D:/HookshotDev/dev-home):python -I scripts/dev_build.py envinstalled tools.lock's five Windows tools (llvm-mingw, python, emsdk, cpm, third-party) in 52 s and printedLONGSHOT_MINGW,EMSDK,RX_CPMandPYpointing at them. A second run found them installed and printed the same.--jsonprinted the same.python -I scripts/dev_build.py vkthrough the job queue (alightjob, beside another agent's base build): it compiled the renderer's 207 files with the installed llvm-mingw and cpm (1109 s, 1 job at a time beside the other build), linkedbuild-windows\vk-work\sa\build\longshot_vk.dll(13 MB) and passed the export check (renderer: ... (symbols checked)). The same check on that DLL, asked for a name it does not export, fails withlongshot_vk.dll does not export mkwvk_nope: the game would find no renderer.tests/test_dev_build.pypasses on Windows and on Linux (python:3.12 container). The checks that read the changed files (run_all.py --changed, plustest_job_queue,test_tools_lock,test_linux_tools), run on this branch and on mainc167ec67: the same results on both. On Windowstest_vk_occlusion_queries,test_crash_dialogandtest_walk_keyfail on main too, andtest_job_queueandtest_linux_toolsneed fcntl. In the read-only Linux containertest_dev_packs,test_check_third_party,test_vk_occlusion_queriesandtest_walk_keyfail on main too (no git in a mounted worktree). Everything else passes.Not tested:
dev_build.py base,pack,rtandbuildon Windows: they rundev_packs.pyandmake_game.py, which already build on Windows, with this environment. A base would compile the whole game here: the PC's object store was filled with another tool folder, and the objects' flags hold its paths, so nothing would be taken from it. That is well over half an hour beside the timed runs on this PC.env/vk: only the game-free checks ran on Linux.Must be tested:
python -I scripts/dev_build.py envandpython -I scripts/dev_build.py vkin a checkout of this branch, expecting the same output and folders as on main (by hand: a Linux agent on a shared PC)Risks
What could break: Linux runs of
dev_build.pyif a path changed by mistake (the tests pin home, stores,build-linux/, the Python candidates, the tools.lock key and theexportlines to their old values). On Windows, a tree'sthird_party\sdl2gains the builder'sSDL2.dll/SDL3.dll, which git ignores.Turning it off: revert the commit.
Compatibility: Nothing changes for players: only a development script, its test,
.gitignoreand the docs.Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
WIP: feat(dev): dev_build.py on Windows too, with tools.lock's Windows build toolsto feat(dev): dev_build.py on Windows too, with tools.lock's Windows build toolsomgitsgela referenced this pull request2026-11-16 13:12:56 +00:00