Skip to content

Rocq --config Fix#14093

Open
Durbatuluk1701 wants to merge 3 commits intoocaml:mainfrom
Durbatuluk1701:rocq_config_fix
Open

Rocq --config Fix#14093
Durbatuluk1701 wants to merge 3 commits intoocaml:mainfrom
Durbatuluk1701:rocq_config_fix

Conversation

@Durbatuluk1701
Copy link
Copy Markdown
Contributor

Reflecting on the issue in #13774, I think a solution that is both forwards and backwards compatible is to just always use rocq c --config. This PR implements this change and allows compilation of rocq.theory stanzas for Rocq 9.0+.

Documentation in the Rocq CLI implies this will be recognized by compile/c and the message for this commit seems to imply that --config will need to access the environment regardless.

Maybe there is some reason to utilize just rocq --config (note: missing the c), but it is not immediately obvious to me.

It working with PR dune vs. failing previous version
$ rocq --version
The Rocq Prover, version 9.0.1
compiled with OCaml 5.3.0

$ cat theories/dune
(rocq.theory
 (name test_proj)
 (package test_proj)
 (theories Stdlib))

$ cat dune-project
(lang dune 3.22)
(using rocq 0.12)
(generate_opam_files)
(package
 (name test_proj)
 (depends rocq-core))

$ cat theories/Test.v
From Stdlib Require Import Nat.

Lemma test : forall (x : nat), x = x.
Proof.  reflexivity. Qed.

$ ~/forks/dune/_boot/dune.exe build

$ ~/forks/dune/_boot/dune.exe clean

$ dune build
Warning: Skipping installed theories due to 'rocq --config' failure:
- .../.opam/package_dev/bin/rocq --config failed with exit code 1.
Hint: Try running 'rocq --config' manually to see the error.
Couldn't find Rocq standard library, and theory is not using (stdlib no)
-> required by _build/default/theories/.test_proj.theory.d
-> required by alias theories/all
-> required by alias default
File "theories/dune", line 4, characters 11-17:
4 |  (theories Stdlib))
               ^^^^^^
Theory "Stdlib" has not been found.
-> required by theory test_proj in theories/dune:2
-> required by _build/default/theories/.test_proj.theory.d
-> required by alias theories/all
-> required by alias default

Signed-off-by: Will Thomas <30wthomas@gmail.com>
Signed-off-by: Will Thomas <30wthomas@gmail.com>
Copy link
Copy Markdown
Collaborator

@rlepigre-skylabs-ai rlepigre-skylabs-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a reasonable approach, although I would consider it inferior to falling back to rocq c --config if rocq --config fails (not sure how hard that would be to do). The current approach would make it harder for Rocq to remove the --config option from rocq c, which I think would make sense eventually (CLI flags are kind of a mess in Rocq). That being said, I'm fine if we want to simply merge this.


test-all: $(BIN)
$(BIN) build @runtest @runtest-js @runtest-rocq @runtest-melange
DUNE_ROCQ_TEST=enable $(BIN) build @runtest @runtest-js @runtest-rocq @runtest-melange
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't want this, right @Alizter?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think its fine. Otherwise the runtest-rocq alias will not build. We don't use test-all in CI anyway.

@Alizter
Copy link
Copy Markdown
Collaborator

Alizter commented Apr 9, 2026

@Durbatuluk1701 could you ask the Rocq maintainers on Zulip if they intend to change this flag in the future. That would probably give us the clearest path forward.

@Alizter Alizter added the rocq label Apr 9, 2026
@Durbatuluk1701
Copy link
Copy Markdown
Contributor Author

@Durbatuluk1701 could you ask the Rocq maintainers on Zulip if they intend to change this flag in the future. That would probably give us the clearest path forward.

Asked here

@Durbatuluk1701
Copy link
Copy Markdown
Contributor Author

The endorsed fix is:

Always check rocq c --config: it works with 9.0, and if is not planned to get deprecated may be forward and backwards compatible

Which I think should align with what this PR currently contributes

@Alizter
Copy link
Copy Markdown
Collaborator

Alizter commented Apr 9, 2026

Could you add a changelog entry?

Signed-off-by: Will Thomas <30wthomas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants