How do i create a compiler not listed in list available

I am trying to create compiler version 4.06.1 to work on some older code with bs-platform and get editor highlighting.

running opam switch create ./ ocaml-base-compiler.4.06.1 throws this error:

?  opam switch create ./ ocaml-base-compiler.4.06.1

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><>  🐫
Switch invariant: ["ocaml-base-compiler" {= "4.06.1"}]
[ERROR] Could not determine which packages to install for this switch:
  * Missing dependency:
    - ocaml-base-compiler = 4.06.1
    unmet availability conditions: '!(os = "macos" & arch = "arm64")'

Seems like older compilers are not listed in opam switch list-available.

Thanks for any guidance.

It sounds more like you are on ARM64 on macOS which doesn’t seem to be supported (given macOS on ARM came years after OCaml 4.06 was released, this might not be entirely surprising), because the compiler gets found but is unavailable.

Thanks. That’s too bad.

If you want to use 4.06 on macOS/arm64 you can use Docker:

docker run --pull --rm -it ocaml/opam:4.06
  docker run --pull --rm -it ocaml/opam:4.06
docker: Error response from daemon: No such image: ocaml/opam:4.06.
See 'docker run --help'.

Not seeing it on docker hub either though I am probably not looking in the right place. The options in tags get you

windows-mingw-21H2-ocaml-4.06: Pulling from ocaml/opam
no matching manifest for linux/arm64/v8 in the manifest list entries

ah oops i forgot the naming scheme. Here is the right one:

ocaml/opam:debian-ocaml-4.06

That is downloading. Thanks.

So will this show up in opam switch list? Or do I need to set it path? env variable?

Thanks again!

Doesnt show up in listed switches…

I’m not sure what you mean. This will give you an environment with an opam switch with OCaml 4.06 as expected, everything is accessible from there

Ok. I have never used opam from a docker container so let me do some googling.