On Fri, 02 May 2014 14:30:31 GMT, Sönke Ludwig wrote:

I think you may have an older preview version of DUB 0.9.22. There have been a number of fixes since the last beta (will get out another one shortly).

How it should work now is that you can GIT checkout a repository and "add-local" (without an explicit version) or "add-path" register it to DUB. The version of that local working copy will then be determined using the latest version tag instead of simply using the branch name, if possible.

In vibe.d's example, this would be something like vibe-d 0.7.20-alpha.1+commit.72.g2be4cce. Running dub upgrade --prerelease will then automatically update dub.selections.json properly if the dependency has been specified as a proper range, such as "~>0.7.19" (equivalent to ">=0.7.19 <0.8.0"). Manually editing dub.selections.json works now properly, too (it only overwrites entries now if they don't match any existing version).

dub's ~master works for the vibe.d version selection (yay!), but it breaks the build:

$ dub build               
Target vibe-d 0.7.20-alpha.1.72.g2be4cce is up to date. Use --force to rebuild.
Target ddb 0.1.0 is up to date. Use --force to rebuild.
Building www.luismarques.eu ~master configuration "dev-osx", build type debug.
Compiling...
Error: cannot read file app.d

BTW, I keep forgetting which dub version I have installed at a given time because there's an issue with the dub package for my package manager, homebrew. I tried to fix it, but did not succeed. I have asked for help; I was going to put here a link for the help email, but I don't see it yet in the archives (http://librelist.com/browser/homebrew/), so let me quote it:

I haven't found a way yet to fix the following issue. The software 'dub' has a build.sh shell script which writes the git version to a source file before compiling the software:

(...)
echo Generating version file...
GITVER=$(git describe) || GITVER=unknown
echo "module dub.version; enum dubVersion = \"$GITVER\";" > source/dub/version.d
(...)

Because homebrew copies the files outside of the git repo before doing a 'system "./build.sh"', that mechanism fails to generate the version, so the command 'dub help' says 'DUB version unknown'.

I'm not sure how to fix this. I thought about doing a custom/derived GitDownloadStrategy, although that seems a bit hackish, but I wasn't able to make that work anyway (if I recall correctly I was having problems with the homebrew paths; not knowing Ruby doesn't help).

Any suggestions on a good way to address this issue?

Just so you are aware of this issue, or in case anyone here knows how to solve this :-)