Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global ocamlfind (and dune) interferes with opam switches that do not have ocamlfind installed #83

Open
jonahbeckford opened this issue Nov 29, 2023 · 1 comment

Comments

@jonahbeckford
Copy link
Contributor

The global ocamlfind is a shim to with-dkml that today is in <DkMLHome>/bin. Since <DkMLHome>/bin is part of PATH+= in an opam switch, that global ocamlfind is visible inside an opam switch (as long as no opam install ocamlfind is done).

The consequence is that dune will find the global ocamlfind and then report not being able to find libraries that are legit part of the opam switch.

Solution:

  • All precompiled binaries, especially the shims, go into <DkMLHome>/usr/bin. That usr/bin directory is already part of the global PATH (at least on Windows as set by the Windows setup-userprofile.ps1 installer).
  • All native code binaries compiled by install-ocaml-compiler.sh go into <DkMLHome>/bin as they are today. However, no restore-ocaml-shims.sh is needed because native code binaries live completely separate from the precompiled binaries.
jonahbeckford added a commit to diskuv/dkml-component-ocamlcompiler that referenced this issue Nov 30, 2023
Previously they were are in <DkMLHome>/usr/bin which
is now reserved for precompiled binaries.

Part of diskuv/dkml-installer-ocaml#83
jonahbeckford added a commit to diskuv/dkml-runtime-apps that referenced this issue Nov 30, 2023
Now that precompiled binaries are in <DkMLHome>/usr/bin
there is no reason to restore shims.

Part of diskuv/dkml-installer-ocaml#83
jonahbeckford added a commit to diskuv/dkml-runtime-common that referenced this issue Dec 1, 2023
jonahbeckford added a commit to diskuv/dkml-runtime-apps that referenced this issue Dec 1, 2023
@jonahbeckford jonahbeckford changed the title global ocamlfind interferes with opam switches that do not have ocamlfind installed global ocamlfind (and dune) interferes with opam switches that do not have ocamlfind installed Dec 1, 2023
@jonahbeckford
Copy link
Contributor Author

dune is similar ... it should not be in the global environment because it is confusing when used in a local opam switch that does not yet have dune installed (or the user forgot to do a eval $(opam env).

jonahbeckford added a commit to diskuv/dkml-runtime-distribution that referenced this issue Dec 1, 2023
Needed since dune is no longer a compile package.

Part of diskuv/dkml-installer-ocaml#83
jonahbeckford added a commit to diskuv/dkml-runtime-distribution that referenced this issue Dec 1, 2023
The shim is removed since Dune is no longer in the global environment.

Because no shim needed, might as well upgrade Dune to the latest
version (3.12.1).

Part of diskuv/dkml-installer-ocaml#83
jonahbeckford added a commit to diskuv/dkml-runtime-apps that referenced this issue Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant