… (scripts/build-windows.sh)
serve's child backends start with CreateProcess in a kill-on-close job object
on Windows (the Linux PR_SET_PDEATHSIG), free_port uses Winsock, 1bit comfy
spawns and waits. Model and safetensors files map through npu/file_map.{h,cpp}
(mmap / CreateFileMapping). httplib: Windows 10 API level, non-blocking
getaddrinfo off (MinGW lacks GetAddrInfoExCancel); MinGW links statically.
scripts/build-windows.sh fetches pinned, checksummed llvm-mingw, PCRE2,
Vulkan-Headers, the loader's vulkan-1.def and SPIRV-Headers, then builds
1bit.exe and llama-server.exe from the Vulkan pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/build-windows.sh <out-dir>cross-builds the engine for Windows 10+ x64 on Linux. It produces two single static executables:1bit.exe(serve with Vulkan, route, comfy) andllama-server.exebuilt from the Vulkan pin.1bit.exefindsllama-server.exebeside it. Seedocs/windows.md.Code changes
app/serve.cpp:CreateProcessinside a kill-on-close job object, so they die with1bit.exefor any reason; this is Windows' counterpart toPR_SET_PDEATHSIG.free_portuses Winsock, and signals go throughstd::signal.npu/file_map.{h,cpp}: one read-only file mapping (mmap /CreateFileMapping) fornpu/model.cppandlaya/safetensors.cpp.app/main.cpp:1bit comfyspawns and waits on Windows.CMakeLists.txt:GetAddrInfoExCancel, and the engine only connects to 127.0.0.1);The script fetches pinned, sha256-checked inputs: llvm-mingw (clang 23: the engine is C++26), PCRE2 10.48, Vulkan-Headers, the Vulkan loader's
vulkan-1.def(turned into the import library withllvm-dlltool, so no Vulkan SDK or Windows machine is needed) and SPIRV-Headers. The pinned llama.cpp usesstd::functionwithout<functional>inggml-vulkan-types.h, which libc++ does not include transitively, so the script force-includes it.Tested on Strix Halo under Wine 11, on the real Radeon 8060S via winevulkan and RADV, from a clean clone:
1bit.exe serve -m Qwen3-0.6B-Q4_K_M.gguf, with no--llama-server, foundllama-server.exebeside it, answered "The capital of France is Paris." at 132 tok/s, and streamed SSE.taskkill /F /IM 1bit.exeleft no backend running.smoke_serveincluded.🤖 Generated with Claude Code