Hello,
I’ve just started trying to tackle some of the junior-jobs on the ocaml issues page: https://github.com/ocaml/ocaml/labels/junior-job
I’m trying to follow https://github.com/ocaml/ocaml/blob/trunk/HACKING.adoc
opam switch create . --empty
opam install .
however it fails at the point of compiling ocaml:
ocaml-variants is now pinned to git+file:///~/dev/ocaml/ocaml-src#trunk (version 4.10.0+trunk)
[NOTE] It seems you have not updated your repositories for a while. Consider updating them with:
opam update
The following actions will be performed:
∗ install ocaml-variants 4.10.0+trunk*
∗ install base-bigarray base
∗ install base-threads base
∗ install base-unix base
∗ install ocaml-config 1
∗ install ocaml 4.10.0
===== ∗ 6 =====
Do you want to continue? [Y/n] Y
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[ocaml-variants.4.10.0+trunk] synchronised from git+file:///~/dev/ocaml/ocaml-src#trunk
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed ocaml-variants.4.10.0+trunk
∗ installed ocaml-config.1
[ERROR] The compilation of ocaml failed at "/~/.opam/opam-init/hooks/sandbox.sh build ocaml /~/dev/ocaml/ocaml-src/_opam/share/ocaml-config/gen_ocaml_config.ml 4.10.0 ocaml".
#=== ERROR while compiling ocaml.4.10.0 =======================================#
# context 2.0.1 | macos/x86_64 | | https://opam.ocaml.org#77e7fcf1
# path ~/dev/ocaml/ocaml-src/_opam/.opam-switch/build/ocaml.4.10.0
# command ~/.opam/opam-init/hooks/sandbox.sh build ocaml ~/dev/ocaml/ocaml-src/_opam/share/ocaml-config/gen_ocaml_config.ml 4.10.0 ocaml
# exit-code 1
# env-file ~/.opam/log/ocaml-12656-03b1a4.env
# output-file ~/.opam/log/ocaml-12656-03b1a4.out
### output ###
# OCaml version mismatch: 4.11.0, expected 4.10.0
so clearly its a version mismatch - is there an environment variable or opam variable or something that I am supposed to set?
Follow up question: given this sort of setup (local switch with self built ocaml env) how to install tools like merlin, ocp-indent etc? Again I get the version error for those but now its things like
merline requires ocaml <=4.08.0
and such?
thanks
EDIT: by the way, I can get everything to build and run tests etc without using switches, but I’m looking to get the standard tooling working on the ocaml source too.