Range of dub package versions

ShadoLight ettienne.gilbert at gmail.com
Mon Dec 28 23:29:02 UTC 2020


I can build my app using dub, which has a dependency on the 
particular version of dlangui that was available when I 
originally created the project:

	"dependencies": {
		"dlangui": "~>0.9.182",
		...etc..
	},

I've recently noticed that the dlangui package is now on v0.9.186.

According to [1] this means:

"Restrict to a certain minor version: "~>2.2.13", equivalent to 
">=2.2.13 <2.3.0""

which I understood means that a 'dub build' would automatically 
download and use this latest version (well, up to v0.10.0 anyway).

But I probably misunderstood this - since this does not happen 
and a 'dub build' still reports:

dlangui 0.9.182: target for configuration "default" is up to date.

Is this behaviour correct?

If it is, then does this not imply that one still have to 
manually track and update the json file each time a dependency 
package is updated (if you want to stick with the latest 
version)? Note that I do understand that, if I had v0.9.186 
package on my machine, the same json file (that specifies 
"~>0.9.182") will still work and actually use this version of the 
package.

But the thing is, how would I get v0.9.186 on my machine except 
by doing a explicit 'dub fetch/add' step?  What then is the 
advantage to the "~>0.9.182" syntax compared with simply 
specifying the actual version (as in "dlangui": "==0.9.182" if it 
anyway boils down to a tracking dependency versions manually?

What am I missing?

[1] https://dub.pm/package-format-json.html#version-specs


More information about the Digitalmars-d-learn mailing list