GNOME Bugzilla – Bug 770275
Add soname and API versioning
Last modified: 2016-08-23 16:40:48 UTC
.
Created attachment 334002 [details] [review] configure: provide soname We were missing soname versioning, which is necessary for distributions. Thanks Michael Catanzaro for the help.
Created attachment 334003 [details] [review] general: add API versioning So we can have the proper API version in the package name for proper linking to gnome-autoar. Thanks Michael Catanzaro for the help.
Review of attachment 334002 [details] [review]: ::: configure.ac @@ +25,3 @@ +dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html +AC_SUBST([LIBGNOME_AUTOAR_LT_VERSION], [0:0:0]) +dnl increment age. I have to admit I prefer the GTK-like approach of computing these values from the version, e.g. # reset to 0 at the beginning of a development cycle # increment by 1 for every stable micro release interface_age = 0 binary_age = m4_eval([100 * minor_version + micro_version]) lt_current = m4_eval([binary_age - interface_age]) lt_revision = interface_age lt_age = m4_eval([binary_age - interface_age]) AC_SUBST([LIBGNOME_AUTOAR_LT_VERSION], [lt_current:lt_revision:lt_age]) It's unclear, in the usual c:r:a scheme, as to what constitutes an "interface"; a GObject-based library has run-time ABI like adding new interfaces, signals, and properties. It also has a specific Introspection ABI that is caused by changing annotations. Using the version numbers allows you to tie the ABI to the development/stable cycles instead, and avoid unnecessary SONAME bumps — or, worse, forgetting SONAME bumps because you simply changed the annotations of a method.
Review of attachment 334003 [details] [review]: This won't work as you may think it does. autoconf will replace @LIBGNOME_AUTOAR_API_VERSION@ with "0.1" but automake expects targets to be in the form of 0_1. In some compatibility cases, it will work anyway, but it may break in other cases. You'll need a @LIBGNOME_AUTOAR_API_VERSION_AM@ which expands to "0_1", but I have to admit I find all this mess very hard to read when fixing the build system; it's likely easier to resort to search and replace when bumping the API (something I don't expect to happen very often).
The _AM variant of the API version macro is needed when deal with the introspection generation; the variables undergo a double expansion, so they must be in the final, underscore separated form, otherwise automake/make will barf all over the build. Yes, expansion rules in autoconf/automake/make are *awesome*.
[ Sorry, keep thinking about this after hitting Submit ] Counter-proposal: use a single digit for the API, e.g. libgnome-autoar0.so.0... libgnome-autoar1.so.0... libgnome-autoar2.so.0... You could either use the micro version, and keep the major version at 0; or you can bump up the major version at every cycle, instead of bumping the minor one. Both options would simplify the overall versioning scheme, as well as the build system.
(FWIW I never understood the GTK+ libtool versioning scheme; it's nontraditional, to say the least.) (In reply to Emmanuele Bassi (:ebassi) from comment #6) > [ Sorry, keep thinking about this after hitting Submit ] > > Counter-proposal: use a single digit for the API, e.g. > > libgnome-autoar0.so.0... > libgnome-autoar1.so.0... > libgnome-autoar2.so.0... I guess this solves the underscore problem nicely. Good catch... I'll also update libgnome-games-support.
Review of attachment 334003 [details] [review]: You also need to rename the .pc.in file (and adjust the filename in AC_CONFIG_FILES in configure.ac). ::: Makefile.am @@ +90,3 @@ + -version-info $(LIBGAMES_SUPPORT_LT_VERSION) \ + -no-undefined \ + $(LIBGAMES_SUPPORT_LIBS) $(LIBGAMES_SUPPORT_LIBS) :) Remember that pkg-config LIBS stuff should be added to LIBADD anyway, not LDFLAGS.
Review of attachment 334003 [details] [review]: ::: Makefile.am @@ +90,3 @@ + -version-info $(LIBGAMES_SUPPORT_LT_VERSION) \ + -no-undefined \ + $(LIBGAMES_SUPPORT_LIBS) omg how did this slipped in :) and it actually distchecked
Undefined variables expand to harmless empty strings. Sad!
Created attachment 334010 [details] [review] configure: use semantic versioning
Created attachment 334011 [details] [review] configure: provide soname We were missing soname versioning, which is necessary for distributions. Thanks Michael Catanzaro for the help.
Created attachment 334012 [details] [review] general: add API versioning So we can have the proper API version in the package name for proper linking to gnome-autoar. Thanks Michael Catanzaro for the help.
Created attachment 334019 [details] [review] configure: use semantic versioning
Created attachment 334020 [details] [review] configure: provide soname We were missing soname versioning, which is necessary for distributions. Thanks Michael Catanzaro for the help.
Created attachment 334021 [details] [review] general: add API versioning So we can have the proper API version in the package name for proper linking to gnome-autoar. Thanks Michael Catanzaro for the help.
Did my best, hope it is fine now :) Thanks for the help Attachment 334019 [details] pushed as 29e0fc6 - configure: use semantic versioning Attachment 334020 [details] pushed as 848a42a - configure: provide soname Attachment 334021 [details] pushed as 1355e67 - general: add API versioning