Skip to content

Commit

Permalink
Minimal example of DUB dependency clashes
Browse files Browse the repository at this point in the history
This is a simple example of the dependency resolution failure described
in dlang/dub#1732.  Running `dub build` fails
with the error:

    Unresolvable dependencies to package taggedalgebraic:
      eventcore 0.8.43 depends on taggedalgebraic >=0.10.12 <0.12.0-0
      std_data_json 0.18.3 depends on taggedalgebraic ~>0.10.1

The reported failure in fact has an easily recognizable resolution, but
for some reason DUB is unable to find it.  It is not 100% clear if this
is the real dependency clash or not, but it is interesting to note that
if `dep2` (which has no dependencies of its own) is removed from the
list of dependencies of the main project, the resolution failure also
disappears.
  • Loading branch information
joseph-wakeling-frequenz committed Jul 17, 2019
0 parents commit 701940d
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dep1/dub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "dep1",

"targetType": "sourceLibrary",

"dependencies": {
"std-experimental-xml": ">=0.1.7 <0.2.0",
"unit-threaded:assertions": ">=0.8.0 <0.10.0"
}
}
6 changes: 6 additions & 0 deletions dep1/src/dep1.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module dep1;

string foo ()
{
return "foo";
}
4 changes: 4 additions & 0 deletions dep2/dub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "dep2",
"targetType": "sourceLibrary"
}
6 changes: 6 additions & 0 deletions dep2/src/dep1.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module dep1;

string foo ()
{
return "foo";
}
19 changes: 19 additions & 0 deletions dub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "vibe-deps-failure",
"authors": ["Joseph Wakeling"],
"description": "Simple example of DUB dependency resolution failure",

"dependencies": {
"dep1": { "path": "dep1" },
"dep2": { "path": "dep2" },
"std_data_json": ">=0.18.3 <0.19.0",
"pyd": ">=0.10.5 <0.11.0",
"vibe-core": ">=1.6.0 <2.0.0",
"vibe-d:redis": ">=0.8.4 <0.9.0",
"vibe-d:tls": ">=0.8.4 <0.9.0"
},
"subConfigurations": {
"pyd": "python36",
"vibe-d:tls": "openssl-1.1"
}
}
6 changes: 6 additions & 0 deletions src/app.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
void main ()
{
import dep1 : foo;
import std.stdio : writefln;
writefln!"Hello, I'm just a stub for %s"(foo());
}

0 comments on commit 701940d

Please sign in to comment.