FS#80209 - [libimagequant] libimagequant.so.0 disappeared in 4.2.2-1
Attached to Project:
Arch Linux
Opened by Julian Brost (julian) - Thursday, 09 November 2023, 20:51 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Friday, 10 November 2023, 11:07 GMT
Opened by Julian Brost (julian) - Thursday, 09 November 2023, 20:51 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Friday, 10 November 2023, 11:07 GMT
|
Details
The symlink libimagequant.so.0 disappeared with the update
from libimagequant 4.2.1-1 to 4.2.2-1:
$ diff -us <(pacman -Qlp /var/cache/pacman/pkg/libimagequant-4.2.1-1-x86_64.pkg.tar.zst) <(pacman -Qlp /var/cache/pacman/pkg/libimagequant-4.2.2-1-x86_64.pkg.tar.zst) --- /proc/self/fd/11 2023-11-09 21:46:25.332303720 +0100 +++ /proc/self/fd/12 2023-11-09 21:46:25.332303720 +0100 @@ -3,8 +3,7 @@ libimagequant /usr/include/libimagequant.h libimagequant /usr/lib/ libimagequant /usr/lib/libimagequant.so -libimagequant /usr/lib/libimagequant.so.0 -libimagequant /usr/lib/libimagequant.so.0.0.0 +libimagequant /usr/lib/libimagequant.so.0.0.4 libimagequant /usr/lib/pkgconfig/ libimagequant /usr/lib/pkgconfig/imagequant.pc libimagequant /usr/share/ This results in the python-pillow package (10.1.0-1) no longer working properly: $ python -c 'from PIL import Image' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python3.11/site-packages/PIL/Image.py", line 82, in <module> from . import _imaging as core ImportError: libimagequant.so.0: cannot open shared object file: No such file or directory If the change in libimagequant was actually intentional, python-pillow probably needs a rebuild to link against libimagequant.so.0.0.4 instead. |
This task depends upon
Closed by Massimiliano Torromeo (mtorromeo)
Friday, 10 November 2023, 11:07 GMT
Reason for closing: Fixed
Friday, 10 November 2023, 11:07 GMT
Reason for closing: Fixed
https://github.com/ImageOptim/libimagequant/issues/109
FS#80210herePlus this issue is discussing cargo NOT building the shared object, not the soname change... so I doubt it is related, however the following might:
https://github.com/ImageOptim/libimagequant/commit/e509cf6577b2d7149ae37a93959ddaaf119cf3fa
Although it is difficult to figure out the offending commit(s) because of the poor commit naming. But within the `clippy` commits it appears there was some minor changes to the functions, which could cause ABI compatibility, so I assume that would explain the soname change... but yet why would you go from `0.0.0` to `0.0.4`?
It does seem like the commit above is the cause... but figuring out why this was changed is difficult.
Anyways I will leave it up to the package maintainers, just found this issue due to it breaking `gajim`.
C.f. https://github.com/lu-zero/cargo-c/issues/345
Yes, hence my remark about the tooling. The change breaks the usual lib versioning convention. Recompiling solves the immediate problem...but the end result looks fragile and basically "not right"...especially in view of this comment [1]
$ find-libprovides libimagequant-4.2.2-1-x86_64.pkg.tar.zst
libimagequant.so=0.0.4-64
[1] https://github.com/ImageOptim/libimagequant/pull/112#issuecomment-1760092104
I manually recreated the missing symlinks in libimagequant and tested PIL and libvips (pre-rebuild) and they work fine like that.
So for now I am releasing libimagequant-4.2.2-2 with this fix and hopefully cargo-c/libimagequant will fix themselves in the future.
I get the feeling that `cargo-c` will not be changed back to provide the behavior that's expected of C-ABI shared libraries. Unfortunately the extra symlinks also don't really help much here, other than for users who've performed a partial upgrade.
The depending packages have been rebuilt, and from now on any soname version change at all, even one that is _supposed_ to be ABI-compatible like `libimagequant.so.0.0.5`, will require rebuilding `python-pillow` and `libvips` because they now link directly against `libimagequant.so.0.0.4` rather than `libimagequant.so.0`.
(I can't wait for the new pacman release with the new automatic soname dependency support which would've at least lead to this not breaking anything, just people being unable to update.)
A workaround would be a change such as this
```
--- a/imagequant-sys/Cargo.toml
+++ b/imagequant-sys/Cargo.toml
@@ -29,7 +29,7 @@ libc = "0.2.112"
[package.metadata.capi.library]
name = "imagequant"
-version = "0.0.4"
+version = "1.0.4"
[package.metadata.capi.pkg_config]
name = "imagequant"
```
The resulting package then correctly includes the symlinks
```
usr/lib/libimagequant.so
usr/lib/libimagequant.so.1
usr/lib/libimagequant.so.1.0.4
```
And rebuilt packages would link against `libimagequant.so.1` but I am not sure if it's something that we should do in this case.
So I think the best course of action is to just leave it as-is for now and see how things develop.
I am going to close the issue then, thanks!