Exclude glibc libraries from dependency bundling #1397
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Excludes glibc libraries from the
RUNTIME_DEPENDENCY_SETto prevent bundling system libraries that cause ABI conflicts on newer Linux distributions.Problem
The current build bundles glibc 2.31 components from the Ubuntu 20.04 build environment:
libc-2.31.so,libdl-2.31.so,libpthread-2.31.so,librt-2.31.so,libm-2.31.so,ld-2.31.soWhen loaded on systems with newer glibc (e.g., Ubuntu 24.04 with glibc 2.39),
GLIBC_PRIVATEsymbol mismatches cause runtime failures:This manifests inconsistently depending on
LD_LIBRARY_PATHordering - if system library paths come first, system glibc wins and it works; otherwise the bundled glibc 2.31 gets loaded vialiblantern.so'sRUNPATH=$ORIGINand fails.Solution
Add
PRE_EXCLUDE_REGEXESandPOST_EXCLUDE_REGEXESto theinstall(RUNTIME_DEPENDENCY_SET ...)command to filter out:libc,libdl,libpthread,librt,libm,ld-linux)/lib/,/lib64/,/usr/lib/)glibc libraries should never be bundled on Linux - they must come from the host system. This is standard practice for portable Linux binaries (cf. manylinux approach).
Test plan
BUNDLE_DEPENDENCIES=ONLD_LIBRARY_PATHconfigurationsRelated issues
Generated with Claude Code