Skip to content

Keep the soname symlinks of thirdparty libs in the .deb - #6932

Merged
Fedr merged 10 commits into
masterfrom
fix/deb-keep-lib-symlinks
Sep 25, 2026
Merged

Fedr merged 10 commits into
masterfrom
fix/deb-keep-lib-symlinks

Conversation

@Fedr

@Fedr Fedr commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

scripts/distribution.sh copied the thirdparty ./lib with cp -rL, which dereferences symlinks: libz-ng.so, libz-ng.so.2 and libz-ng.so.2.x all ship as separate regular files. The postinst ldconfig then warns for every soname file that is not a symlink, e.g.

/sbin/ldconfig.real: /usr/local/lib/MeshInspector/lib/libz.so.1 is not a symbolic link

(reported by a user in MeshInspector/MeshInspector#141 for libz, libopenvdb, libcpr, libE57Format). It also packages each such library two or three times.

  • distribution.sh: the contents of ./lib are copied with cp -a ./lib/., preserving the soname symlinks inside. ./lib/. rather than ./lib because CI's ./lib is itself an absolute symlink to /usr/local/lib/meshlib-thirdparty-lib/lib - that is what -L was covering for. ./include keeps cp -rL: headers are not seen by ldconfig.
  • New scripts/devops/check_deb_libs.sh <deb> <lib dir inside the package>, run by both ubuntu workflows after Extract Deb (it extracts the package into a temp dir by itself, so MeshInspector can reuse it on its own .debs): prints the .deb size and fails on absolute or dangling symlinks in the packaged lib dir, and on a regular file sitting under another library's soname (read with readelf) - exactly what ldconfig reports as "is not a symbolic link".

Size

meshlib-dev.deb, master 954b15d (release artifact size) vs this PR:

Leg master PR change
ubuntu24 x64 34,916,975 32,910,616 -2.01 MB (-5.7%)
ubuntu22 arm64 30,676,303 28,664,232 -2.01 MB (-6.6%)
ubuntu24 arm64 32,515,857 30,494,976 -2.02 MB (-6.2%)
ubuntu26 arm64 33,593,364 31,183,716 -2.41 MB (-7.2%)

Verification

  • Negative test: with cp -rL temporarily restored (1a23cde, reverted), the new check failed on all 7 ubuntu legs, listing libcpr.so.1, libE57Format.so.3, libopenvdb.so.10.1, libz-ng.so.2 - the same libraries as in the issue.
  • With the fix, all ubuntu x64/arm64 legs are green; the C++ examples build and run against the extracted package, so the preserved symlinks resolve at link time.
  • Not covered: CI never runs the real postinst (dpkg --extract only), so the absence of the ldconfig warning itself is inferred from the soname check.

🤖 Generated with Claude Code

`cp -rL ./lib` dereferenced every symlink, so libz.so, libz.so.1 and
libz.so.1.x were packaged as separate full copies and the postinst
ldconfig warned "<lib>.so.N is not a symbolic link" for each of them
(MeshInspector issue #141). Copy with `cp -a` and fail the packaging
if any absolute or dangling symlink would ship.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fedr and others added 5 commits September 24, 2026 20:33
CI links ./lib to /usr/local/lib/meshlib-thirdparty-lib/lib, so `cp -a ./lib`
packaged just that absolute link (caught by the new guard).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
distribution.sh keeps only the fix. A new CI step after Extract Deb prints
the .deb size and fails on absolute or dangling symlinks, and on a regular
file sitting under another library's soname - what ldconfig reports as
"is not a symbolic link".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread scripts/devops/check_deb_libs.sh
Fedr and others added 3 commits September 25, 2026 12:31
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y itself

So MeshInspector can reuse it on its own packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Fedr
Fedr merged commit 7346129 into master Sep 25, 2026
35 checks passed
@Fedr
Fedr deleted the fix/deb-keep-lib-symlinks branch September 25, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants