treewide: fix dangling SONAME symlinks when using ABI_VERSION#29415
treewide: fix dangling SONAME symlinks when using ABI_VERSION#29415BKPepe wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes packaging of shared libraries that use ABI_VERSION by ensuring both the SONAME symlink and its target library file are installed, preventing dangling symlinks in generated .ipk packages.
Changes:
- Bump
PKG_RELEASEfor affected libraries. - Adjust install steps to copy
lib*.so.$(ABI_VERSION)plus the corresponding versioned target(s) via a glob.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| libs/tinycdb/Makefile | Copy libcdb.so.$(ABI_VERSION) plus its versioned target(s) to avoid dangling SONAME symlink. |
| libs/oniguruma/Makefile | Copy libonig.so.$(ABI_VERSION) plus its versioned target(s) to ensure valid runtime library installation. |
| libs/libyaml-cpp/Makefile | Copy libyaml-cpp.so.$(ABI_VERSION) plus its versioned target(s) so SONAME symlink resolves correctly. |
| libs/libmariadb/Makefile | Copy libmariadb.so.$(ABI_VERSION) plus its versioned target(s) to prevent broken symlink packaging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Something is weird with krb5-libs as well: |
|
Phew, I thought I caused that error, but luckily not. I had nothing to do
with it. I'll take a look at it, George, but I don't know if it'll be today.
Dne po 11. 5. 2026 17:56 uživatel George Sapkin ***@***.***>
napsal:
… *GeorgeSapkin* left a comment (openwrt/packages#29415)
<#29415 (comment)>
Some is weird with krb5-libs as well:
Library /usr/lib/krb5/plugins/kdb/db2.so has SONAME 'db2.so.0' but no corresponding symlink was found in /usr/lib/krb5/plugins/kdb
—
Reply to this email directly, view it on GitHub
<#29415 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7IDVEDCLE22LI7MU5QEDD42HZ27AVCNFSM6AAAAACYYIY7CWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DIMRSGM3DMOBZGM>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
It's going to be ignored after this: Not sure if that's actually a good idea, but 🤷 |
Okay. The output looks much better than this one #29397 (comment) :) |
| define Package/tinycdb/install | ||
| $(INSTALL_DIR) $(1)/usr/lib | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcdb.so.$(ABI_VERSION) $(1)/usr/lib | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcdb.so.$(ABI_VERSION)* $(1)/usr/lib | ||
| endef |
There was a problem hiding this comment.
Still CI/CD complains:
tinycdb1: Use generic tests
WARNING: opening /ci/packages.adb: UNTRUSTED signature
tinycdb1: [pass] Binary /usr/lib/libcdb.so.1 does not contain any hardcoded build paths
tinycdb1: [pass] Binary /usr/lib/libcdb.so.1 is stripped
tinycdb1: [pass] All linked libraries for /usr/lib/libcdb.so.1 are present
tinycdb1: [warn] Library /usr/lib/libcdb.so.1 has the same name as its SONAME 'libcdb.so.1'. The library file should have a more specific version.
tinycdb1: [pass] SONAME link for /usr/lib/libcdb.so.1 is correct
tinycdb1: [skip] Version check override
tinycdb1: Generic tests passed
There was a problem hiding this comment.
Which part is bothering you?
There was a problem hiding this comment.
That warning! 🤔 Nothing wrong about the CI/CD, though. :)
There was a problem hiding this comment.
Well, the idea is that a file matching the SONAME is a link to a more specific version. So this one is not bad, but sus 👀
Here's my gold standard:
root@OpenWrt:~# ls -lh /usr/lib/libsqlite3.so.*
lrwxrwxrwx 1 root root 20 May 11 17:17 /usr/lib/libsqlite3.so.0 -> libsqlite3.so.3.53.0
-rwxr-xr-x 1 root root 1004.6K May 10 12:59 /usr/lib/libsqlite3.so.3.53.0
root@OpenWrt:~# readelf -d /usr/lib/libsqlite3.so.3.53.0 | grep SONAME
0x000000000000000e (SONAME) Library soname: [libsqlite3.so.0]| $(PKG_INSTALL_DIR)$(MARIADB_PLUGIN_DIR)/sha256_password.so \ | ||
| $(1)$(MARIADB_PLUGIN_DIR) | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmariadb.so.$(ABI_VERSION) $(1)/usr/lib | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmariadb.so.$(ABI_VERSION)* $(1)/usr/lib |
There was a problem hiding this comment.
libmariadb3: Use generic tests
WARNING: opening /ci/packages.adb: UNTRUSTED signature
libmariadb3: [pass] Binary /usr/lib/libmariadb.so.3 does not contain any hardcoded build paths
libmariadb3: [pass] Binary /usr/lib/libmariadb.so.3 is stripped
libmariadb3: [pass] All linked libraries for /usr/lib/libmariadb.so.3 are present
libmariadb3: [warn] Library /usr/lib/libmariadb.so.3 has the same name as its SONAME 'libmariadb.so.3'. The library file should have a more specific version.
This one is from CI/CD
There was a problem hiding this comment.
As you can see from libsqlite3 example doing cp smth.so.$(ABI_VERSION)* might not always work, since the ABI might be a link to a different version. That is, be careful.
b670333 to
d44ac82
Compare
A previous commit attempted to introduce proper SONAME symlinks for packages utilizing ABI_VERSION. However, it incorrectly copied only the symlink without the underlying physical library file, resulting in broken packages with dangling symlinks. Before: ``` tar -Oxzf bin/packages/arm_cortex-a9_vfpv3-d16/packages/oniguruma_6.9.9-r1_arm_cortex-a9_vfpv3-d16.ipk ./data.tar.gz | tar -tzvf - drwxr-xr-x 0 0 0 0 Feb 5 2024 ./ drwxr-xr-x 0 0 0 0 Feb 5 2024 ./usr/ drwxr-xr-x 0 0 0 0 Feb 5 2024 ./usr/lib/ lrwxrwxrwx 0 0 0 0 Feb 5 2024 ./usr/lib/libonig.so.5 -> libonig.so.5.4.0 ``` After: ``` tar -Oxzf bin/packages/arm_cortex-a9_vfpv3-d16/packages/oniguruma_6.9.9-r1_arm_cortex-a9_vfpv3-d16.ipk ./data.tar.gz | tar -tzvf - drwxr-xr-x 0 0 0 0 Feb 5 2024 ./ drwxr-xr-x 0 0 0 0 Feb 5 2024 ./usr/ drwxr-xr-x 0 0 0 0 Feb 5 2024 ./usr/lib/ lrwxrwxrwx 0 0 0 0 Feb 5 2024 ./usr/lib/libonig.so.5 -> libonig.so.5.4.0 -rwxr-xr-x 0 0 0 526493 Feb 5 2024 ./usr/lib/libonig.so.5.4.0 ``` This properly standardizes shared library packaging, prevents shipping duplicate full-sized files (as seen previously in packages like libre2), and aligns the packages feed with core OpenWrt practices. As you could see in the previous commit (see it in the ``Fixes`` tag): Before: ``` tar -Oxzf bin/packages/arm_cortex-a9_vfpv3-d16/packages/re2_2023.02.01\~b025c6a3-r1_arm_cortex-a9_vfpv3-d16.ipk ./data.tar.gz | tar -tzvf - drwxr-xr-x 0 0 0 0 Aug 18 2024 ./ drwxr-xr-x 0 0 0 0 Aug 18 2024 ./usr/ drwxr-xr-x 0 0 0 0 Aug 18 2024 ./usr/lib/ -rw-r--r-- 0 0 0 331875 Aug 18 2024 ./usr/lib/libre2.so -rw-r--r-- 0 0 0 331875 Aug 18 2024 ./usr/lib/libre2.so.10 -rw-r--r-- 0 0 0 331875 Aug 18 2024 ./usr/lib/libre2.so.10.0.0 ``` After: ``` tar -Oxzf bin/packages/arm_cortex-a9_vfpv3-d16/packages/re2_2023.02.01\~b025c6a3-r1_arm_cortex-a9_vfpv3-d16.ipk ./data.tar.gz | tar -tzvf - drwxr-xr-x 0 0 0 0 Aug 18 2024 ./ drwxr-xr-x 0 0 0 0 Aug 18 2024 ./usr/ drwxr-xr-x 0 0 0 0 Aug 18 2024 ./usr/lib/ lrwxrwxrwx 0 0 0 0 Aug 18 2024 ./usr/lib/libre2.so -> libre2.so.10 lrwxrwxrwx 0 0 0 0 Aug 18 2024 ./usr/lib/libre2.so.10 -> libre2.so.10.0.0 -rwxr-xr-x 0 0 0 331875 Aug 18 2024 ./usr/lib/libre2.so.10.0.0 ``` Fixes: 537c2a6 ("treewide: avoid deref symlinks when installing .so") Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
d44ac82 to
285ba5d
Compare
|
Fixed conflicts and rebased. |
|
Is anything blocking this? |
|
Nope, only missing a lot of time. Thanks for fixing conflicts, I will look at it once again today or tomorrow and merge it afterwards. |
A previous commit (from #28220) attempted to introduce proper SONAME symlinks for packages utilizing ABI_VERSION. However, it incorrectly copied only the symlink without the underlying physical library file, resulting in broken packages with dangling symlinks.
Before:
After:
This properly standardizes shared library packaging, prevents shipping duplicate full-sized files (as seen previously in packages like libre2), and aligns the packages feed with core OpenWrt practices. As you could see in the previous commit (see it in the
Fixestag):Before:
After:
Fixes: 537c2a6 ("treewide: avoid deref symlinks when installing .so")
Fixes: #29387
Follow-up of the discussion in #29397