-
Notifications
You must be signed in to change notification settings - Fork 94
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
odoc: Internal error, uncaught exception in src/odoc/env.ml
#148
Comments
This is likely due to Coq shipping to We will wrap modules ASAP, but for now we cannot do a lot, maybe we could move the checker to a different package but we have a couple of issues due to dependencies. |
Regardless of how unusual Coq's documentation might be, it should not cause the tool to die with an internal error. |
@lpw25, I created a minimal repo that reproduces this failure:
That sequence should trigger it (it needs an opam switch with the deps of odoc installed). There is a small project in the repo's The sublibraries don't depend on each other, however I suspect Dune is being too liberal with its The files read for the two Could you please take a look, and see if you can diagnose this quickly? I am still quite unfamiliar with these parts of odoc. |
That's a bug in dune's odoc rules indeed.
Anyway, An even better solution (which requires more work though) would be to scan eagerly the loadpath on startup. |
For the record, the compiler will itself start doing that eager scan with 4.08. So I don't think we'd have any performance issue that wouldn't also be experienced by the compiler if we start doing that. |
I'll take a look at this one if nobody else is right now. |
I don't think anyone actively is. To get started, I suggest running Separately, we should replace the assertion failure with some better error message. |
Yep, got the repro working (failing!). I'll try the eager scan method first to report the problem as early as possible, and can probably look at the Dune problem next week. |
This allows early detection of problems such as there being two files of the same name in different paths (see ocaml#148 for an example) Signed-off-by: Jon Ludlam <jon@recoil.org>
In the repro, the problem happened when building the html for
and since
as @trefis points out, dune's aware of a problem here. However, this isn't the same problem - it's genuinely true that there are two modules called 'Names' in different libraries that, because we're generating documentation for the entire package and not just the libraries, end up with the same filename. This isn't 'wrong' at all - the two libraries might not be intended to be linked together into the same binary (as is the case with the coq issue that we started with). Furthermore, looking at more log from the verbose doc build, we see:
here it's building the package-level index of modules. This necessarily has to have both libraries on the include path, so this isn't a dune problem. This implies that odoc should try to handle (or at least, not die horribly) the case where there are multiple modules with the same name in different places. I've made PR #270 to do this. If we really want to try to support this properly then we should also be putting the output in library-specific paths. Personally though, I feel we should be pushing people to wrap their libraries which would avoid this issue altogether rather than reworking the output layout for this corner case. |
I believe we can close this issue now that #270 has been merged. |
Using the tree at coq/coq#6857 I get from
jbuilder build @doc
:This is
odoc
master
. In general, I am having a bit of trouble building the ML documentation for Coq with odoc, see also #111The text was updated successfully, but these errors were encountered: