Skip to content

Only set CAML_LD_LIBRARY_PATH for system switches #16406

Description

@dra27

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions