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

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Sun Jan 1 23:57:57 PST 2017


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


More information about the Digitalmars-d mailing list