Hi, I’m a complete OCaml noob here. I’m reading the book Real World OCaml and am getting my dev environment setup.
I’ve installed OCaml and OPAM via homebrew. When I try to install merlin, core, and utop I get a bunch of errors saying that the installation failed at jbuilder build … Below is a list of those errors I get when installing core.
[ERROR] The compilation of ocaml-migrate-parsetree failed at “jbuilder build -p ocaml-migrate-parsetree -j 4”.
[ERROR] The compilation of ppx_traverse_builtins failed at “jbuilder build --only-packages ppx_traverse_builtins --root . -j 4 @install”.
[ERROR] The compilation of sexplib failed at “jbuilder build -p sexplib -j 4”.
[ERROR] The compilation of spawn failed at “jbuilder build -p spawn -j 4”.
[ERROR] The compilation of ocaml-compiler-libs failed at “jbuilder build --only-packages ocaml-compiler-libs --root . -j 4 @install”.
[ERROR] The compilation of jane-street-headers failed at “jbuilder build -p jane-street-headers -j 4”.
[ERROR] The compilation of topkg failed at “ocaml pkg/pkg.ml build --pkg-name topkg --dev-pkg false”.
I’m not sure what steps I’ve missed. The exact steps I took were:
Is it really enforced by OPAM that all the commands are called with the correct environment? Because I saw myself lots of cases when an installation fails when the environment is not activated. I was considering (and still am) those packages as broken, and always suggest people activating the environment before the install command.
There is currently a known bug with opam compiled with OCaml 4.05.0 that causes it to not bind the right environment. That’s being addressed at the moment, and aside from this issue it should be the case that opam will call commands with the right environment for the active switch.
Please don’t. That makes your question unusable for any future visitors or people stumbling over it via Google. I would even argue that a [SOLVED] tag is not great since even when the OP marks a thread as solved a better solution might still crop up.