RejectedSoftware Forums

Sign up

Dub fetches every version of a dependency and then uses the wrong one

I have a dub.json containing this
{
"name": "plot2kill",
"description": "2D Plotting Library for D",
"authors": ["David Simcha", "Jordi Sayol"],
"homepage": "https://github.com/dsimcha/Plot2kill",
"license": "BSL-1.0",
"excludedSourceFiles" : ["source/plot2kill/demotest.d"],

"targetType": "library",
"dependencies": { "gtk-d": "~Gtk2" }
}

Which seems simple enough. However:

$ dub build
Fetching gtk-d ~master...
Placing gtk-d ~master to /home/john/.dub/packages/...
Fetching gtk-d 2.3.2...
Placing gtk-d 2.3.2 to /home/john/.dub/packages/...
Fetching gtk-d 2.3.1...
Placing gtk-d 2.3.1 to /home/john/.dub/packages/...
Fetching gtk-d 2.3.0...
Placing gtk-d 2.3.0 to /home/john/.dub/packages/...
Fetching gtk-d 1.7.4...
Placing gtk-d 1.7.4 to /home/john/.dub/packages/...
Fetching gtk-d ~GtkD2.3...
Placing gtk-d ~GtkD
2.3 to /home/john/.dub/packages/...
Fetching gtk-d ~Gtk2...
Placing gtk-d ~Gtk2 to /home/john/.dub/packages/...
Fetching gtk-d 1.7.4...
Placing gtk-d 1.7.4 to /home/john/.dub/packages/...
Package gtk-d:vte 1.7.4 was found neither locally, nor in the configured package registries.
Fetching gtk-d ~Gtk2...
Placing gtk-d ~Gtk2 to /home/john/.dub/packages/...
Package gtk-d:vte ~Gtk2 was found neither locally, nor in the configured package registries.
WARNING: A deprecated branch based version specification is used for the dependency gtk-d. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
Building gtk-d:gtkdgl ~master configuration "library", build type debug.
Running dmd...
Building gtk-d:sv ~master configuration "library", build type debug.
Running dmd...
Building gtk-d:vte ~master configuration "library", build type debug.
Running dmd...
Building gtk-d:gtkd ~master configuration "library", build type debug.
Running dmd...
Building gtk-d:gstreamer ~master configuration "library", build type debug.
Running dmd...
Building plot2kill ~master configuration "library", build type debug.
Running dmd...
source/plot2kill/subplot.d(437): Error: module Drawable is in file 'gdk/Drawable.d' which cannot be read
import path[0] = source/
import path[1] = ../../.dub/packages/gtk-d-master/src/
import path[2] = /home/john/Installations/dmd/import
FAIL .dub/build/library-debug-linux.posix-x86_64-dmd-2C4CBD8BBB93C0B750829CD2E00AADCE/ plot2kill staticLibrary
Error executing command build: dmd failed with exit code 1

There are some problems with the Gtk2 package.json but the above behaviour still doesn't seem right. If I said I wanted Gtk2 branch and it finds a problem with it, it shouldn't just default to the master branch, it should error and stop.

Re: Dub fetches every version of a dependency and then uses the wrong one

On Wed, 30 Apr 2014 09:35:19 GMT, John Colvin wrote:

I have a dub.json containing this
{
"name": "plot2kill",
"description": "2D Plotting Library for D",
"authors": ["David Simcha", "Jordi Sayol"],
"homepage": "https://github.com/dsimcha/Plot2kill",
"license": "BSL-1.0",
"excludedSourceFiles" : ["source/plot2kill/demotest.d"],

"targetType": "library",
"dependencies": { "gtk-d": "~Gtk2" }
}

Which seems simple enough. However:

(...)

There are some problems with the Gtk2 package.json but the above behaviour still doesn't seem right. If I said I wanted Gtk2 branch and it finds a problem with it, it shouldn't just default to the master branch, it should error and stop.

Commit 2e1f98a fixes downloading of all gtk-d versions. Everything compiles fine now, so I'm not sure if the second issue with selecting the wrong branch is still present.