Closed tmattio closed 3 years ago
Turns out, I used --unlock-base
to install the dependencies from the lock file with different OCaml version, but this caused opam to upgrade the ocaml-compiler in the switch. Using --ignore-constraints-on=ocaml
instead solves the issue.
It seems that
setup-ocaml
is always using the latest version of OCaml, no matter which version is passed inocaml-version
. See this run for instance: https://github.com/rgrinberg/opium/runs/1465857399The OCaml version setup by the
setup-ocaml
is4.10.1
, but the next step, which prints the version of the compiler withopam exec -- ocaml --version
, tell us that we're still using4.11.1
.I don't think I'm doing anything special, apart from caching the
~/opam
directory, but the key is set tov1-${{ runner.os }}-opam-${{ matrix.ocaml-version }}-
, so it should not have an impact on the OCaml version.EDIT: I disabled the cache, and the OCaml version is set correctly, so it seems related to caching
~/opam
. Since the key depends on the ocaml version, the only difference I see is the use ofopam switch set ...
vsopam switch create ...
. Is it possible the former does not set the environment correctly for the next steps?