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[^1], 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.
[^1]: ~because the ocamlpath of compile time was used!~ Missread...
Surely there is a better way here. I originally opened the PR with the confusion that it would take the compile time value, which was then always wrong.
Quoting the docs of the Findlib library:
So when we do
findlib finds the
odoc
library in_build/install
in some part of the codebase[^1], in<opam switch>/lib/odoc
in some other parts of the code, which results in the docs forodoc
not being built.This changes to consistently find the
<opam switch>/lib/odoc
.[^1]: ~because the
ocamlpath
of compile time was used!~ Missread...