Missing OPAM flag on installation instructions when working with several switches
When setting up hax (using ./setup) on a system that already has opam switches (with other ocaml versions), the installation of topkg fails. This comes from the usage of an old environment variable OCAMLTOP_INCLUDE_PATH that is not properly reset between opam switches until ocaml 5.3.
Error message
[ERROR] The compilation of topkg.1.0.8 failed at "ocaml pkg/pkg.ml build --pkg-name topkg --dev-pkg
false".
#=== ERROR while compiling topkg.1.0.8 ========================================#
# context 2.3.0 | linux/x86_64 | ocaml-base-compiler.5.1.1 | https://opam.ocaml.org#58c7821a2ec75552933315247b1d9318a3314d66
# path ~/.opam/hax/.opam-switch/build/topkg.1.0.8
# command ~/.opam/opam-init/hooks/sandbox.sh build ocaml pkg/pkg.ml build --pkg-name topkg --dev-pkg false
# exit-code 125
# env-file ~/.opam/log/topkg-310839-3e50b8.env
# output-file ~/.opam/log/topkg-310839-3e50b8.out
### output ###
# File /home/username/.opam/dev/lib/findlib/findlib.cma is not a bytecode object file.
# Exception: Compenv.Exit_with_status 125.
On my setup, doing :
env | grep OCAML
reveals the two variables OCAML_TOPLEVEL_PATH (correct path) and OCAMLTOP_INCLUDE_PATH (incorrect path from another switch). Doing :
OCAMLTOP_INCLUDE_PATH=$OCAML_TOPLEVEL_PATH; ./setup
worked for me.
Either the instructions can be updated to include this corner case, or (better) the dependency over topkg should be removed, as it is no longer actively maintained.
Where does the dependency of topkg comes from?
If we can indeed drop it that's great.
(I'm not using opam myself, so I'm not seeing those problems :S)
This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.
I recall we discussed that informally, @clementblaudeau do you recall what was the conclusion here?
This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.
@clementblaudeau Can you triage this?