ipk-verify: discover libraries via bundled libraries' own RUNPATH#3
Merged
Merged
Conversation
list_libs only scanned the executable's rpath dirs and the top-level lib/ dir, and LibraryInfo::parse never read DT_RUNPATH/DT_RPATH. So a dependency bundled in a subdirectory that a library locates through its own $ORIGIN-relative runpath was reported as a missing library with all its symbols undefined — even though the loader resolves it fine. This is the libpulse case in apps-repo PR #190: libpulse.so.0 (in lib/) has RUNPATH $ORIGIN/pulseaudio and its pa_* symbols are provided by the bundled lib/pulseaudio/libpulsecommon-15.0.so, which the flat scan never collected. Capture DT_RUNPATH/DT_RPATH in LibraryInfo, and turn list_libs into a breadth-first walk that follows each bundled library's own runpath ($ORIGIN-relative) to discover further bundled directories. Adds a fixture-based parse test plus the regression coverage. Bumps bin-lib 0.1.1 -> 0.1.2, ipk-lib 0.1.3 -> 0.1.4, ipk-verify 0.1.5 -> 0.1.6. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011jY7WzoWeU9TWRBhWJ2Wbq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
A dependency that is bundled in a subdirectory — located at runtime through a library's own
$ORIGIN-relativeRUNPATH— was reported as a missing library with all its symbols undefined, even though the dynamic loader resolves it fine.On apps-repo PR #190 this is the remaining
libpulsered after the global-scope fix (#1):But everything it needs is in the IPK:
libpulse.so.0sits inlib/, itsRUNPATH=$ORIGIN/pulseaudiopoints atlib/pulseaudio/, and the loader findslibpulsecommon-15.0.sothere. So it works at runtime — the report is a false positive.Root cause
LibraryInfo::parsereadDT_NEEDED/DT_SONAMEbut notDT_RUNPATH/DT_RPATH.Component::list_libsonly scanned the executable's rpath dirs plus the top-levellib/dir — it never recursed into subdirectories a bundled library locates through its own runpath.So
libpulsecommon-15.0.sowas never collected → "missing library" + undefinedpa_*.Fix
DT_RUNPATH/DT_RPATHinto a newLibraryInfo.rpathfield (non-serialized; firmware data format unchanged).list_libsinto a breadth-first directory walk: starting from the executable's rpath dirs andlib/, it follows each bundled library's own$ORIGIN-relative runpath to discover further bundled directories (reusing the existing$ORIGINresolution + safety filter).Verification
Rebuilt
webosbrew-ipk-verifyagainst the realorg.webosbrew.bridge-64to32IPK — every row is now:ok:across all 13 firmwares, including the newly-discoveredlib libpulsecommon-15.0.so, with zero remaining missing-library / undefined-symbol details:libEGL.so.1libpulse.so.0/libpulse-simple.so.0libpulsecommon-15.0.so(subdir)Tests: adds
library::tests::test_parse_runpath(fixture-basedDT_RUNPATHcapture) and keeps the existing global-scope regression tests green.Bumps
bin-lib0.1.1 → 0.1.2,ipk-lib0.1.3 → 0.1.4,ipk-verify0.1.5 → 0.1.6.🤖 Generated with Claude Code
Generated by Claude Code