Open LucaFranceschini opened 6 years ago
opam is telling you what constraints failed while it searched packages to attempt to solve the installation, not repeating constraints from the description itself. What is confusing is that it doesn't tell you the actual version it was considering, but I think there's a reason for that.
The fundamental problem here is that ocp-index
is not available for 4.07.0. It's not displaying the ">= 4.01.0"
because your switch satisfies that constraint.
The other ones arise from when the solver considers other versions of ocaml-top
. The second one arose when it considered ocaml-top 1.1.0, since it contains an unsatisfiable dependency on ocp-build, caused by https://github.com/ocaml/opam-repository/pull/3491, and the first when ocaml-top 1.1.4 was considered (which is the only version which has an upperbound on the compiler version)
opam is telling you what constraints failed while it searched packages to attempt to solve the installation, not repeating constraints from the description itself. What is confusing is that it doesn't tell you the actual version it was considering, but I think there's a reason for that.
The fundamental problem here is that
ocp-index
is not available for 4.07.0. It's not displaying the">= 4.01.0"
because your switch satisfies that constraint.The other ones arise from when the solver considers other versions of
ocaml-top
. The second one arose when it considered ocaml-top 1.1.0, since it contains an unsatisfiable dependency on ocp-build, caused by ocaml/opam-repository#3491, and the first when ocaml-top 1.1.4 was considered (which is the only version which has an upperbound on the compiler version)
Ok, the real issue is the last one, this makes sense. Thanks.
The search for other versions of the requested package is honestly quite surprising for a package manager: I would expect the install command to either use the last version of the requested package or to fail. Is this documented somewhere?
At the very least, I think it should print a message regarding what's going on.
The search for other versions of the requested package is honestly quite surprising for a package manager: I would expect the install command to either use the last version of the requested package or to fail. Is this documented somewhere?
It's not surprising - any package manager with a constraint solver will do this. In particular, the current model means that you can continue to install packages in old versions of OCaml.
I'm not sure, @AltGr - is there enough information present to display the (or a) version of the package which is causing a particular constraint?
It's not surprising - any package manager with a constraint solver will do this. In particular, the current model means that you can continue to install packages in old versions of OCaml.
It never happened to me with any other package manager, not by default at least.
Don't get me wrong, I get the usefulness of this feature. I just think that, whenever this happens, a package manager should clearly say that it failed to install the last version, which is what people expect from an "install" command.
I'm also finding the messaging of dependency resolution failures to be less helpful than they might otherwise be. What does the →
indicate in the message? It apparently doesn't mean "depends on" or "implies". Is it documented somewhere? Why is the last package in each line red? When it says "no version of foo satisfies the constraints", which part of the output is imposing the constraints?
What would be really helpful is a message like: "cannot install package foo
because bar
requires baz < 0.1
but qux
requires baz > 0.1
. Failing that, linking to some resource that explains how to decode this cryptic message would be helpful.
I just installed opam:
Installing ocaml-top fails as follows:
I am not sure I understand the messages here:
ocaml-top → ocaml < 4.06.0
but the ocaml dependency is>=4.02.0
ocaml-top → ocp-build (< 1.99.8-beta | < 1.99.8-beta)
this looks obviously redundant, and ocp-build is not a (direct) dependencyocaml-top → ocp-index >= 1.0.0 → ocaml < 4.07
the last bit apparently should be>=4.01.0 & <4.07
What am I missing?