From 6190935735b11980f59366d5f975e478ec02636f Mon Sep 17 00:00:00 2001 From: Paul-Elliot Date: Fri, 4 Oct 2024 14:55:33 +0200 Subject: [PATCH] Fix using `odoc_driver` to build `odoc` 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 `/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 `/lib/odoc`. --- src/driver/ocamlfind.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/ocamlfind.ml b/src/driver/ocamlfind.ml index a886292b4b..f6d37d8791 100644 --- a/src/driver/ocamlfind.ml +++ b/src/driver/ocamlfind.ml @@ -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 ();