Skip to content

Commit 7f6cb79

Browse files
fix(ci): repair the Coq gate on main — coqc not found (#711)
## Problem The Coq Proof Gate has been **failing on `main`** since `ed4e223` with `coqc: not found`. PR #709 merged the *pre-fix* revision of the workflow. The fix was already written and verified on the PR branch (`af7c38c`) but was not part of the squash, so `main` received the broken version. ## Causes (both reproduced locally against the digest-pinned image) 1. **Entrypoint override.** 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 that wrapper never runs. The switch is now added explicitly — *globbed* rather than hard-coded, so an image bump cannot silently break it, and failing loudly if it cannot be located. 2. **Shell fallback.** GitHub used `sh -e {0}` (dash), which rejects `set -o pipefail` and the bash-only string operations the gate relies on. The image ships bash 5.2, so the shell is now declared explicitly rather than left to runner detection. ## Verification Already proven green via `workflow_dispatch` on the branch: ``` added /home/coq/.opam/4.13.1+flambda/bin to PATH The Coq Proof Assistant, version 8.20.1 count=20 completeness guard: PASS OK: all proofs mechanised; no axioms. ``` All 11 steps succeeded. The same logic was also run locally inside the pinned container under podman before first push. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2 parents ed4e223 + 4676dc4 commit 7f6cb79

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)