Files
leleka/deploy/Dockerfile.windows-build
T
Pavlo RatushnyiandClaude Sonnet 5.5 92cbffdfe8 feat: Windows runtime packaging: Docker cross-build, Start-Leleka launcher, zip packager, docs (STRA-220)
- deploy/Dockerfile.windows-build cross-compiles the six executables (mingw, no Visual Studio needed)
- control-plane/build.rs: the ggml link stubs are used for every Windows target, not only MSVC
- scripts/windows/Start-Leleka.ps1 (igpu | cpu | npu modes, speculation and cache slots on by default) and Package-Windows.ps1
- docs/windows-runtime.md; stale statements in docs/cpu-runtime.md corrected

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 13:30:37 +02:00

31 lines
1.7 KiB
Docker

# Cross-compiles the Windows (x86_64-pc-windows-gnu) runtime binaries in a Linux container, so no Visual Studio is
# needed on the build machine. Build context: the repository root.
# docker build -f deploy/Dockerfile.windows-build -o type=local,dest=dist/windows .
# The binaries are written to dist/windows (ignored by Git). The mingw runtime is linked statically; OpenVINO is
# still loaded at run time from a separately obtained install (see docs/windows-runtime.md).
FROM rust:1.99-bookworm AS build
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 cmake \
&& rm -rf /var/lib/apt/lists/* \
&& rustup target add x86_64-pc-windows-gnu
WORKDIR /src
COPY . .
# the repository pins its toolchain (rust-toolchain.toml); add the target to that one
RUN rustup target add x86_64-pc-windows-gnu
ENV CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc \
CC_x86_64_pc_windows_gnu=x86_64-w64-mingw32-gcc \
CXX_x86_64_pc_windows_gnu=x86_64-w64-mingw32-g++ \
AR_x86_64_pc_windows_gnu=x86_64-w64-mingw32-ar \
RUSTFLAGS="-C target-feature=+crt-static"
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/src/target \
cargo build --release --target x86_64-pc-windows-gnu \
-p strata-control -p leleka-cpu-worker -p leleka-igpu-worker -p leleka-npu-worker \
-p leleka-npu-service -p leleka-gpu-npu-worker \
&& mkdir /out \
&& for b in strata-next leleka-cpu-worker leleka-igpu-worker leleka-npu-worker leleka-npu-service leleka-gpu-npu-worker; do \
cp target/x86_64-pc-windows-gnu/release/$b.exe /out/; done
FROM scratch AS export
COPY --from=build /out/ /