Libraries, versions, API changes, and Dub

Jacob Carlborg doob at me.com
Thu Jan 10 10:53:07 UTC 2019


On 2019-01-10 06:44, Russel Winder wrote:
> It appears that libdvbv5 has undergone an (unnoticed by me till just now)
> version change. This raises a general question for creators of D bindings.
> 
> libdvbv5 has versions 1.12.x, 1.14.x, 1.16.x, etc, following the "odd is
> internal, even is released" minor version number strategy. It seems wrong
> somehow to follow that numbering for the D binding; the binding needs to have
> a separate evolution. However the binding has to allow the user to choose the
> major.minor number of the underlying library they have – though that should
> perhaps be done automatically using the pkg-config system.
> 
> Has anyone had previous experience of this situation and can give
> advice/direction so I don't have to build a solution from first principles?

If you only support one version of libdvbv5 for each version of the 
bindings, it will be much easier. If someone wants to use an older 
version of libdvbv5 than the bindings support they can use and older 
version of the bindings.

But as long as symbols aren't removed in later versions of libdvbv5 the 
newest versions of the bindings can be used. Even if a symbol is 
removed, it shouldn't be a problem until it's used.

As for setting the version on the bindings you can do something like: 
1.0.0+1.16.0. Where "1.0.0" is the version of the bindings and "1.16.0" 
is the version of libdvbv5 the bindings support. Anything after "+" in 
semantic versioning is metadata and doesn't have any affect.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list