@@ -164,17 +164,29 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
164164# Initialise opam (no sandbox inside container — use --disable-sandboxing)
165165RUN opam init --disable-sandboxing --bare --no-setup -y
166166
167- # Install proverif via opam.
168- # proverif 2.x requires OCaml >= 4.05; bookworm ships OCaml 4.13.
169- RUN opam switch create default --packages=ocaml-base-compiler \
167+ # Install proverif via opam. Pin a known proverif-compatible OCaml (4.14.1)
168+ # and refresh the opam repo first — the prior `--packages=ocaml-base-compiler`
169+ # (unpinned) produced "no solution found" against bookworm's stale default
170+ # repo snapshot. proverif 2.x requires OCaml >= 4.05.
171+ RUN opam switch create default ocaml-base-compiler.4.14.1 \
170172 && eval "$(opam env)" \
173+ && opam update -y \
171174 && opam install -y proverif \
172175 && proverif -help 2>&1 | head -5 || true
173176
174- # Copy binary to a well-known location for the runtime stage
175- RUN eval "$(opam env)" && \
176- PROVERIF_BIN="$(opam var bin)/proverif" && \
177- install -m 0755 "${PROVERIF_BIN}" /usr/local/bin/proverif
177+ # Copy binary to a well-known location for the runtime stage. Graceful
178+ # degradation (matches the tamarin/imandra pattern): if the opam solve still
179+ # failed, emit a stub so the image still builds rather than hard-failing.
180+ RUN set -eux; eval "$(opam env)" || true; \
181+ PROVERIF_BIN="$(opam var bin 2>/dev/null)/proverif"; \
182+ if [ -x "${PROVERIF_BIN}" ]; then \
183+ install -m 0755 "${PROVERIF_BIN}" /usr/local/bin/proverif; \
184+ else \
185+ echo "WARNING: proverif opam install failed — emitting stub (image ships, backend degraded)"; \
186+ printf '#!/bin/sh\necho "proverif not available (opam solve failed at image build — see Containerfile.wave3)"\nexit 1\n' \
187+ > /usr/local/bin/proverif; \
188+ chmod +x /usr/local/bin/proverif; \
189+ fi
178190
179191FROM docker.io/library/debian:bookworm-slim AS proverif
180192
@@ -253,6 +265,20 @@ RUN set -eux; \
253265 chmod +x /usr/local/bin/scip; \
254266 }
255267
268+ # Normalise to a deterministic export tree so the runtime COPY never hard-fails
269+ # (the .deb installs scip at /usr/bin/scip; the failure-fallback stub lands at
270+ # /usr/local/bin/scip — the old runtime copied only /usr/bin/scip and broke the
271+ # whole image whenever the download failed). Mirrors the tamarin pattern.
272+ RUN set -eux; mkdir -p /opt/scip-export/bin /opt/scip-export/lib; \
273+ if [ -x /usr/bin/scip ]; then cp /usr/bin/scip /opt/scip-export/bin/scip; \
274+ elif [ -x /usr/local/bin/scip ]; then cp /usr/local/bin/scip /opt/scip-export/bin/scip; \
275+ else printf '#!/bin/sh\necho "scip not available (install failed at image build time)"\nexit 1\n' \
276+ > /opt/scip-export/bin/scip; fi; \
277+ chmod +x /opt/scip-export/bin/scip; \
278+ cp -a /usr/lib/x86_64-linux-gnu/libscip* /opt/scip-export/lib/ 2>/dev/null || true; \
279+ cp -a /usr/lib/x86_64-linux-gnu/libpapilo* /opt/scip-export/lib/ 2>/dev/null || true; \
280+ touch /opt/scip-export/lib/.keep
281+
256282FROM docker.io/library/debian:bookworm-slim AS scip
257283
258284LABEL maintainer="Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>"
@@ -275,11 +301,11 @@ WORKDIR /app
275301
276302COPY --from=rust-builder /build/target/release/echidna /app/bin/echidna
277303
278- # Copy the scip binary and shared libraries installed by the deb package.
279- # Typical install paths: /usr/bin/scip, /usr/lib/libscip.so.*
280- COPY --from=scip-installer /usr/bin/scip /usr/local/bin/scip
281- COPY --from=scip-installer /usr/lib/x86_64-linux-gnu/libscip* /usr/lib/x86_64-linux-gnu/
282- COPY --from=scip-installer /usr/lib/x86_64-linux-gnu/libpapilo* /usr/lib/x86_64-linux-gnu/
304+ # Copy from the deterministic export tree (always exists: real binary if the
305+ # .deb installed, stub otherwise; libs present or just a .keep). A directory
306+ # COPY never hard-fails on an empty glob, unlike the old per-file copies.
307+ COPY --from=scip-installer /opt/scip-export/bin/scip /usr/local/bin/scip
308+ COPY --from=scip-installer /opt/scip-export/lib/ /usr/lib/x86_64-linux-gnu/
283309
284310ENV PATH="/app/bin:/usr/local/bin:${PATH}"
285311ENV ECHIDNA_PROVER_PATH="/usr/local/bin"
@@ -343,14 +369,16 @@ LABEL org.opencontainers.image.licenses="PMPL-1.0-or-later"
343369LABEL org.opencontainers.image.version="2.3.0"
344370LABEL org.opencontainers.image.vendor="hyperpolymath"
345371
346- # OR-Tools runtime dependencies: abseil, protobuf, re2, zlib.
372+ # OR-Tools runtime deps. The OR-Tools prebuilt tarball bundles its own
373+ # abseil/protobuf/re2 shared libs (the installer copies them to /usr/local/lib
374+ # + ldconfig), so we do NOT install system libabsl/libprotobuf/libre2 — and
375+ # the old `libabsl20230125t64`/`libprotobuf32t64`/`libre2-10t64` names are
376+ # Ubuntu-24.04 / time_t-64 packages that DO NOT EXIST on debian bookworm
377+ # (that apt line could only ever fail). Keep only the genuinely-needed bits.
347378RUN apt-get update && apt-get install -y --no-install-recommends \
348379 ca-certificates \
349380 libssl3 \
350381 libgmp10 \
351- libabsl20230125t64 \
352- libprotobuf32t64 \
353- libre2-10t64 \
354382 zlib1g \
355383 && rm -rf /var/lib/apt/lists/*
356384
@@ -397,13 +425,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
397425WORKDIR /build/polyml
398426
399427# Download and build Poly/ML from source.
400- # Poly/ML 5.9.1 is the latest stable release known to work with HOL4.
428+ # Poly/ML 5.9.1 works with HOL4. Poly/ML does NOT publish a release *asset*
429+ # named polyml-<v>.tar.gz (the old releases/download URL 404'd) — use GitHub's
430+ # auto-generated source tarball for the tag (always present), with the
431+ # releases/download form as a fallback for any version that does ship one.
432+ # The archive tarball extracts to polyml-<version>/ → --strip-components=1.
401433ARG POLYML_VERSION="5.9.1"
402- RUN curl -fsSL --retry 3 \
403- "https://github.com/polyml/polyml/releases/download/v${POLYML_VERSION}/polyml-${POLYML_VERSION}.tar.gz" \
434+ RUN set -eux; \
435+ curl -fsSL --retry 3 \
436+ "https://github.com/polyml/polyml/archive/refs/tags/v${POLYML_VERSION}.tar.gz" \
404437 -o /tmp/polyml.tar.gz \
405- && tar -xzf /tmp/polyml.tar.gz -C /build/polyml --strip-components=1 \
406- && rm /tmp/polyml.tar.gz
438+ || curl -fsSL --retry 3 \
439+ "https://github.com/polyml/polyml/releases/download/v${POLYML_VERSION}/polyml-${POLYML_VERSION}.tar.gz" \
440+ -o /tmp/polyml.tar.gz; \
441+ tar -xzf /tmp/polyml.tar.gz -C /build/polyml --strip-components=1; \
442+ rm /tmp/polyml.tar.gz
407443
408444RUN ./configure --prefix=/opt/polyml \
409445 && make -j"$(nproc)" \
0 commit comments