# Ocaml-ci-scripts are now using opam2 by default

**URL:** <https://discuss.ocaml.org/t/ocaml-ci-scripts-are-now-using-opam2-by-default/2379>\
**Category:** Ecosystem\
**Created:** [August 2, 2018, 11:32am UTC](https://discuss.ocaml.org/t/ocaml-ci-scripts-are-now-using-opam2-by-default/2379 "2018-08-02T11:32:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![samoht](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/samoht/32/81_2.png) [@samoht](https://discuss.ocaml.org/u/samoht)\
**Post date:** [August 2, 2018, 11:32am UTC](https://discuss.ocaml.org/t/ocaml-ci-scripts-are-now-using-opam2-by-default/2379/1 "2018-08-02T11:32:14Z")

</div>

If you are using [ocaml-ci-scripts](https://github.com/ocaml/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.

---

<div class="post-metadata">

**Author:** ![talex5](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/talex5/32/353_2.png) [@talex5](https://discuss.ocaml.org/u/talex5)\
**Post date:** [August 18, 2018, 5:56pm UTC](https://discuss.ocaml.org/t/ocaml-ci-scripts-are-now-using-opam2-by-default/2379/2 "2018-08-18T17:56:39Z")

</div>

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:

[https://travis-ci.org/0install/0install/jobs/417668278](https://travis-ci.org/0install/0install/jobs/417668278)

---

<div class="post-metadata">

**Author:** ![avsm](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/avsm/32/6_2.png) [@avsm](https://discuss.ocaml.org/u/avsm)\
**Post date:** [August 19, 2018, 10:38am UTC](https://discuss.ocaml.org/t/ocaml-ci-scripts-are-now-using-opam2-by-default/2379/3 "2018-08-19T10:38:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lindig](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/lindig/32/532_2.png) [@lindig](https://discuss.ocaml.org/u/lindig)\
**Post date:** [August 19, 2018, 12:17pm UTC](https://discuss.ocaml.org/t/ocaml-ci-scripts-are-now-using-opam2-by-default/2379/4 "2018-08-19T12:17:19Z")

</div>

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:

```auto
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
env:
  global:
    - PINS="xapi:."
    - BASE_REMOTE="https://github.com/lindig/xs-opam.git"
    - DISTRO="debian-9-ocaml-4.07"
    - OCAML_VERSION="4.07"
  matrix:
    - PACKAGE="xapi"

```

```auto
...
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?

---

<div class="post-metadata">

**Author:** ![avsm](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/avsm/32/6_2.png) [@avsm](https://discuss.ocaml.org/u/avsm)\
**Post date:** [August 19, 2018, 2:51pm UTC](https://discuss.ocaml.org/t/ocaml-ci-scripts-are-now-using-opam2-by-default/2379/5 "2018-08-19T14:51:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lindig](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/lindig/32/532_2.png) [@lindig](https://discuss.ocaml.org/u/lindig)\
**Post date:** [August 19, 2018, 3:20pm UTC](https://discuss.ocaml.org/t/ocaml-ci-scripts-are-now-using-opam2-by-default/2379/6 "2018-08-19T15:20:50Z")

</div>

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](https://github.com/ocaml/ocaml-ci-scripts/pull/240) into the official scripts.
