Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI broken because of Ubuntu PPA missing package #308

Closed
sshine opened this issue Jun 18, 2019 · 3 comments
Closed

CI broken because of Ubuntu PPA missing package #308

sshine opened this issue Jun 18, 2019 · 3 comments

Comments

@sshine
Copy link
Contributor

sshine commented Jun 18, 2019

The PR #306 currently demonstrates that the Ubuntu PPA we use for downloading ocaml42+opam12 is broken, since this package appears to be gone. This PPA was used added around the time of 4.02, but today even the regular Ubuntu ocaml-nox package is 4.05. The solution would be to change .travis-ci.sh so that it uses a source that does not break.

This could either be with

  • Ocaml 4.05 + Opam 1.2.2 using apt install ocaml-nox opam, or
  • Ocaml 4.07 + Opam 2.0.x: Using this docker file
  • Ocaml 4.08 (released Jun 14, 2019) + Opam 2.0.x: The PPA does contain the latest Opam, which can be installed like this:
    add-apt-repository ppa:avsm/ppa
    apt update
    apt install opam
    
    but the latest Ocaml this PPA has is 4.02.3. The recommended way to install the development environment is via opam switch create 4.08.0, but this builds the compiler which takes several minutes on my i5-7200U CPU @ 2.50GHz.

@stevejb71: If we fix this CI problem, it also addresses #287. I tried to upgrade to Opam 2.0.x and played with opam switch create 4.08.0 to see how long it takes, and it appears to be stuck at make world for a while. So I think we should be going for a binary distribution.

An alternative is Docker images, but the one for 4.08 isn't out yet. We could of course start with 4.07 and simply bump it up when the time comes. I don't really know much about Docker, and I don't know of the implications of changing .travis.yml in this way. Resources:

From the Travis CI logs at https://travis-ci.org/exercism/ocaml/builds/545910314 it says:

$ bash -ex .travis-ci.sh
+OPAM_DEPENDS='ocamlfind core ounit qcheck react ppx_deriving'
+case "$OCAML_VERSION,$OPAM_VERSION" in
+ppa=avsm/ocaml42+opam12
+echo yes
+sudo add-apt-repository ppa:avsm/ocaml42+opam12
 
 More info: https://launchpad.net/~avsm/+archive/ubuntu/ocaml42+opam12
gpg: keyring `/tmp/tmpwo8200yr/secring.gpg' created
gpg: keyring `/tmp/tmpwo8200yr/pubring.gpg' created
gpg: requesting key 61707B09 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpwo8200yr/trustdb.gpg: trustdb created
gpg: key 61707B09: public key "Launchpad PPA for Anil Madhavapeddy" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
+sudo apt-get update -qq
W: The repository 'http://ppa.launchpad.net/avsm/ocaml42+opam12/ubuntu xenial Release' does not have a Release file.
E: Failed to fetch http://ppa.launchpad.net/avsm/ocaml42+opam12/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
The command "bash -ex .travis-ci.sh" exited with 100.

...
@sshine
Copy link
Contributor Author

sshine commented Jun 18, 2019

Hi @marionebl. Excellent work in #306, and sorry, I didn't see your side note before creating this issue.

I'd prefer to stick to Travis CI, because this appears to be what the Exercism project uses, but it looks like we're currently using an Ubuntu PPA to download an old (and now missing) Ocaml + OPAM package, and we could be using the exact same ocaml/opam2 Docker image as you demonstrate with Circle CI. Is that correct?

In that case, you are very welcome to submit another PR for this particular problem.

I think we'll be happier to review other PRs including #306 when CI is working. :-)

@sshine
Copy link
Contributor Author

sshine commented Jun 19, 2019

I tried toying around with Travis CI and some modified Travis configuration on https://github.com/sshine/exercism-ocaml/tree/fix-travis-ci inspired by your Circle CI configuration, @marionebl. Because my knowledge of Docker is limited, my most successful attempt was to install ocaml via opam; ignoring that initialization took 6m52s, the following problem regarding dependencies were also encountered:

https://travis-ci.com/sshine/exercism-ocaml/jobs/209178155#L259

The following dependencies couldn't be met:
  - ppx_deriving → ocaml < 4.06.0
      base of this switch (use `--unlock-base' to force)
  - ppx_deriving → ppx_tools >= 4.02.3 → ocaml < 4.08
      base of this switch (use `--unlock-base' to force)

The palindrome-products is the only exercise that depends on ppx_deriving in its example solution, but I guess we can't use 4.08 until this conflict is resolved.

@marionebl
Copy link
Contributor

marionebl commented Jun 19, 2019

I'd prefer to stick to Travis CI [...]

Ok, I created a PR reflecting this at #310.

The downside of using Travis CI is the jobs do not cache the things executed in the docker environment, resulting in quite a time delta:

Looking esp. at the opam install times this might become relevant down the line. We still could address this and continue with Travis CI by creating a docker image that builds on ocaml/opam2 and adds the opam dependencies, then use that during CI runs.

@sshine sshine closed this as completed in f3e2c70 Jun 21, 2019
marionebl added a commit to marionebl/ocaml that referenced this issue Jun 24, 2019
Use the `ocaml/opam2` Docker image for CI.

Explicitly use OCaml 4.07.0 for now.

Pin base to v0.11.1 to avoid breaking changes as documented in exercism#301.

This fixes exercism#308.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants