ocaml / opam-repository

Main public package repository for opam, the source package manager of OCaml.
https://opam.ocaml.org
Creative Commons Zero v1.0 Universal
516 stars 1.12k forks source link

Switches are configured with `OCAML_TOPLEVEL_PATH` but the variable name is `OCAMLTOP_INCLUDE_PATH` #25819

Open dbuenzli opened 5 months ago

dbuenzli commented 5 months ago

I was trying to change omod and down to stop pooping omod.top and down.top into ocaml's library directory and leave it for $(opam var lib)/toplevel to handle it.

This should be possible since OCaml 4.08.0 when https://github.com/ocaml/ocaml/issues/7808 was resolved by @nojb's https://github.com/ocaml/ocaml/pull/1841.

Unfortunately the compilers packages set the OCAML_TOPLEVEL_PATH instead of OCAMLTOP_INCLUDE_PATH so that doesn't work.

Not sure exactly who's responsible for opam compiler packages so I tentatively cc @Octachron and @dra27.

# With a down modified to no longer install `down.top` in $(opam var lib:ocaml)

> OCAML_TOPLEVEL_PATH=/Users/dbuenzli/.opam/4.14.2/lib/toplevel ocaml -noinit 
OCaml version 4.14.2
Enter #help;; for help.

# #use "down.top";;
Cannot find file down.top.
# ^D
> OCAMLTOP_INCLUDE_PATH=/Users/dbuenzli/.opam/4.14.2/lib/toplevel ocaml -noinit
OCaml version 4.14.2
Enter #help;; for help.

# #use "down.top";;
Down v0.3.0-5-g8eef77b loaded. Type Down.help () for more info.
# 
dra27 commented 4 months ago

Not sure exactly who's responsible for opam compiler packages so I tentatively cc @Octachron and @dra27.

Suggests that I really should move on getting the precise value in https://github.com/dra27/opam-repository/commit/7813e70e155ac3a9c11927ab40b620d7741117d4 sorted out and upstreamed 🙂

dbuenzli commented 3 weeks ago

@dra27 do you have an ETA on that one ? I should likely do an omod and down release and I would have liked to stop installing stuff in OCaml's library directory.

dra27 commented 2 weeks ago

Sorry for the slowness, I've at least updated ocaml.5.3.0 to support it (would you be able to test that with omod and down versions which do install to %{toplevel}% instead?). Updating the older ocaml packages triggers mass switch rebuilds, but the time to do that might be at a point where that's going to be happening anyway (e.g. the next Dune release, which I imagine won't be too far away). There's then the matter of updating the ocamlfind package to stop installing the ocaml shim both because it doesn't work on Windows and because with that change it becomes unnecessary to have it at all (finally).