Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051# wardend build/test/verify images (the demit/nit pattern: in-tree, containerized).## Two targets:# --target base -> wardend:build (Rust stable 1.97.1: `cargo build` + host-test gate)# --target kani -> wardend:kani (base + Kani 0.68.0: the model-check proof gate)## The build/test gates use base (stable only); verify-kani uses kani.# `cargo kani` self-selects the pinned nightly it was built against (the# Kani installer sets RUSTUP_TOOLCHAIN for the driver, which it then uses# to compile the harnesses). Everything is pinned by version so the# images are reproducible.
FROM rust:1.97.1 AS base
# A few build deps the workspace and the Kani installer may need# (libssl for toolchain downloads, ca-certificates).RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates libssl-dev curl xz-utils unzip build-essential pkg-config \ && rm -rf /var/lib/apt/lists/*
RUN cargo --version && rustc --version
WORKDIR /src
# --- the Kani proof layer (only verify-kani needs it) ----------------------FROM base AS kani
ARG KANI_VERSION=0.68.0ENV KANI_VERSION=${KANI_VERSION}# The rust base image sets no HOME; the Kani installer writes to $HOME/.kani.ENV HOME=/root
# The installer exits 0 even when the download fails (the pipeline's last# command is `sh -s`, fed nothing by a failed curl, which exits 0).# Hard-check the artifact so a broken install fails the image build.RUN curl -fsSL https://model-checking.kani.rs/install-kani.sh \ | sh -s -- --version ${KANI_VERSION} \ && test -x ${HOME}/.kani/bin/cargo-kani \ || (echo "ERROR: kani install failed — no ${HOME}/.kani/bin/cargo-kani" \ && echo " If the cause is a TLS hostname mismatch, your DNS serves" \ && echo " model-checking.kani.rs from a host whose certificate does not" \ && echo " cover that hostname. Fix the cert SAN or the DNS split-horizon" \ && echo " entry, or run verify-kani-local (host Kani) as the interim." \ && exit 1)
ENV PATH="${HOME}/.kani/bin:/usr/local/cargo/bin:${PATH}"
# No fallback: if cargo kani is not on PATH the image is broken.RUN cargo --version && rustc --version && cargo kani --version