Skip to content
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: valid module name clashes cause issues #1645

Open
jonludlam opened this issue Dec 12, 2018 · 12 comments
Open

Odoc: valid module name clashes cause issues #1645

jonludlam opened this issue Dec 12, 2018 · 12 comments
Labels

Comments

@jonludlam
Copy link
Member

jonludlam commented Dec 12, 2018

It's perfectly valid to have a dune project containing sub-libraries that have unwrapped modules with the same name. For example:

one/names.ml
two/names.ml

Where the public-name for these is e.g. repro.one and repro.two. These libraries can't be linked together, but the documentation should be able to coexist. Currently this is not possible as odoc is producing the same html filename for both modules:

Multiple rules generated for _build/default/_doc/_html/repro/Names/index.html:
- <internal location>
- <internal location>
@ghost
Copy link

ghost commented Dec 12, 2018

Hmm yh, I believe it's because odoc works with packages rather than libraries. I don't know how we can fix this in Dune :/

@jonludlam
Copy link
Member Author

I've updated the description to make it clear that this is for sub-libraries (repro.one and repro.two)

@jonludlam
Copy link
Member Author

jonludlam commented Dec 12, 2018

This is related to ocaml/odoc#148

@ejgallego
Copy link
Collaborator

Indeed only workaround so far is to wrap one of the libs and set -open Lib in the corresponding Dune flags.

@avsm
Copy link
Member

avsm commented May 22, 2019

I'm still seeing this in yallop/ocaml-ctypes#588 with odoc 1.4.0, need to investigate more:

 $ dune build @doc
Error: Conflicting implementations for virtual library "ctypes-foreign":
- "ctypes-foreign.threaded" in _build/default/src/ctypes-foreign-threaded
- "ctypes-foreign.unthreaded" in _build/default/src/ctypes-foreign-unthreaded
Multiple rules generated for _build/default/_doc/_html/ctypes-foreign/Foreign/index.html:
- <internal location>
- <internal location>

@rgrinberg
Copy link
Member

@jonludlam is there a corresponding odoc bug? I don't think this can be fixed until odoc addresses this.

@jonludlam
Copy link
Member Author

@avsm which version of dune are you using? This ought to be addressed by #2141

@rgrinberg there's no issue on the odoc repo yet. I'll make one when I've got a moment.

@avsm
Copy link
Member

avsm commented May 26, 2019

@jonludlam twas with the released dune 1.9.3 -- I'll try with the master branch shortly

@rgrinberg rgrinberg added the odoc label May 19, 2022
emillon added a commit to emillon/dune that referenced this issue Jul 28, 2022
Signed-off-by: Etienne Millon <me@emillon.org>
emillon added a commit to emillon/dune that referenced this issue Jul 29, 2022
Signed-off-by: Etienne Millon <me@emillon.org>
emillon added a commit that referenced this issue Jul 29, 2022
Signed-off-by: Etienne Millon <me@emillon.org>
@davesnx
Copy link
Contributor

davesnx commented Sep 21, 2023

Facing this issue and found ocaml/odoc#148 has been resolved. Is there any chance to relook into this?

@Khady
Copy link
Contributor

Khady commented Jan 15, 2024

Is it correct to say that this is (at least partially) fixed by the @doc-new rule?

@emillon
Copy link
Collaborator

emillon commented Jan 15, 2024

ping @jonludlam for this question
(though I wouldn't close issues fixed by doc-new until we know how these new rules are going to be enabled)

@jonludlam
Copy link
Member Author

Yes, doc-new should not have this problem. See the test cases for doc rules and doc-new rules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants