ocaml-ci-scripts icon indicating copy to clipboard operation
ocaml-ci-scripts copied to clipboard

Support installing specific non-optional dependencies

Open mato opened this issue 5 years ago • 2 comments

Please provide support for installing a specific "variant" of a non-optional dependency of an OPAM package under test.

For example, Solo5 produces the following bindings packages -- solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode, all of which conflict with each other, i.e. they are mutually exclusive.

Downstream, mirage-solo5 then has the following dependencies in OPAM:

("solo5-bindings-hvt" {>= "0.6.0"} 
| "solo5-bindings-spt" {>= "0.6.0"} 
| "solo5-bindings-virtio" {>= "0.6.0"} 
| "solo5-bindings-muen" {>= "0.6.0"} 
| "solo5-bindings-genode" {>= "0.6.0"})

Until now, I have been using EXTRA_DEPS as a way of selecting the specific bindings variant that I would like to be installed when running Travis CI for ocaml-freestanding, mirage-solo5 and their dependencies. Unfortunately, the EXTRA_DEPS step happens after the initial package installation, which leads to:

  1. First, OPAM picks a random -bindings variant in order to satisfy dependencies.
  2. Second, the package under test is installed.
  3. Third, the EXTRA_DEPS are processed, the previously installed variant is removed if it does not match, and the requested variant is installed, with the package under test getting re-compiled.

Unfortunately, this causes Travis CI builds to effectively behave in a non-deterministic fashion due to (1), which makes it very hard to debug failures and impossible to ascertain that the build job in question is doing what it's asked to (build a particular variant).

I've also tried PRE_INSTALL_HOOK instead of EXTRA_DEPS, but that seems to have the same behaviour.

/cc mirage/mirage#992 @samoht

mato avatar Sep 24 '19 14:09 mato

Have you tried DEPOPTS?

kit-ty-kate avatar Sep 24 '19 14:09 kit-ty-kate

DEPOPTS also gets evaluated late, after the package under test is installed. See eg https://travis-ci.org/mirage/mirage-net-solo5/jobs/589027444

mato avatar Sep 24 '19 16:09 mato