Skip to content

Commit af7c38c

Browse files
hyperpolymathclaude
andcommitted
fix(ci): make the Coq gate actually run in the pinned container
First CI run failed with `coqc: not found`. Two distinct causes, both reproduced locally against the digest-pinned image with podman: 1. The coqorg images install Coq into an opam switch owned by the `coq` user and put it on PATH via an ENTRYPOINT wrapper. GitHub Actions overrides the entrypoint for job containers, so the wrapper never runs and `coqc` is not on PATH. Now resolved explicitly, globbed rather than hard-coded so an image bump cannot silently break it, and failing loudly if it cannot be found. 2. GitHub fell back to `sh -e {0}` (dash) rather than bash, which rejects `set -o pipefail` and the bash-only string operations the gate uses. The image does ship bash 5.2, so the shell is now declared explicitly instead of depending on the runner's detection. Verified by running the gate's exact logic inside the pinned image under bash: prover 8.20.1, 20/20 proofs checked, completeness guard passes, no axioms. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 11b5e8a commit af7c38c

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/coq-proof-gate.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ jobs:
2828
coq-proofs:
2929
runs-on: ubuntu-latest
3030
timeout-minutes: 30
31+
# The image ships bash 5.2, but GitHub fell back to `sh -e {0}` (dash) on
32+
# the first run, which rejects `set -o pipefail` and the bash-only string
33+
# operations below. Declare the shell explicitly rather than depending on
34+
# the runner's detection.
35+
defaults:
36+
run:
37+
shell: bash
3138
container:
3239
# coqorg/coq:8.20 — pinned by digest. `formal/README.adoc` documents 8.18;
3340
# the corpus was verified to check clean on 8.20.1 (deprecation warnings
@@ -37,6 +44,23 @@ jobs:
3744
steps:
3845
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3946

47+
# The coqorg images install Coq into an opam switch owned by the `coq`
48+
# user and put it on PATH via an ENTRYPOINT wrapper. GitHub Actions
49+
# overrides the entrypoint for job containers, so that wrapper never
50+
# runs and `coqc` is not on PATH — the switch has to be added by hand.
51+
# Globbed rather than hard-coded so an image bump does not silently
52+
# break the gate; fails loudly if the switch cannot be located.
53+
- name: Put the image's opam switch on PATH
54+
run: |
55+
set -euo pipefail
56+
sw="$(ls -d /home/coq/.opam/*/bin 2>/dev/null | head -1 || true)"
57+
if [ -z "$sw" ] || [ ! -x "$sw/coqc" ]; then
58+
echo "::error::could not locate coqc in the image's opam switch"
59+
exit 1
60+
fi
61+
echo "$sw" >> "$GITHUB_PATH"
62+
echo "added $sw to PATH"
63+
4064
- name: Record prover version
4165
run: coqc --version
4266

0 commit comments

Comments
 (0)