opam icon indicating copy to clipboard operation
opam copied to clipboard

opam admin check --cycle --ignore-test-doc does not give accurate results

Open kit-ty-kate opened this issue 4 years ago • 4 comments

In https://github.com/ocaml/opam-repository/pull/18124 an attempt has been made to remove every cycle in opam-repository detected by opam admin check --cycle --ignore-test-doc. However this command does not seem to give correct results. For example on top of https://github.com/ocaml/opam-repository/pull/18124/commits/019b3aae52e800a4d61e3b9f9543f8eee459d59d, if I remove the {!= "1.3"} constraint from the result in dune-configurator.2.8.1, I get:

$ opam admin check --cycle --ignore-test-doc
[ERROR] Dependency cycles detected:
  * graphics = 5.1.0 → dune-configurator = 2.8.1 → result = 1.3 → jbuilder (>= 1.0+beta11 & < 1.0+beta19) → ocamlfind < 1.8.1
  * dune-configurator = 2.8.1 → result = 1.3 → jbuilder (>= 1.0+beta11 & < 1.0+beta19) → ocamlfind < 1.8.1 → graphics = 5.1.1
  * ocamlfind = 1.8.1 → graphics = 5.1.0 → dune-configurator = 2.8.1 → result = 1.3 → jbuilder (>= 1.0+beta11 & < 1.0+beta19)
Summary: out of 17092 packages (3210 distinct names)
- 32 packages part of dependency cycles

However this should not appear, as opam install --update-invariant rightfully points out:

$ opam install graphics.5.1.0 dune-configurator.2.8.1 result.1.3 jbuilder.1.0+beta11 ocamlfind.1.8.0 --update-invariant
[WARNING] Opam package conf-ncurses.1 depends on the following system package that can no longer be found: ncurses-dev
The following dependencies couldn't be met:
  - dune-configurator → csexp >= 1.3.0 → result >= 1.5

Is there a bug in the cycle detection by any chance?


opam version: 2.1.0~beta4

kit-ty-kate avatar Feb 11 '21 16:02 kit-ty-kate

Hm, it seems that the cycle is real in the dependency sense... but appears not to be co-installable. I'll see if that can be filtered out, but it might prove pretty tricky.

AltGr avatar Nov 08 '21 15:11 AltGr

I'm noticing a related issue, with (in a fresh switch with ocaml-base-compiler.4.13.0):

$ opam install graphics.5.1.2 ocamlfind.1.9.1 ocamlfind-secondary.1.9.1 dune.2.9.1 
[ERROR] Package conflict!
The actions to process have cyclic dependencies:
  - ∗ graphics.5.1.2 → ∗ ocamlfind.1.9.1 → ∗ ocamlfind-secondary.1.9.1 → ∗ dune.2.9.1 → ∗ graphics.5.1.2
  - ∗ graphics.5.1.2 → ∗ ocamlfind.1.9.1 → ∗ ocamlfind-secondary.1.9.1 → ∗ dune.2.9.1 → ∗ csexp.1.5.1 → ∗ dune-configurator.2.9.3 → ∗ graphics.5.1.2

even though ocamlfind does not depend on ocamlfind-secondary.

Armael avatar Feb 18 '22 18:02 Armael

@Armael the arrow should be viewed the otherway around (I know this is weird)

In this case:

  • graphics depends on dune
  • dune can depends on ocamlfind-secondary
  • ocamlfind-secondary depends on ocamlfind
  • ocamlfind depends optionally on graphics

kit-ty-kate avatar Feb 18 '22 18:02 kit-ty-kate

Ah! I see. So at least part of the bug is that dune is considered as depending on ocamlfind-secondary, but this is not actually the case, as we have ocaml >= 4.08 installed.

Armael avatar Feb 18 '22 18:02 Armael