Open smorimoto opened 4 years ago
The repo is probably most commonly used within CIs. OCaml isn't usually compiled from source, but a binary version is fetched to speed it up.
Normally, the compiler would only work, if it is available at the same location that was specified at compile time. The OCAMLLIB
environment variable is used to workaround this limitation. But this variable would then be picked up by the secondary compiler, too - which would be wrong.
It would be necessary to add additional logic to the ocaml-secondary-compiler package, to remove or override this enviroment variable somehow. I was too lazy to implement this. Instead I've added binary packages of dune for older OCaml versions (dune is currently the only package that references ocaml-secondary-compiler).
env -u OCAMLLIB
could do the tricks https://github.com/esy-ocaml/esy-opam-override/blob/6/packages/ocaml-secondary-compiler.4.08.1-1/package.json#L7-L9
env -u OCAMLLIB could do the tricks
Yes, it should work during the compilation of ocaml-secondary-compiler
. But what if the compiler is used later? Wouldn't it pick up OCAMLLIB from the environment then?
It will pick the OCAMLLIB from environnement so end user should set it. https://github.com/esy-ocaml/esy-opam-override/blob/6/packages/dune.2.7.1/package.json#L6 I think it ok because mostly only dune require the secondary compiler and OCAMLLIB coup then be keept for the primary compiler.
I don't know much about Windows, is there any technical problem?