Skip to content

Make .depend generation atomic and fail on coqdep errors#862

Open
JasonGross wants to merge 2 commits into
PrincetonUniversity:masterfrom
JasonGross:atomic-depend-generation
Open

Make .depend generation atomic and fail on coqdep errors#862
JasonGross wants to merge 2 commits into
PrincetonUniversity:masterfrom
JasonGross:atomic-depend-generation

Conversation

@JasonGross

Copy link
Copy Markdown
Contributor

Some adjustments authored by Fable to make the coqdep step more robust, at the cost of making it less readable

JasonGross and others added 2 commits July 16, 2026 00:53
The main coqdep invocation was piped through grep with `|| true`, so a
coqdep that dies partway (e.g. killed under memory pressure, or hitting
a file-descriptor limit) silently left a truncated .depend; the
`.depend depend:` rule has no prerequisites, so later builds reuse the
poisoned file and parallel make compiles files before their
dependencies exist ("Unable to locate library ..." errors).

Write coqdep's output to a temporary file and move it into place only
on success.  coqdep's stderr is still filtered live through grep (its
real exit status, otherwise hidden behind grep in the pipe, is
recovered through a status file since this recipe runs under POSIX sh
without pipefail).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019ttctspSoVoquHLQtbPVZw
coqdep in current Rocq dev leaks one file descriptor per located
warning (fix proposed as rocq-prover/rocq#22278); over this tree's
thousands of module-not-found warnings it dies with "Too many open
files" under the common 1024 soft limit.  Raise the soft limit to the
hard limit for the coqdep invocation as a harmless workaround for
affected Rocq versions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019ttctspSoVoquHLQtbPVZw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant