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

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

Open
kit-ty-kate opened this issue Feb 11, 2021 · 4 comments
Assignees
Projects

Comments

@kit-ty-kate
Copy link
Member

kit-ty-kate commented Feb 11, 2021

In ocaml/opam-repository#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 ocaml/opam-repository@019b3aa, 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

@AltGr
Copy link
Member

AltGr commented Nov 8, 2021

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.

@dra27 dra27 modified the milestones: 2.1.2, 2.1.3 Nov 19, 2021
@kit-ty-kate kit-ty-kate removed this from To do in Opam 2.1.x Dec 31, 2021
@kit-ty-kate kit-ty-kate removed this from the 2.1.3 milestone Dec 31, 2021
@dra27 dra27 removed this from To do in Opam 2.2.0 Jan 14, 2022
@dra27 dra27 added this to To do in Opam 2.3 via automation Jan 14, 2022
@Armael
Copy link
Member

Armael commented Feb 18, 2022

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.

@kit-ty-kate
Copy link
Member Author

@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

@Armael
Copy link
Member

Armael commented Feb 18, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Opam 2.3
  
To do
Development

No branches or pull requests

4 participants