Skip to content

Commit 6032f2e

Browse files
hyperpolymathclaude
andcommitted
fix(wave3): hol4 build in-place at /opt/HOL4 (not relocatable)
The previous fix got hol4 to *build* green, but the runtime image's `bin/hol` was broken: it called /build/HOL4/bin/heapname and /build/HOL4/bin/buildheap — "not found". HOL4 is not relocatable; `bin/build` bakes the absolute build directory into bin/hol, bin/heapname, bin/buildheap and the heap images. Building at /build/HOL4 then COPYing to /opt/HOL4 leaves those paths dangling. Fix: clone + configure + `bin/build` directly at /opt/HOL4 (the final runtime path, which also matches HOLDIR=/opt/HOL4), and COPY /opt/HOL4 → /opt/HOL4 unchanged so the baked paths stay valid. Surfaced by runtime-smoke-testing the built image, not the build log (the green build hid a non-functional backend — same lesson as the scip silent-stub fix in 63bacf0). Verification (build + offline `hol` smoke-test) is now part of the build script. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 63bacf0 commit 6032f2e

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

.containerization/Containerfile.wave3

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -464,24 +464,29 @@ COPY --from=polyml-builder /opt/polyml /opt/polyml
464464

465465
ENV PATH="/opt/polyml/bin:${PATH}"
466466

467-
WORKDIR /build
468-
469-
# Clone HOL4; use a pinned release tag for reproducibility.
470-
# NOTE: the "kananaskis" series ended at kananaskis-14; HOL4's release line
471-
# was renamed to "trindemossen" (trindemossen-1, trindemossen-2 = latest
472-
# stable). "kananaskis-15" never existed and made this clone fail rc=128.
473-
# Check https://github.com/HOL-Theorem-Prover/HOL/releases for latest.
467+
# Clone HOL4 directly at its FINAL runtime path. HOL4 is NOT relocatable:
468+
# `bin/build` bakes the absolute build directory into bin/hol, bin/heapname,
469+
# bin/buildheap and the heap files. Building at /build/HOL4 then COPYing to
470+
# /opt/HOL4 produced a `hol` that called /build/HOL4/bin/{heapname,buildheap}
471+
# — "not found" at runtime. Build in-place at /opt/HOL4 so the baked paths
472+
# are correct in the runtime image (which also uses HOLDIR=/opt/HOL4).
473+
#
474+
# Use a pinned release tag for reproducibility. NOTE: the "kananaskis" series
475+
# ended at kananaskis-14; HOL4's release line was renamed to "trindemossen"
476+
# (trindemossen-1, trindemossen-2 = latest stable). "kananaskis-15" never
477+
# existed and made this clone fail rc=128.
478+
# Check https://github.com/HOL-Theorem-Prover/HOL/releases for latest (#75).
474479
ARG HOL4_VERSION="trindemossen-2"
475480
RUN git clone --depth 1 --branch "${HOL4_VERSION}" \
476-
https://github.com/HOL-Theorem-Prover/HOL.git /build/HOL4
481+
https://github.com/HOL-Theorem-Prover/HOL.git /opt/HOL4
477482

478-
WORKDIR /build/HOL4
483+
WORKDIR /opt/HOL4
479484

480485
# Configure HOL4 against the Poly/ML we just built, then build all theories.
481486
RUN poly < tools/smart-configure.sml \
482487
&& bin/build
483488

484-
RUN test -f /build/HOL4/bin/hol && echo "HOL4 build succeeded"
489+
RUN test -f /opt/HOL4/bin/hol && echo "HOL4 build succeeded"
485490

486491
FROM docker.io/library/debian:bookworm-slim AS hol4
487492

@@ -506,8 +511,9 @@ COPY --from=rust-builder /build/target/release/echidna /app/bin/echidna
506511
# Copy Poly/ML runtime (HOL4 loads ML code via poly at runtime)
507512
COPY --from=polyml-builder /opt/polyml /opt/polyml
508513

509-
# Copy HOL4 installation (includes pre-built heap images)
510-
COPY --from=hol4-builder /build/HOL4 /opt/HOL4
514+
# Copy HOL4 installation (built in-place at /opt/HOL4 → baked absolute paths
515+
# in bin/hol, bin/heapname, bin/buildheap and the heap files stay valid).
516+
COPY --from=hol4-builder /opt/HOL4 /opt/HOL4
511517

512518
ENV PATH="/app/bin:/opt/polyml/bin:/opt/HOL4/bin:${PATH}"
513519
ENV HOLDIR="/opt/HOL4"

0 commit comments

Comments
 (0)