ElementsProject / libwally-core

Useful primitives for wallets
Other
280 stars 134 forks source link

Version info not working correctly #438

Closed jgriffiths closed 7 months ago

jgriffiths commented 7 months ago

In src/Makefile.am we now have:

LT_VER_CURRENT = 2   # increment at every ABI change (whether breaking or non-breaking)
LT_VER_REVISION = 0  # increment at every release, but reset to 0 at every ABI change
LT_VER_AGE = 1       # increment at every ABI change, but reset to 0 if breaking
# The library filename will be "libwallycore.so.$((current-age)).$((age)).$((revision))",
# and the soname will be "libwallycore.so.$((current-age))".
# Do NOT try to make the library version-info follow the project release version number!
# Only follow the rules above, explained more fully at:
# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
libwallycore_la_LDFLAGS = -version-info $(LT_VER_CURRENT):$(LT_VER_REVISION):$(LT_VER_AGE)

These values were introduced in dbbf1538aebc31ffd72a5b4b26072eeadde20b27, and have been updated for version 1.1.0 with the expectation that the resulting DSO will be numbered .2.0.1 or possibly .2.1.0 if the comment in the makefile is correct,

However, building now results in the following in src/.libs:

src/.libs/libwallycore.so -> libwallycore.so.2.0.0
src/.libs/libwallycore.so.2 -> libwallycore.so.2.0.0
src/.libs/libwallycore.so.2.0.0

i.e. revision and age appear to be ignored.

It seems like the call to libtool is passing -version-info 2 :0 :1 for some reason, possibly to do with the colon character. However, if I manually change the call in makefile.am to pass 2:0:1 directly, I get the following in src/.libs:

libwallycore.so -> libwallycore.so.1.1.0
libwallycore.so.1 -> libwallycore.so.1.1.0
libwallycore.so.1.1.0

Which makes no sense to me at all.

I've tried various quoting options but no joy. @whitslack given the DSO versioning was added to support gentoo builds, can you take a look? I'm attempting to be a good citizen by bumping the version appropriately, but obviously that requires that this support works. This is mildly holding up the 1.1.0 release btw (I'm waiting for 2fa PyPI setup but otherwise the release is ready).

whitslack commented 7 months ago

Version-info of 2:0:1 should result in a .so.1.1.0; that is correct.

I suspect the problem with the spaces may be that Make is including the whitespace between the variable values and the comment characters. Try putting the comments on their own lines.

jgriffiths commented 7 months ago

Yep the comments were the problem, fixed and pushed, thanks!