Skip to content

Adjust _RocqProject parsing to rocq makefile changes - #880

Open
cpitclaudel wants to merge 3 commits into
masterfrom
cpc/fix-coqproject-args
Open

Adjust _RocqProject parsing to rocq makefile changes#880
cpitclaudel wants to merge 3 commits into
masterfrom
cpc/fix-coqproject-args

Conversation

@cpitclaudel

Copy link
Copy Markdown
Member

This is an attempt to follow lib/coqProject_file.ml instead of doing our own parsing:

  • # starts a comment line;
  • Single quotes toggle quoting and get stripped;
  • \ isn't an escape character, so -arg "-w \"a b\"" (which we used to accept) now needs to be written -arg "-w 'a b'".

Fixes #113, #392, #522, #589. Closes #879.

@RalfJung

RalfJung commented Jul 31, 2026

Copy link
Copy Markdown

\ isn't an escape character

Is this based on experimenting with rocq makefile / reading its code? I don't actually know and never tried what \ does.

@RalfJung

Copy link
Copy Markdown

This seems to work fine with the _RocqProject I was trying to use earlier. :)
Thanks a lot!

@cpitclaudel

Copy link
Copy Markdown
Member Author

Is this based on experimenting with rocq makefile / reading its code? I don't actually know and never tried what \ does.

Reading the code. It used to just dump whatever you added into Makefile, and that's how I wrote the original code. Then that changed, and my -arg code broke. So I rewrote the -arg code to track the new rocq makefile closely.

@Matafou

Matafou commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Thanks @cpitclaudel ! LGTM. The errors in the CI seem unrelated (problem with the generation of to files with same date stamp).

@cpitclaudel

Copy link
Copy Markdown
Member Author

Thanks! I'll have a quick look at fixing the tests and then I'll merge

These tests were broken by fine grained timestamps on CI.
This is an attempt to follow `lib/coqProject_file.ml` instead of doing our own
parsing:

- `#` starts a comment line;
- Single quotes toggle quoting and get stripped;
- `\` isn't an escape character, so `-arg "-w \"a b\""` (which we used to
  accept) now needs to be written `-arg "-w 'a b'"`.

Fixes #113, #392, #522, #589.  Closes #879.
@cpitclaudel
cpitclaudel force-pushed the cpc/fix-coqproject-args branch from 475d4e6 to 73d461f Compare August 1, 2026 15:32
@cpitclaudel

cpitclaudel commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

@Matafou I fixed the par tests; can you have a look? I did my best at reconstructing what the tests meant ^^

@RalfJung

Copy link
Copy Markdown

FWIW I updated and clarified the docs for this on the Rocq side in rocq-prover/rocq#22322 and rocq-prover/rocq#22369, and also fixed the odd behavior Rocq had when there were unpaired ' (they emit an error now). Currently it doesn't look like any kind of escaping is possible.

("-arg \"a 'b c' d 'e\"" ("a" "b c" "d" "e"))
("-arg \"-Q '' Foo\"" ("-Q" "" "Foo"))
("-arg \"''\"" (""))
("-arg \"'\"" (""))

@RalfJung RalfJung Aug 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This ("'") is an error now with my latest PR.

It may also be worth having a test for "-arg 'val -arg val'", which should also error (' is only special inside " so this gets interpreted as -arg, 'val, -arg, val', which then errors)

@cpitclaudel

Copy link
Copy Markdown
Member Author

nice, thanks. Pushed a new version

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.

PG is unusable when -w is passed to Coq via _CoqProject

3 participants