Skip to content

Coq kernel: build check has never been green — opam root unreachable as root, plus wrong t27c path #2320

Closed

Description

@gHashTag

Summary

The build check on master is red. It belongs to .github/workflows/coq-kernel.yml (workflow Coq kernel, job build, step Install Flocq (opam)) — not to cli-tri.yml, whose own build check was repaired earlier today. Both workflows emit a check named build, and the check-runs API returns only the newest per name, so one masks the other.

Verbatim failure:

Install Flocq (opam)
[WARNING] Running as root is not recommended
[ERROR] Opam has not been initialised, please run `opam init'
##[error]Process completed with exit code 50.

This gate has never been green

All 12 runs on master concluded failure — run #3 (2026-04-06) through run #173 (2026-08-21). This is not a regression; the gate was added broken.

The failing step moved over time, which is why it can look like a regression:

Steps 5 through 9 of this job have never executed once in the workflow's life.

Cause 1 — opam root vs. --user root

The job runs in coqorg/coq:8.19-ocaml-4.14-flambda with options: --user root. That image ships a fully initialised opam root, but it is owned by the image's coq user at /home/coq/.opam. Running as root makes HOME=/root, so bare opam looks for /root/.opam, finds nothing, and exits 50.

Two later steps, Build coq/ (T27 + Flocq) and coqchk PhiFloat (consistency), both call eval $(opam env) and so depend on that same root and switch.

Fix: point the job at the image's real opam root with a job-level OPAMROOT: /home/coq/.opam.

Deliberately not opam init: a fresh root contains no Coq, so opam install coq-flocq would rebuild the entire compiler, and the coqc/coqchk already on PATH would still come from the image's other switch. Reusing the image's root also inherits its sandbox-disabled config, which is what --disable-sandboxing would otherwise be needed for.

No official setup action (ocaml/setup-ocaml, coq-community/docker-coq-action) is used anywhere in this repository, so there is no working in-repo configuration to copy.

Cause 2 — wrong binary path, statically provable

Because steps 5-9 have never run, the next failure is already latent. The step Build t27c and validate phi f64 parameters does:

cd bootstrap && cargo build --release
./target/release/t27c validate-phi

The root Cargo.toml is a workspace whose members include bootstrap, so cargo emits the binary into the workspace target directory at the repo root. The second line resolves against bootstrap/, i.e. bootstrap/target/release/t27c, which never exists — an exit 127 that reads like a compiler failure.

Fix: build and run from the repo root, cargo build --release -p t27c then ./target/release/t27c validate-phi.

Not in scope of the fix

Flocq is a hard dependency — coq/Kernel/PhiFloat.v carries From Flocq Require Import IEEE754.Binary. The step is not weakened: no || true, no continue-on-error, no dropped dependency.

Known sibling, not fixed here

.github/workflows/coq-proofs.yml (job compile-proofs, step Install Coq Interval) has the identical --user root + opam defect. Its check name is compile-proofs, so it masks nothing and is out of scope here; its paths: filter (proofs/trinity/**.v) means a change to it could not be verified by this PR's CI run anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions