Ocaml-ci-scripts are now using opam2 by default

If you are using ocaml-ci-scripts to run your CI scripts using Travis CI, Circle CI or Appveyor, you should know that since a few minutes ago, the default images and scripts are using opam2-rc4.

Normally, the change should be completely transparent: everything should continue to work as before. If that’s not the case, you could revert to use opam 1.2.2 by setting OPAM_VERSION=1.2.2 in your .travis.yml script and please report the issue so that we can fix it before the release planned in September.


Is there any way to use opam2 but disable the sandbox? My unit tests need to create a Unix-domain socket for gpg, and it looks like opam2 blocks that on macos:


There is an opam-disable-sandbox script installed in all the containers. If you run that, the opamrc will disable sandboxing in the .opamrc and you are good to go. I think that’s the only option on macOS, since we aren’t running under Docker there.

1 Like

I am trying to use the docker-based CI with my own base remote and surprising for me, the compiler gets downgraded to a lower version:

language: c
sudo: required
service: docker
install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-docker.sh
script: bash -ex .travis-docker.sh
    - PINS="xapi:."
    - BASE_REMOTE="https://github.com/lindig/xs-opam.git"
    - DISTRO="debian-9-ocaml-4.07"
    - OCAML_VERSION="4.07"
    - PACKAGE="xapi"
The following actions will be performed:
  - downgrade ocaml-base-compiler 4.07.0 to 4.04.2
  - downgrade ocaml               4.07.0 to 4.04.2 [uses ocaml-base-compiler]

My own base remote does not contain a definition for 4.04.2 and so I suspect it is coming from the Docker image. Any tips?

Try adding ocaml-base-compiler.4.07.0 to the PACKAGE list and see if that helps. Might be an opam2 bug, or might be an actual constraint on that compiler revision, not sure which.

Thanks. On further inspection, I can see that I need to access a branch other than master in the BASE_REMOTE. This needs further investigation on my side.

Addendum: it works now as expected. I added support for specifying a BASE_REMOTE_BRANCH. This has been merged into the official scripts.