Continuing a suggestion from ocaml/ocaml#6532 (comment).
At present, the ocaml package sets CAML_LD_LIBRARY_PATH. As noted in ocaml/ocaml#6532 (comment), the setting is redundant for the ocaml-base-compiler and ocaml-variants package, as the setting will exactly mirror what is put in ld.conf by the compiler's build system.
I propose moving the setting of CAML_LD_LIBRARY from the ocaml package to the ocaml-system package. I also propose that it should only use += to append (or possibly prepend?!) the opam stub library directory.
Notes on this:
CAML_LD_LIBRARY path only ever adds directories to the search path (i.e. it does not override ld.conf), so it should not create an issue if opam ends up setting CAML_LD_LIBRARY_PATH to be empty.
- This reduces problems with
CAML_LD_LIBRARY_PATH so that they can only ever affect users who use system compilers.
- There is work in the pipeline to allow the compiler to be relocated (i.e. copied to a new location). Part of this work also mitigates
ocamlrun loading incorrect stub libraries (this would improve the error message for the cases here). That same work should also result in a reduction in opam users using system compilers (their principal benefit is of course speed of switch creation), which will further mitigate this problem.
Continuing a suggestion from ocaml/ocaml#6532 (comment).
At present, the
ocamlpackage setsCAML_LD_LIBRARY_PATH. As noted in ocaml/ocaml#6532 (comment), the setting is redundant for theocaml-base-compilerandocaml-variantspackage, as the setting will exactly mirror what is put inld.confby the compiler's build system.I propose moving the setting of
CAML_LD_LIBRARYfrom theocamlpackage to theocaml-systempackage. I also propose that it should only use+=to append (or possibly prepend?!) the opam stub library directory.Notes on this:
CAML_LD_LIBRARYpath only ever adds directories to the search path (i.e. it does not override ld.conf), so it should not create an issue ifopamends up settingCAML_LD_LIBRARY_PATHto be empty.CAML_LD_LIBRARY_PATHso that they can only ever affect users who use system compilers.ocamlrunloading incorrect stub libraries (this would improve the error message for the cases here). That same work should also result in a reduction in opam users using system compilers (their principal benefit is of course speed of switch creation), which will further mitigate this problem.