Trying to run make build-deps on Ubuntu 20.04.4 and getting this error
[ERROR] No compiler matching ocaml-base-compiler.4.12.1' found, use opam switch list-available’ to see what is available, or use `–packages’ to select packages explicitly.
make: *** [Makefile:250: build-deps] Error 5
I did a opam switch create. This is current setup after doing that
$ opam switch list
switch compiler description
→ current ocaml-base-compiler.4.12.1 current
default ocaml.4.13.1 default
and the version of ocaml
$ ocaml --version
The OCaml toplevel, version 4.12.1
No idea if the naming of the switch is part of the problem. Any ideas what’s causing the error?
Trying to build a blockchain validator (Tezos) Not sure if that answers your question about context. Let me know any further details you need. I had also run this last night
If you want to install a compiler, it is better to create a new switch with
opam switch create 4.12.1
That doesn’t answer the question of which Makefile you were trying to execute with make build-deps. Were you trying to build one of the opam tezos package, or one of the github tezos repository? What is the content of the Makefile?
From your configuration, it looks like the 4.12.1 compiler is already installed.
Decided to start from scratch, removed the local tezos repo, uninstalled opam. Installed latest 2.1.2 version of ocaml/opam. Cloned again the tezos repo
Still get the same error. Below are the steps at installing (creating) and setting the switch, and the error
:~/tezos$ opam switch install ocaml.4.12.1
opam: install was removed in version 2.1 of the opam CLI, but version 2.1 has been requested. Use create instead or set OPAMCLI environment variable to 2.0.
:~/tezos$ opam switch create ocaml.4.12.1
<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["ocaml" {= "4.12.1"}]
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed ocaml-options-vanilla.1
⬇ retrieved ocaml-base-compiler.4.12.1 (cached)
∗ installed ocaml-base-compiler.4.12.1
∗ installed ocaml-config.2
∗ installed ocaml.4.12.1
Done.
:~/tezos$ opam switch list
# switch compiler description
current ocaml-base-compiler.4.12.1 current
default ocaml.4.13.1 default
→ ocaml.4.12.1 ocaml.4.12.1 ocaml.4.12.1
:~/tezos$ opam switch set current
:~/tezos$ opam switch list
# switch compiler description
→ current ocaml-base-compiler.4.12.1 current
default ocaml.4.13.1 default
ocaml.4.12.1 ocaml.4.12.1 ocaml.4.12.1
:~/tezos$ make build-deps
[ERROR] Could not update repository "tezos": "/usr/bin/cp -PRp /home/*****/.opam/repo/tezos/.git /home/*******/.opam/repo/tezos.new" exited with code 1
<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
[default] no changes from https://opam.ocaml.org
[ERROR] No compiler matching `ocaml-base-compiler.4.12.1' found, use `opam switch list-available' to see what is available, or use `--packages' to select packages explicitly.
make: *** [Makefile:250: build-deps] Error 5
Yeah since this is for setup of a specific project I feel it’s appropriate to file a ticket and get support from that project. Our forum here is of course happy to discuss general OCaml setup issues but this one seems to be very specific.
I posted the issue at the tezos-baking Slack. The answer I received basically directed me to a different approach to setting up a baker node without having to do a build. However, I did manage to build the node anyway by following the steps at How to get Tezos — Tezos (master branch, 2022/03/27 13:34) documentation. I did get an error with the ‘opam install depext’ step based on that site, but I was able to ignore it. The error I ignored: [ERROR] depext unmet availability conditions, e.g. 'opam-version >= “2.0.0~beta5” & opam-version < “2.1"”