nonsensical unresolvable dependencies message
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 : That would be a good target for a unittest with the new system. Would you like to have a go at it ?
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.
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.
- 2 libraries need to have the same dependency
- A library version of the dependency needs to exist that can resolve one of them but is too high for the other one
- The one that can get resolved with a higher version must be resolved first by dub
~~Here is a minimal set of files to reproduce the problem~~
I wrote a reproduction test case at #2959 :)