-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
coqdoc -Q foo ""
fails with invalid_argument
#19012
Comments
Please provide a way to reproduce the error eg as an attached file of the generated arguments.
We're on 4.09 and AFAICT Rest_all is 4.12 so no. |
ping |
I felt bad about potentially uploading a 68 kilobyte file so I resolved to come up with an actual minimal example: this seems to be happening because of blank "root" logical paths. This is a minimal example:
results in
but this does not happen in Coqdoc 8.16.1, which appears to correctly generate a file which is mapped under the root logical directory when given these kinds of arguments. In some libraries (UniCoq, relation-algebra, mtac2), the test-suite or examples are assigned to be under the root logical path (according to their glob files). This means that their physical directory indeed ought to be mapped to logical path "". Although, I'm not sure if "" was supposed to work in the first place. According to some documentation I found once but can no longer find, giving "<>" is a definitely supported way of referring to the root directory, which still seems to work in Coq 8.18. Checking for this on my end and giving "<>" when "" is the logical path seems to be a functioning workaround for me. |
Fix coq#19012 I didn't test beyond that `coqdoc -Q /tmp ""` doesn't crash.
coqdoc -Q foo ""
fails with invalid_argument
Description of the problem
I am using Coqdoc in perhaps an unintended manner: building documentation for entire switches at once with long, automatically generated lists of
-Q
bindings and vfiles. It would be difficult to provide a reproducible example of my current issue and I haven't identified any clear minimal example.In 2022, a small change was made to coqdoc (commit 662baba) that replaced usage of a standard library function
Arg.Rest_All
with what the author of the diff referred to as a "hack" that should be replaced as soon as the version of the ocaml standard library used alongside Coq was sufficiently updated.git bisect
indicates that this commit is where all the trouble started-- my tool can't use versions of Coqdoc past this commit because when fed my very long, automatically generated argument list, it immediately produces aFatal error: exception Invalid_argument("index out of bounds")
.Have we updated to a version of the ocaml standard library that allows this change to be reverted? If so, here is a patch that returns to the old behavior.
I have checked that on the current main branch of Coq this diff can be applied and corrects the bug I'm observing, but only that.
Small Coq file to reproduce the bug
Version of Coq where this bug occurs
commit 662baba onwards (8.18)
Last version of Coq where the bug did not occur
before commit 662baba
The text was updated successfully, but these errors were encountered: