Open jmadiot opened 1 month ago
Thanks @jmadiot for the careful report and test case. I agree on all counts, we need to add the test case to our test suite and proceed to improve the error message.
Improving the error message should be easy if someone is up to the task.
For lack of anything proper and better in the documentation, here is an example repository that would have helped me at the time https://github.com/jmadiot/coq-extraction-example
Expected Behavior
Starting with the files:
foo.v
containingRequire Extraction. Extraction "bar.ml" nat.
(it can also be empty)dune-project
with a standarddune
with an incorrect but not completely absurd:it would have been quite helpful to have
dune build
telling me that one cannot havecoq.theory
andcoq.extraction
in the same dune file/directory.Alternatively (but it would be less helpful in understanding the issue) I would have expected an error such as
Error: Duplicate Coq module "foo".
because I did not add the exclude directive(modules :standard \ foo)
to excludefoo
from the theory, such as is done in https://github.com/ocaml/dune/issues/4158 .Actual Behavior
I get the
i_must_not_crash
message, with an error message that I understand only in hindsight:(I did not include _build/log as it seems to have little relevant information)
The documentation explains coq.extraction somewhat, but I think it would be very helpful to provide to add extraction in the examples projects. Issue 4158 is helpful in understanding what went wrong and what is supposed to be allowed, for example.
I also notice now, in hindsight, the documentation's sentence "the common placement for the OCaml stanzas is in the same dune file." which would suggest no mixing of coq.theory and coq.extraction, but it was a note about where the extraction happens, which was a concern I would have been happy to have at the time.
Reproduction
(Instructions in first section.)
Specifications