Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS dylib minor versions make no sense since 0.12.0 #758

Closed
ryandesign opened this issue Feb 25, 2023 · 1 comment · Fixed by #769
Closed

macOS dylib minor versions make no sense since 0.12.0 #758

ryandesign opened this issue Feb 25, 2023 · 1 comment · Fixed by #769

Comments

@ryandesign
Copy link

In 0.12.0 (6342f39?) you changed the library versioning in a way that does not make sense on macOS.

0.11.0:

% otool -L /opt/local/lib/librabbitmq.dylib
/opt/local/lib/librabbitmq.dylib:
	/opt/local/lib/librabbitmq.4.dylib (compatibility version 4.0.0, current version 4.5.0)
	/opt/local/libexec/openssl3/lib/libssl.3.dylib (compatibility version 3.0.0, current version 3.0.0)
	/opt/local/libexec/openssl3/lib/libcrypto.3.dylib (compatibility version 3.0.0, current version 3.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)

0.12.0:

% otool -L /opt/local/lib/librabbitmq.dylib
/opt/local/lib/librabbitmq.dylib:
	/opt/local/lib/librabbitmq.4.dylib (compatibility version 4.0.0, current version 0.12.0)
	/opt/local/libexec/openssl3/lib/libssl.3.dylib (compatibility version 3.0.0, current version 3.0.0)
	/opt/local/libexec/openssl3/lib/libcrypto.3.dylib (compatibility version 3.0.0, current version 3.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)

A macOS dynamic library has a major version (which is part of the filename) and a minor version (which are properties within the library file). A library advertises its current minor version, and a possibly earlier minor version with which it is compatible.

In 0.11.0, your library's major version was 4, and you advertised that its minor version was 4.5.0 and that it was compatible with minor library versions back to 4.0.0. In other words, any program that was compiled with librabbitmq major 4 minor 4.0.0 or later will work fine with librabbitmq major 4 minor 4.5.0.

In 0.12.0, the major version is unchanged but you now advertise that your current minor version is 0.12.0, which is less than the previous minor version; library versions should never decrease like that. You also still claim that major 4 minor 0.12.0 is backward compatible with major 4 minor 4.0.0, which makes no sense since 4.0.0 is a larger number than 0.12.0.

@alanxz
Copy link
Owner

alanxz commented Mar 14, 2023

The change was intensional to better align the meanings of version and SOVERSION; which on Linux allows for this sort of flexibility. What was not expected is that MacOS uses the VERSION in the way that it does, where this appears to make the version go backwards so that library selection doesn't work as expected.

As such I will adjust the next released version so that on MacOS the current-version > 4.5.0 (likely it'll be 4.14.0)

alanxz added a commit that referenced this issue Apr 30, 2023
Set the compatibility and current version strings on Mach-O (Apple)
platforms. The compatibility version remains the same as the SOVERSION,
the current version is SOVERSION.AGE.REVISION, which matches the
previous libtool semantics for this.

Fixes #758

Signed-off-by: GitHub <noreply@github.com>
alanxz added a commit that referenced this issue Apr 30, 2023
Set the compatibility and current version strings on Mach-O (Apple)
platforms. The compatibility version remains the same as the SOVERSION,
the current version is SOVERSION.AGE.REVISION, which matches the
previous libtool semantics for this.

Fixes #758

Signed-off-by: GitHub <noreply@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants