# Build environment for qroissant.
#
# Base: ghcr.io/rust-cross/cargo-xwin — Debian 13, ships with cargo-xwin,
# llvm-dlltool, and the x86_64-pc-windows-msvc rustup target preinstalled.
# We layer on nightly Rust (project uses #![feature(portable_simd)]),
# lld (so cargo-xwin can invoke lld-link), and maturin.
FROM ghcr.io/rust-cross/cargo-xwin:latest

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
 && apt-get install -y --no-install-recommends lld python3-pip python3-venv \
 && rm -rf /var/lib/apt/lists/* \
 && ln -sf /usr/bin/lld /usr/bin/lld-link \
 && ln -sf /usr/bin/clang /usr/bin/clang-cl

RUN rustup toolchain install nightly --profile minimal \
        --component rustfmt --component clippy --component rust-src \
        --component llvm-tools-preview \
 && rustup target add --toolchain nightly x86_64-pc-windows-msvc \
 && rustup default nightly

RUN pip3 install --no-cache-dir --break-system-packages 'maturin>=1.8,<2.0'

ENV PATH="/usr/local/cargo/bin:${PATH}"
