Skip to content

Commit

Permalink
Fix using odoc_driver to build odoc
Browse files Browse the repository at this point in the history
Quoting the docs of the Findlib library:

> * Furthermore, the environment variables OCAMLPATH, OCAMLFIND_DESTDIR,
> * OCAMLFIND_COMMANDS, OCAMLFIND_IGNORE_DUPS_IN, and CAMLLIB are interpreted.
> * By default, the function takes
> * the values found in the environment, but you can pass different values
> * using the [env_*] arguments. By setting these values to empty strings
> * they are no longer considered.

So when we do

```
dune exec -- odoc_driver -p odoc
```

findlib finds the `odoc` library in `_build/install` in some part of the
codebase, in `<opam switch>/lib/odoc` in some other parts of the code, which
results in the docs for `odoc` not being built.

This changes to consistently find the `<opam switch>/lib/odoc`.
  • Loading branch information
panglesd committed Oct 4, 2024
1 parent 53e3971 commit 6190935
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/driver/ocamlfind.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let init =
let prefix = Opam.prefix () in
let env_camllib = Fpath.(v prefix / "lib" / "ocaml" |> to_string) in
let config = Fpath.(v prefix / "lib" / "findlib.conf" |> to_string) in
Findlib.init ~config ~env_camllib ()
Findlib.init ~env_ocamlpath:"" ~config ~env_camllib ()

let all () =
init ();
Expand Down

0 comments on commit 6190935

Please sign in to comment.