Write odoc configuration files#13476
Conversation
71b5326 to
07dd3f2
Compare
07dd3f2 to
243a808
Compare
|
@jonludlam can you confirm that this is the file we need to create and install? Can we write a test that involves reading this file somehow? To make sure that we're producing what odoc expects. |
|
I am also unsure whether just marking all |
0f2dcfe to
0b21a3e
Compare
|
@rgrinberg The tests fail because odoc-parser writes its own |
|
I don't think so. Maybe you could add some sort of an odoc specific hack and ask @jonludlam to remove this rule? |
059e92a to
2c39954
Compare
2c39954 to
28266d7
Compare
|
Does this PR always create an odoc-config.sexp, or only when you've actually specified doc dependencies? I'm surprised by the number of changes it's making to the existing tests. |
I don't think this is the right thing to do. I think |
|
@jonludlam I've incorporated this comment to always generate the |
|
Yes, many of our tests don't put much effort into making sure they're observing the output they need. I don't think we should shy away from doing the simplest thing here.
Yes. Detecting whether odoc is a dependency or not is actually not trivial in the presence of dependency disjunctions. It's not worth opening a can of form to save ourselves generating a 1 line file. |
It seems a bit silly to me to be generating a file that just contains |
|
Also if it were conditional, we wouldn't need the odoc-parser hack (which also will break the build of odoc and anything else that's following the current guidance in the odoc documentation). |
|
I might have misunderstood the purpose of this config, but why would it be empty? Why wouldn't it include every single package in the project? |
|
I've discussed solutions with @Alizter and we had a number of proposals to solve the
|
The purpose of this file is to let odoc_driver figure out what extra packages need to be available in order to produce complete documentation. It can figure out the 'usual' documentation dependencies itself - ie, the union of everything in the dependency cone of all of the libraries in the package. Basically we've got by without this file for years by only allowing links to docs in your dependency cone, but that's quite a big restriction. The reason |
I'm not really sure what problem you're trying to solve here. The only reason If we make the generation of this file conditional on there being anything in it at all, don't all the current problems go away? |
I see. How do you make sure that odoc-parser cannot link to packages outside of its dependency cone and this limited set of packages? Moreover, don't our odoc rules need dependencies on these packages to produce the links? |
Include paths, more-or-less. Links don't resolve unless we can verify the destination is there, and this means that the odoc files have to be present at link time.
Yes - this is all included in the odoc-v3 PR I made before xmas, though in that case it was using the older mechanism of specifying the dependencies separately in the dune-project file. It should be straightforward to adapt that to use the normal deps filtered by 'with-doc'. |
|
Okay, that all make sense. Whether the empty file is installed makes no difference, because its contents is determined by these dependency specifications anyway. I would have liked to see if there's a design that allowed folks to produce package installations without the reliance on the I still don't get this point:
I don't see how guarding the generation of this file behind constraints solves this problem though. There's already a tension here:
So I think you should drop your recommendation ASAP, or we should properly accommodate it in dune. |
I'm trying to solve the problem of what happens if project generate their own |
We could include a similar solution as the original PR, adding a doc depends stanza: (doc_depends
((name my)
(depends brr jsoo))
((name another)
(depends wasmoo)))However that seems to be reinventing the wheel as one could also use the |
|
@jonludlam I just realized that this feature is completely unavailable to those users that prefer to write their metadata in opam files. Is that intentional? |
|
@rgrinberg if people are not using dune to declare package dependencies, then isn't it correct that dune not generate the If users are only using opam for package definition, they can write their odoc-config.sexp by hand, right? |
Signed-off-by: Paul-Elliot <peada@free.fr> Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Paul-Elliot <peada@free.fr> Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Paul-Elliot <peada@free.fr> Signed-off-by: Marek Kubica <marek@tarides.com>
Remove the need to specify library dependencies. This is not anymore needed since ocaml/odoc#1343 Use `(documentation (depends ...))` for package dependencies. It's good for extensibility of per-package doc configuration. Signed-off-by: Paul-Elliot <peada@free.fr> Signed-off-by: Marek Kubica <marek@tarides.com>
should not walk on each other's feet Signed-off-by: Paul-Elliot <peada@free.fr> Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Paul-Elliot <peada@free.fr> Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Paul-Elliot <peada@free.fr> Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Paul-Elliot <peada@free.fr> Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Paul-Elliot <peada@free.fr> Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
dabe3ed to
7693c15
Compare
This PR revives ocaml#11716 by rebasing and addressing the outstanding issues. Closes ocaml#13485. --------- Signed-off-by: Paul-Elliot <peada@free.fr> Signed-off-by: Marek Kubica <marek@tarides.com> Co-authored-by: Paul-Elliot <peada@free.fr> Co-authored-by: Puneeth Chaganti <punchagan@muse-amuse.in>
This PR revives #11716 by rebasing and addressing the outstanding issues.
Closes #13485.