Trying to support the rocq CLI.#815
Conversation
| (let ((coq-command (or coq-prog-name "coqtop")) | ||
| retv) | ||
| This function supports calling coqtop via tramp. | ||
| This function must not rely on coq-autodetect-version, it would be a cycle." |
There was a problem hiding this comment.
@hendriktews please check in particular that this is still correct.
ca9b36e to
08b4273
Compare
|
@erikmd @hendriktews I don't know how to do that but we should add a new version of coq/rocq (V9) in the CI. |
|
Thanks @Matafou !! Sorry, I have very little time this week :-/, but I'm willing to help if I can! Meanwhile, FYI (Cc @hendriktews) I've just released the rocq/rocq-prover:9.0.0 image: https://discourse.rocq-prover.org/t/docker-image-of-the-rocq-prover-rocq-rocq-prover-9-0/2545/2 |
|
I suspect this isn't ready to use just yet, and I'm just getting ahead of myself, but my attempts to pull this branch have resulted in the same issue as #811 where Happy to suffer and test this out, though, if that can be helpful :). One concern that I had was for switching between projects (If I have a Coq 8.20 project / branch and a Rocq 9.0 project / branch)... But it seems like these changes support that, which is great! |
|
@Matafou another problem I noticed --- I think currently there is no change to support |
|
Thanks for testing @Chobbes ! From what you say I need to look at at least 2 things I didn't yet:
|
|
Is anyone using _rocqproject? |
Not me. I guess the good practice must have exactly identical _coqProject and _rocqProject (wherever the capital letters should be :-)) |
I was trying to :).
I have them linked right now to get around these issues.
I'm not sure what the intended transition is here. I am trying to build Vellvm with the new Happy to do what little I can to help with this, though! Feel free to ping me when there's a new patch and I'll happily test it out while working on Vellvm :) |
|
Note that the name _CoqProject is just a convention as far as |
|
True. It is hardwired in PG that it should be named _coqproject modulo capitals. This name is still recommended in Rocq documentation though. |
|
@Chobbes can you give more details about your project, or a link to an archive? I can't reproduce the misplaced "-emacs" option. |
For sure. I'm working on porting Vellvm to 9.0 in this branch here https://github.com/vellvm/vellvm/tree/rocq-9.0 (I'm not 100% positive if the opam stuff there works because I'm in nix land and porting to Rocq 9.0 is a WIP) If It's possible I'm doing something wrong, I generally have PG installed via nix, so I'm loading the patched version manually with I believe the relevant options in my emacs config for proof general are: Hope that is vaguely helpful. |
|
@Matafou if it's helpful, I'm happy to hop on a call at some point so I can show you directly what's going on for me, and maybe we can do a bit of debugging? |
|
When I start scripting in Starting: "rocq" "top" "-emacs" "-topfile" "/home/courtieu/tmp/vellvm/src/rocq/Syntax/DynamicTypes.v" "-w" "-masking-absolute-name" "-w" "-deprecated-hint-without-locality" "-w" "-deprecated-hint-rewrite-without-locality" "-w" "-require-in-module" "-R" "/home/courtieu/tmp/vellvm/src/rocq" "Vellvm" and it looks fine to me (although I didn't try to compile things to check further because you need extlib etc). So I guess your PG setting is maybe doing something wrong? I will push a few more things tonight about the project file. |
Also support _RocqProject files.
08b4273 to
5eed5eb
Compare
Hmmm, okay. Thank you for trying! I'll see if I can figure out what's going on later. |
|
It seems that proof-prog-name-ask is not respected anymore? It still asks but my input is ignored and it just uses the program from PATH. |
|
Thanks for the input. I guess I have to be less aggressive in replacing prog-name. |
af0991c to
659da04
Compare
|
|
@Matafou I pulled your latest changes and loaded them up in a fresh emacs with no config and it seems to work --- might have just been that I wasn't loading something properly 🤷, apologies for any confusion! Thanks for getting this together, though :). It will be nice to have this working! |
|
OK thanks. So I guess I should adapt the options to the executable name (coqtop or rocq) instead of the version number? Don't really like this, but never mind. |
|
Looking at the exe name is probably the easiest solution. You can also try to call |
|
This seems wrong. We can look at the exe name (as done at line 131) or maybe
the output of calling the exe with `-help`.
Or even `$coq-prog-name top </dev/null`?
|
|
That may work too Although with top or c there are cases where it could fail even though with real arguments (particularly -coqlib) it would work
|
|
Maybe the best thing to test is the |
More precisely we try to find coqdep and coqc according to the user-given prog-name if any. This should make auto compilation more reliable.
659da04 to
d8a049f
Compare
|
OK. Now I just call |
|
Seems to work on my machine based tiny amount of testing |
|
FTR we should add some test involving |
|
BTW @Matafou it's ideal to be backed up up by CI's tests (especially for a key component like this), but regarding the urgency to integrate the fix, I propose that we merge this as soon as you're happy with the PR, WDYT? Cc @hendriktews |
you could also opam remove coq in your CI script |
|
Indeed the current #810 does not test the Rocq CLI. I did locally though. |
Yes but anyway, the image has to be updated, because it still refer to 9.0-rc1 |
Good idea, thanks for proposing that! |
I don't understand. Of course, #810 does not test any rocq commands, because it predates this PR. However, the rocq commands are present in the proofgeneral/coq-emacs:coq-9* images I prepared for #810. #810 can be merged. I leave the decision on what to merge first to you. |
|
Hi! @hendriktews Just to clarify what we meant with Pierre: the current 9.0 images that have been used to test PG in #810 did contain both As a result, if we merge both #815 and #810 (whatever is the merge order (but maybe it makes sense to put #810 first)), technically the CI won't test PG in a context where Hence the proposal to:
As noted by @SkySkimmer (as 2. 3. will take a bit of time), meanwhile it's possible to just add some |
|
#810 is merged now |
|
@hendriktews I realize that proof-tree MAY need some fix to work with rocq CLI. |
|
Or maybe not. Maybe proof-tree relies on the name of the default prompt being "Coq <"? |
|
Last question: owuld this be ok for now in CHANGES.md: |
LGTM. Given PG should continue to support Coq <= 8.20 and Rocq >= 9.0 for a while, it looks irrelevant to also rename the features in PG. Also this would break company-coq and other Emacs distributions such as spacemacs and doom-emacs |
|
Renaming the prover is definitely complex in PG. Hundreds of variables are automatically named after the name of the prover... |
|
Renaming the prover is definitely complex in PG. Hundreds of variables are
automatically named after the name of the prover...
We should probably automatically give them both names (i.e. make one
a `defvaralias` (or `define-obsolete-variable-alias`) of the other).
|
|
Would that be possible without a huge refactoring? |
First attempt at supporting the new CLI: from coq v9, coq become rocq:
coqtopbecomesrocq topcoqcbecomerocq ccoqdepbecomesrocq dep@hendriktews can you have a look at what I did for compilation? I mainly reordered options to have the "dep" and "c" as the first option.