dub icon indicating copy to clipboard operation
dub copied to clipboard

nonsensical unresolvable dependencies message

Open WebFreak001 opened this issue 2 years ago • 1 comments

in my project:

   Upgrading project in /home/webfreak/dev/serve-d/
Error Unresolvable dependencies to package automem:
  cachetools 0.4.1 depends on automem >=0.0.0
  concurrency 5.0.3 depends on automem 0.6.4

while obviously automem 0.6.4 would satisfy the printed constraints.

When trying to dub upgrade a package with the following recipe contents:

dependency "cachetools" version="0.4.1"
dependency "concurrency" version="5.0.3"

the error messages get even worse:

   Upgrading project in /tmp/a/
Error Unresolvable dependencies to package unit-threaded:
  automem 0.6.4 depends on unit-threaded >=0.0.0
  automem 0.6.4 depends on unit-threaded >=0.0.0
  automem 0.6.4 depends on unit-threaded >=0.0.0
  cachetools 0.4.1 depends on unit-threaded ~>0
  concurrency 5.0.3 depends on unit-threaded >=0.0.0
  concurrency 5.0.3 depends on unit-threaded >=0.0.0
  concurrency 5.0.3 depends on unit-threaded >=0.0.0
  ikod-containers 0.0.22 depends on unit-threaded >=0.0.0

WebFreak001 avatar Sep 11 '23 11:09 WebFreak001

@WebFreak001 : That would be a good target for a unittest with the new system. Would you like to have a go at it ?

Geod24 avatar Dec 28 '23 16:12 Geod24

Almost a year later it's still an issue. Same, dub upgrade with serve-d:

Error Unresolvable dependencies to package libdparse:
  libddoc 0.8.0 depends on libdparse >=0.13.0 <1.0.0
  serve-d:workspace-d ~master depends on libdparse ~>0.23.0

Without even "0.0.0" stuff above it somehow fails.

vladimmi avatar Aug 16 '24 21:08 vladimmi

I also stumbled with this problem

Error Unresolvable dependencies to package mir-linux-kernel:
  mir-random 2.2.19 depends on mir-linux-kernel >=1.0.0 <1.3.0
  vibe-d:crypto 0.9.8 depends on mir-linux-kernel ~>1.0.0

But I found what the problem source is. This problem triggers if a dependency can be resolved with a higher version that it's incompatible with the dependency of a library that still has not been resolved. This means that 3 things have to happen at the same time.

  1. 2 libraries need to have the same dependency
  2. A library version of the dependency needs to exist that can resolve one of them but is too high for the other one
  3. The one that can get resolved with a higher version must be resolved first by dub

grillo-delmal avatar Aug 18 '24 00:08 grillo-delmal

~~Here is a minimal set of files to reproduce the problem~~

I wrote a reproduction test case at #2959 :)

grillo-delmal avatar Aug 18 '24 00:08 grillo-delmal