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

snappy 1.2.0 removed __ZN6snappy11RawCompressEPKcmPcPm from libsnappy #183

Closed
ryandesign opened this issue May 21, 2024 · 4 comments
Closed

Comments

@ryandesign
Copy link

ryandesign commented May 21, 2024

Thank you for opening the issue tracker!

MacPorts recently updated to snappy 1.2.0 and @justinbb reported to us today that snappy 1.2.0 removes a symbol which existed in 1.1.10. The user discovered this by trying to run qgis3 after updating snappy to 1.2.0:

Symbol not found: __ZN6snappy11RawCompressEPKcmPcPm
Referenced from: <6B4C63E9-F153-35F2-B6E3-9B70D5205EB7> /opt/local/lib/libleveldb.1.23.0.dylib
Expected in:     <21F5B8CD-DE83-3E89-BC9F-C6F6CD66E239> /opt/local/lib/libsnappy.1.1.10.dylib

The versioning of libsnappy from snappy 1.2.0 on macOS as installed by MacPorts was:

% otool -L /opt/local/lib/libsnappy.1.dylib
/opt/local/lib/libsnappy.1.dylib:
	/opt/local/lib/libsnappy.1.dylib (compatibility version 1.0.0, current version 1.1.10)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)

The library current version of 1.1.10 was a mistake corrected in #178. After applying that fix, the versioning is now:

% otool -L /opt/local/lib/libsnappy.1.dylib
/opt/local/lib/libsnappy.1.dylib:
	/opt/local/lib/libsnappy.1.dylib (compatibility version 1.0.0, current version 1.2.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)

Translating, this means that you are providing minor version 1.2.0 of major version 1 of libsnappy and it claims it is backward compatible with all minor versions of major version 1 of the library back to version 1.0.0. In other words, if I compiled a program against libsnappy major version 1 minor version 1.0.0, that program should still work if the runtime version of libsnappy is major version 1 minor version 1.2.0. But the failure to launch qgis3 due to the removed symbol shows that claim is not accurate.

Isn't it customary that removing a public symbol from a library would be accompanied by increasing its major version? In other words, snappy 1.2.0 should have included libsnappy.2.dylib not libsnappy.1.dylib. This would have clearly communicated (via a message that libsnappy.1.dylib could not be found when opening a program linking with that library) that everything linking with the library needed to be rebuilt to remove any references to the removed symbol(s).

Caveat: if __ZN6snappy11RawCompressEPKcmPcPm was a private symbol that nobody should have been using, then the above does not apply and the fault would lie with whoever used your private symbol and should be solved by them not using that private symbol.

The problem is also mentioned at apache/arrow#41058 which refers to conda-forge/snappy-feedstock#35 which points the blame for the ABI break on 766d24c.

As an alternative to increasing the major library version to indicate the compatibility break, you could reinstate the removed symbol to restore compatibility and avoid the need to increase the major library version; if possible, this would be the least disruptive solution.

@ryandesign
Copy link
Author

you could reinstate the removed symbol to restore compatibility […] this would be the least disruptive solution

If you do this, you would also want to increase the compatibility minor version (the number you pass in the -compatibility_version flag) to 1.2.0 (from its current value of 1.0.0). After all, any program linked with library major version 1 minor version 1.2.0 or later will not run with library major version 1 minor versions earlier than 1.2.0 since they do not have the new __ZN6snappy11RawCompressEPKcmPcPmNS_18CompressionOptionsE symbol.

@danilak-G
Copy link
Collaborator

We discussed a bit. We will restore the symbols in 1.2.1. Usually all Google libraries support strong API compatibility with no promise of ABI https://abseil.io/about/compatibility. We understand from the long history of snappy that it created a case where enforcing will create more problems

@danilak-G
Copy link
Collaborator

https://github.com/google/snappy/releases/tag/1.2.1

pguyot added a commit to pguyot/macports-ports that referenced this issue May 21, 2024
Release eventually fixes ABI compatibility issue created by 1.2.0.
Remove patch accordingly.

See: google/snappy#183
Closes: https://trac.macports.org/ticket/70046

Signed-off-by: Paul Guyot <[email protected]>
ryandesign pushed a commit to macports/macports-ports that referenced this issue May 21, 2024
Release eventually fixes ABI compatibility issue created by 1.2.0.
Remove patch accordingly.

See: google/snappy#183
Closes: https://trac.macports.org/ticket/70046

Signed-off-by: Paul Guyot <[email protected]>
@ryandesign
Copy link
Author

Thanks!

id added a commit to id/erlang-rocksdb that referenced this issue May 30, 2024
id added a commit to id/emqx that referenced this issue May 30, 2024
- fix macos build google/snappy#183
- pre-built binaries for latest platforms
id added a commit to id/emqx that referenced this issue May 30, 2024
- fix macos build google/snappy#183
- pre-built binaries for latest platforms
dimhotepus pushed a commit to Source-Authors/snappy that referenced this issue Aug 1, 2024
gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Oct 18, 2024
 - 1.2.0 had an accidental ABI breakage, which is restored and fixed in 1.2.1
   which is ABI compatible with 1.1.
   google/snappy#183

Signed-off-by: Joonas Niilola <[email protected]>
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

No branches or pull requests

2 participants