Skip to content

Commit 55d333d

Browse files
hyperpolymathclaude
andcommitted
fix(wave3): repair 4 pre-existing per-backend installer bugs
Surfaced by actually building all 9 targets (5 passed: metamath, imandra, tamarin, twelf, acl2). The 4 failures were bugs inherited verbatim from the original Containerfiles (never build-verified): - hol4: Poly/ML `releases/download/v5.9.1/polyml-5.9.1.tar.gz` 404s — no such release asset. Use GitHub's tag archive tarball (always present), with the old URL as fallback. - or-tools: `libabsl20230125t64`/`libprotobuf32t64`/`libre2-10t64` are Ubuntu-24.04 / time_t-64 packages that do not exist on debian bookworm — the apt line could only ever fail. Dropped; the OR-Tools tarball already bundles those libs into /usr/local/lib (+ ldconfig). - scip: runtime copied only /usr/bin/scip, but the download-failure fallback stub lands at /usr/local/bin/scip → COPY hard-failed the whole image. Installer now assembles a deterministic /opt/scip-export tree (real or stub); runtime does a directory COPY (never fails on empty glob). Tamarin pattern. - proverif: unpinned ocaml-base-compiler → opam "no solution found". Pin ocaml-base-compiler.4.14.1 + `opam update`; final copy degrades to a stub if the solve still fails (tamarin/imandra pattern) so the image still ships. All fixes are at-source and consistent with the repo's established graceful-degradation intent; none blind-guesses network/distro specifics. Refs #53. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6453b79 commit 55d333d

1 file changed

Lines changed: 57 additions & 21 deletions

File tree

.containerization/Containerfile.wave3

Lines changed: 57 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
165165
RUN 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

179191
FROM 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+
256282
FROM docker.io/library/debian:bookworm-slim AS scip
257283

258284
LABEL maintainer="Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>"
@@ -275,11 +301,11 @@ WORKDIR /app
275301

276302
COPY --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

284310
ENV PATH="/app/bin:/usr/local/bin:${PATH}"
285311
ENV ECHIDNA_PROVER_PATH="/usr/local/bin"
@@ -343,14 +369,16 @@ LABEL org.opencontainers.image.licenses="PMPL-1.0-or-later"
343369
LABEL org.opencontainers.image.version="2.3.0"
344370
LABEL 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.
347378
RUN 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 \
397425
WORKDIR /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.
401433
ARG 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

408444
RUN ./configure --prefix=/opt/polyml \
409445
&& make -j"$(nproc)" \

0 commit comments

Comments
 (0)