Skip to content

Vendored findlib unable to locate opam installed packages #7

@NathanReb

Description

@NathanReb

We've looked into the vendored findlib and dune issue with @emillon and there are several problems:

  1. at the moment dune sets OCAMLPATH to point to the _build/install/default/lib but not to _opam/lib which means that a vendored ocamlfind cannot find packages installed in the switch
  2. when ocamlfind is not installed in the switch, there are no META files for stdlib, unix and other such compiler libraries

Etienne's dune patch fixes 1 but not 2. We didn't catch it because ocamlfind was always in the switch as a deps of base-bytes.

1 can also be fixed directly in findlib's dune port. The dune port is slightly different from upstream as it always relies on OCAMLPATH being set to work, whereas upstream hardcodes the default OCAMLPATH after a configure step.
We can improve the dune port and write this config step as dune rules so that the dune produced binary has the right hardcoded path.

2 is a bit trickier but could also be fixed in the dune port. ocamlfind installs the META itself instead of hardcoding the information in the META. This could be changed as well.

I'll open an issue to see if this second fix can be usptreamed instead so that we keep the dune port simple.

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