RejectedSoftware Forums

Sign up

How do versions work in dub

Hi,

I really like dub (most of the time :) ).
At the moment I wonder how the version specifiers work and what best
practices would be:
I have a library, that uses unit-threaded in its test-configurations in
a specific version e.g. dependency "unit-threaded" version="==0.7.31"

I have another executable that uses my library, but specifies a
different unit-threaded version for its test-configurations. Can this
lead to problems and is this the reason that the documentation talk most
of the time about ~= to specify version numbers?

The case of the test-configurations is just an example, same question
applies to regular dependencies :)

Kind regards,
Christian

Re: How do versions work in dub

Am 11.10.2017 um 09:20 schrieb Christian Köstlin:

Hi,

I really like dub (most of the time :) ).
At the moment I wonder how the version specifiers work and what best
practices would be:
I have a library, that uses unit-threaded in its test-configurations in
a specific version e.g. dependency "unit-threaded" version="==0.7.31"

I have another executable that uses my library, but specifies a
different unit-threaded version for its test-configurations. Can this
lead to problems and is this the reason that the documentation talk most
of the time about ~= to specify version numbers?

The case of the test-configurations is just an example, same question
applies to regular dependencies :)

Kind regards,
Christian

Yes, this is the main reason. In the beginning, the example on the
registry used straight "==1.0.0" and it lead to a very fragmented eco
system where you'd often get version conflicts and "couldn't" use a lot
of packages together.

In theory, since versions are defined to adhere to the SemVer semantics,
even "~>1.0" would be sufficiently specific, but endorsing just
"~>1.0.0" appears to already resolve the typical conflicts in practice,
at least from my limited experience with various packages.