Skip to content

ci(rocq): pre-cppo plugin sources to bypass dune multiple-rules error#42

Open
alpaylan wants to merge 4 commits into
fix-canary-rolloutfrom
rocq-precompile-cppo
Open

ci(rocq): pre-cppo plugin sources to bypass dune multiple-rules error#42
alpaylan wants to merge 4 commits into
fix-canary-rolloutfrom
rocq-precompile-cppo

Conversation

@alpaylan
Copy link
Copy Markdown
Owner

Summary

QuickChick's plugin/dune declares (rule (targets X.ml) (deps X.ml.cppo)) for several modules. With (modules :standard) in the same stanza, dune (2.x and 3.x both) considers both the .ml.cppo source AND the rule output as candidates for X.ml, then bails with Multiple rules generated for ..._build/.../X.ml: file present in source tree, plugin/dune:31. Earlier attempts (build-dir purge, cache invalidation, dune 2.9.3 pin) all failed.

This PR pre-runs cppo on all .cppo files in plugin/ and rewrites plugin/dune from scratch — drops the cppo rules, keeps only the four coqpp .mlg → .ml rules and the void_for_linking write-file rule. Cache key bumped v3 → v4 to invalidate any poisoned ~/.opam from prior failed runs.

Test plan

  • Push merges → trigger workflow_dispatch on etna-rocq-bst
  • Verify coq-quickchick installs without "Multiple rules" error
  • Verify experiment runs and publishes to etna-bst-rocq.pages.dev

alpaylan and others added 4 commits May 1, 2026 19:38
QuickChick's plugin/dune declares (rule (targets X.ml) (deps X.ml.cppo))
for several modules. With (modules :standard) in the same stanza, dune
considers both the .ml.cppo source AND the rule output as candidates for
X.ml — fails with "Multiple rules generated for ..._build/.../X.ml: file
present in source tree, plugin/dune:31".

Pre-running cppo and rewriting plugin/dune from scratch (drop cppo rules,
keep the four coqpp rules) eliminates the conflict. Bump cache key v3→v4
to invalidate poisoned ~/.opam from prior failed runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Surfaced after the cppo fix unblocked the QuickChick build —
coq-simple-io.1.11.0 fails on coq.8.18 + dune 3.x with:

  Error: Can't find file coqsimpleio_plugin.cmxs on loadpath.

The plugin built by simple-io's own dune isn't visible on coqc's
loadpath when SimpleIO_Plugin.v compiles. 1.10.0 (older layout)
installs cleanly. quickchick depends on simple-io so we pre-install
1.10.0 before pulling quickchick.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Surfaced after the simple-io pin unblocked installation —
opam's coq-quickchick build runs `make compat` (a Makefile target
in the property-language tree) which lists plugin/depDriver.ml etc.
as deps via a pattern rule `%: %.cppo`. Deleting the .cppo source
breaks make's dep resolution:

  make: *** No rule to make target 'plugin/depDriver.ml',
  needed by 'compat'. Stop.

Keep both forms — the .ml is what dune compiles (no cppo rule
in our rewritten plugin/dune), and the .cppo placates make.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.10.0 succeeds in isolation locally (coq.8.18 + cppo only) but
fails on CI under the full opam stack (coq-elpi + mathcomp + etc.):
  Error: Can't find file coqsimpleio_plugin.cmxs on loadpath.

Try 1.9.0 — known to predate the dune-layout regression.
@alpaylan alpaylan force-pushed the rocq-precompile-cppo branch from 4d9b4c9 to 389f882 Compare May 1, 2026 23:52
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