-
Notifications
You must be signed in to change notification settings - Fork 295
Description
Describe the bug
The way that exiv2 sets the minor version information of its dynamic library on macOS (current version and compatibility version) makes no sense.
A library's current version and compatibility version are supposed to be of the same kind. For example:
- If you introduce version 5.0.0 of a library and it is not compatible with previous versions of the library (perhaps because you have removed public symbols that used to be in version 4.x of the library), you would set both the current version and the compatibility version to 5.0.0. If you have library version 5.0.0 and you try to run a program that was linked back when you had library version 4.x, the program will fail to run; the OS will print an error saying the program requires an earlier version of the library. (Or perhaps recompiling the program is enough to work with library version 5.x.)
- If you then release a bugfix version 5.0.1 that doesn't change what symbols are exported, then the library is still compatible with 5.0.0, so you would set current version 5.0.1 and compatibility version 5.0.0. The program you compiled using library version 5.0.0 will continue to run fine with library 5.0.1.
- If you then release new features in 5.1.0 by introducing new symbols, you're still compatible with 5.0.0, so you would set current version 5.1.0 compatibility version 5.0.0. The program you compiled using library version 5.0.0 or 5.0.1 will continue to run fine with library 5.1.0.
A well-designed library need never increase its compatibility version. Many macOS system libraries still have their compatibility version set to 1.0.0, over 20 years after the first release. For example:
$ otool -L /usr/lib/libSystem.B.dylib | head -n 2
/usr/lib/libSystem.B.dylib:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
Given this understanding of how current version and compatibility version should be set, the way that these values of libexiv2.dylib are set obviously makes no sense:
$ otool -L build/lib/libexiv2.dylib | head -n 2
build/lib/libexiv2.dylib:
/opt/local/lib/libexiv2.27.dylib (compatibility version 27.0.0, current version 0.27.5)
You are claiming to be version "0.27.5" but compatible with version "27.0.0".
Unfortunately I don't know cmake generally or the exiv2 build system specifically well enough to say where these values are being set.
To Reproduce
Steps to reproduce the behavior:
- Build exiv2 0.27.5 on macOS
- Check the library version information using
otool -L
Expected behavior
Sensible values of current version and compatibility version should be visible. At minimum, that means that current version is greater than or equal to compatibility version.
Desktop (please complete the following information):
- OS and version: macOS 10.15.7
- Compiler and version: irrelevant, but it's Apple clang version 12.0.0 (clang-1200.0.32.29)
- Compilation mode and/or compiler flags: