After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770275 - Add soname and API versioning
Add soname and API versioning
Status: RESOLVED FIXED
Product: gnome-autoar
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Autoar maintainer(s)
GNOME Autoar maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-08-23 12:25 UTC by Carlos Soriano
Modified: 2016-08-23 16:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
configure: provide soname (1.38 KB, patch)
2016-08-23 12:25 UTC, Carlos Soriano
none Details | Review
general: add API versioning (7.07 KB, patch)
2016-08-23 12:25 UTC, Carlos Soriano
none Details | Review
configure: use semantic versioning (908 bytes, patch)
2016-08-23 15:28 UTC, Carlos Soriano
none Details | Review
configure: provide soname (1.20 KB, patch)
2016-08-23 15:28 UTC, Carlos Soriano
none Details | Review
general: add API versioning (9.41 KB, patch)
2016-08-23 15:28 UTC, Carlos Soriano
none Details | Review
configure: use semantic versioning (908 bytes, patch)
2016-08-23 16:17 UTC, Carlos Soriano
committed Details | Review
configure: provide soname (1.20 KB, patch)
2016-08-23 16:17 UTC, Carlos Soriano
committed Details | Review
general: add API versioning (8.92 KB, patch)
2016-08-23 16:17 UTC, Carlos Soriano
committed Details | Review

Description Carlos Soriano 2016-08-23 12:25:32 UTC
.
Comment 1 Carlos Soriano 2016-08-23 12:25:36 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.
Comment 2 Carlos Soriano 2016-08-23 12:25:42 UTC
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.
Comment 3 Emmanuele Bassi (:ebassi) 2016-08-23 12:36:15 UTC
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.
Comment 4 Emmanuele Bassi (:ebassi) 2016-08-23 12:40:20 UTC
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).
Comment 5 Emmanuele Bassi (:ebassi) 2016-08-23 12:53:55 UTC
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*.
Comment 6 Emmanuele Bassi (:ebassi) 2016-08-23 12:57:16 UTC
[ 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.
Comment 7 Michael Catanzaro 2016-08-23 13:28:00 UTC
(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.
Comment 8 Michael Catanzaro 2016-08-23 13:36:52 UTC
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.
Comment 9 Carlos Soriano 2016-08-23 14:10:35 UTC
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
Comment 10 Michael Catanzaro 2016-08-23 14:25:10 UTC
Undefined variables expand to harmless empty strings. Sad!
Comment 11 Carlos Soriano 2016-08-23 15:28:03 UTC
Created attachment 334010 [details] [review]
configure: use semantic versioning
Comment 12 Carlos Soriano 2016-08-23 15:28:08 UTC
Created attachment 334011 [details] [review]
configure: provide soname

We were missing soname versioning, which is necessary for distributions.

Thanks Michael Catanzaro for the help.
Comment 13 Carlos Soriano 2016-08-23 15:28:14 UTC
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.
Comment 14 Carlos Soriano 2016-08-23 16:17:06 UTC
Created attachment 334019 [details] [review]
configure: use semantic versioning
Comment 15 Carlos Soriano 2016-08-23 16:17:13 UTC
Created attachment 334020 [details] [review]
configure: provide soname

We were missing soname versioning, which is necessary for distributions.

Thanks Michael Catanzaro for the help.
Comment 16 Carlos Soriano 2016-08-23 16:17:19 UTC
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.
Comment 17 Carlos Soriano 2016-08-23 16:40:36 UTC
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