Opam switch?

That’s tricky to answer. Technically Haxe does not even depends on opam. We can “install” the OCaml libraries in some other ways, e.g. using the Debian packages, or manually build the libraries and place them to some places. But the easiest way should still be using opam.

I guess we can even use opam 1 and make use of those opam 2 libs, by installing those opam 2 libs using non-opam methods. But again, the easiest way should still be using opam 2…

I had trouble getting opam 2 to work on all three operating systems where I tried it. Mostly because of bubblewrap on Ubuntu 16.04 · Issue #3424 · ocaml/opam · GitHub, but maybe there’s an obvious solution to this that I’m missing.

But you’re right, as long as we can manage to install the dependencies “somehow” we should be fine.

Bloody hell this feels good:

2 Likes

Thanks for the kind words!

it’s seem you have to choose which version

# environment setup
opam init
eval `opam env`
# install given version of the compiler
opam switch create 4.08.1
eval `opam env`
# check you got what you want
which ocaml
ocaml -version

I followed the same steps @andyli provided, but I am facing this error:

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build conf-m4                  1
│ λ build ocaml-secondary-compiler 4.08.1
│ λ build ocaml-system             4.05.0
└─
╶─ No changes have been performed

<><> ocaml-secondary-compiler.4.08.1 troubleshooting ><><><><><><><><><><><><><>
=> A failure in the middle of the build may be caused by build parallelism
      (enabled by default).
      Please file a bug report at https://github.com/ocaml/ocaml/issues

The packages you requested declare the following system dependencies. Please make sure they are installed before
retrying:
    m4

I executed sudo apt install m4 as well but did not help.

Any help?

Thank you!