www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dub: make ~>x.y.z mean >=x.y.z <(x+1).0.0 instead of >=x.y.z

reply Timothee Cour via Digitalmars-d <digitalmars-d puremagic.com> writes:
I often run into breakages when building dub packages due to a dependency
that uses "foo":
"~>x.y.z" that prevents using minor version bumps of "foo" (only patch
bumps). According to Semantic versioning [http://semver.org/], minor
version bumps should be allowed (only major version bumps would be
backwards incompatible).

The proposed change [https://github.com/dlang/dub/pull/1038] would make
~>x.y.z mean >=x.y.z <(x+1).0.0 instead of >=x.y.z <x.(y+1).z
It fixes a lot of breakages I run into when using dub.

Concerns?
Jan 01
parent Jacob Carlborg <doob me.com> writes:
On 2017-01-02 03:06, Timothee Cour via Digitalmars-d wrote:
 I often run into breakages when building dub packages due to a
 dependency that uses "foo":
 "~>x.y.z" that prevents using minor version bumps of "foo" (only patch
 bumps). According to Semantic versioning [http://semver.org/], minor
 version bumps should be allowed (only major version bumps would be
 backwards incompatible).

 The proposed change [https://github.com/dlang/dub/pull/1038] would make
 ~>x.y.z mean >=x.y.z <(x+1).0.0 instead of >=x.y.z <x.(y+1).z
 It fixes a lot of breakages I run into when using dub.

 Concerns?
Yes. If you import two modules from a library, "foo" and "bar". You're using function "a" from "foo" and function "b" from "bar". At a later point the library adds a new function, "a" in the module "bar". From the library's point of view this is perfectly fine and it bumps the minor version because it only adds new API, not removing anything. But, because you import both "foo" and "bar", you'll now have a conflict and your code doesn't compile anymore. According to the documentation [1]. You can use "~>x.y" do get what you want, as far as I understand. What I don't understand is how the current behavior can cause breakages for you. Isn't your problem with gtkd that the subpackage didn't have the correct version specified? [1] http://code.dlang.org/package-format?lang=sdl -- /Jacob Carlborg
Jan 01