Skip to content

Strip the libraries in the vcpkg package - #6556

Merged
Fedr merged 2 commits into
masterfrom
vcpkg-package-strip
Aug 7, 2026
Merged

Strip the libraries in the vcpkg package#6556
Fedr merged 2 commits into
masterfrom
vcpkg-package-strip

Conversation

@Fedr

@Fedr Fedr commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

The linux-vcpkg tar.xz is the last artifact that ships unstripped libraries: cmake --install is called without --strip, while the wheels (#6525) and the AppImage (linuxdeploy strips unless NO_STRIP is set) have always been stripped. Measured on the Release / Clang 21 legs, the MeshLib shared libraries alone carry 16.3 MB (x64) and 17.6 MB (arm64) of .symtab/.strtab:

all .so in build/Release/bin unstripped stripped
x64 62,285,048 46,020,984
arm64 65,737,856 45,443,384

Those sections are not SEC_ALLOC — never loaded at runtime — and linking against the package needs only .dynsym, which strip keeps. This also removes the wart that #6550 left behind: -ffunction-sections grows .symtab (per-function section symbols), which is invisible everywhere except in this one artifact.

Trade-off worth stating: backtraces taken inside the shipped libraries lose the names of non-exported functions, since MeshLib builds with -fvisibility=hidden. That is already true of every wheel and AppImage we publish, so this only makes the vcpkg package consistent with them.

Third-party libraries copied from vcpkg are left alone: blanket-stripping that tree would hit .a archives, where it breaks linking.

Sizes

Packaged twice in one job on a throwaway branch — once as this PR does, once with --strip removed:

meshlib_linux-vcpkg.tar.xz unstripped stripped delta
x64 68,676,728 67,172,652 −1,504,076 (−2.19%)
arm64 65,309,252 63,177,912 −2,131,340 (−3.26%)

16.3 MB (x64) / 17.6 MB (arm64) of raw symbol tables compress down to a 1.5 MB / 2.1 MB saving in the shipped archive — they compress about 9:1, but the absolute win is still real, and the uncompressed install shrinks by the full amount.

This also closes the one caveat left by #6550: -ffunction-sections inflates .symtab, and this package was the only artifact that carried it.

Testing

linux-vcpkg only; the script is not used by any other platform. The Create PackageExtract PackageBuild C++/C examples steps in that job build the examples against the stripped package, which is the check that matters here.

16 MB of .symtab/.strtab that nothing needs: linking uses .dynsym, and the
wheels and the AppImage have always shipped stripped.
Comment thread scripts/distribution_vcpkg.sh Outdated
Comment on lines +35 to +36
# --strip drops .symtab/.strtab: linking needs only .dynsym, and the wheels
# and the AppImage have always shipped stripped.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the comment.

@Fedr
Fedr merged commit 8fc5d5b into master Aug 7, 2026
31 checks passed
@Fedr
Fedr deleted the vcpkg-package-strip branch August 7, 2026 14:57
Fedr added a commit that referenced this pull request Aug 17, 2026
Same as #6556 did for the vcpkg package. The bindings use install -s so they
are stripped before the patchelf calls, not after -- that order is what
corrupts load commands.
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