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

Add odoc dev tool #10914

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add odoc dev tool #10914

wants to merge 2 commits into from

Conversation

gridbugs
Copy link
Collaborator

The command dune ocaml doc will now lock, build, and run odoc as a dev tool if the dev tools feature is enabled.

@rgrinberg
Copy link
Member

Doesn't odoc have the same limitation as lsp? I.e it needs to be compiled with the same version of OCaml as the project.

src/dune_rules/odoc.ml Outdated Show resolved Hide resolved
Remove references to ocamlformat from the fetch rules and create fetch
rules for all dev tools.

Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
@gridbugs gridbugs force-pushed the dev-tool-odoc branch 2 times, most recently from 1b86797 to ea33c5b Compare September 19, 2024 03:47
@gridbugs
Copy link
Collaborator Author

Doesn't odoc have the same limitation as lsp? I.e it needs to be compiled with the same version of OCaml as the project.

You're totally right. I didn't realize this but that explains some of the weird errors I've run into with odoc recently:

E.g.

File "src/.climate.objs/byte/_unknown_", line 1, characters 0-0:
ERROR: File "climate__.cmt":
not an implementation

I'll borrow some of the code from my ocamllsp dev-tool pr to make sure that the same compiler is used to build odoc as is used to build the project.

The command `dune ocaml doc` will now lock, build, and run odoc as a
dev tool if the dev tools feature is enabled.

Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
@gridbugs
Copy link
Collaborator Author

I updated this so that it always uses the same version of the compiler to build odoc as it does to build the project and added some tests that it relocks the odoc dev tool to keep the compiler dependency in sync with the project.

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

Successfully merging this pull request may close these issues.

3 participants