feat(cross): bundle in-tree libs into the .deb and deploy it over SSH#114
Merged
Conversation
A project split across several shared objects (e.g. a server that loads libFooServer.so) produced a single-binary .deb that could not run on the target: the binary's own shared-object dependencies were left out. Add package.bundle_libs: when set, --deb walks the binary's DT_NEEDED closure and ships the in-tree .so files under /usr/lib/<multiarch>/ (a default loader path, so no rpath is needed). Sysroot and system libraries are excluded and stay the caller's depends:. Reuses the _stageLinkedLibs helper already used for runnable app bundles. Extend --deploy to --deb: scp the package to <user@host> and install it with apt-get, which resolves Depends from the device's own repositories. Signed-off-by: Joel Winarske <joel.winarske@linux.com>
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.
Description
--debassumed a single self-contained binary. For a project whose executable loads its own shared objects (e.g. a server that linkslibFooServer.so/libFooRecorder.sobuilt from the same tree), the resulting package shipped only the executable and was not runnable on the target.package.bundle_libs— when set,--debwalks the binary'sDT_NEEDEDclosure and ships the in-tree.sofiles under/usr/lib/<multiarch>/(a default loader path, so no rpath is needed). Sysroot/system libraries are excluded and remain the caller'sdepends:. Reuses_stageLinkedLibs, already used for runnable app bundles.--deployfor--deb— was gated on--app; now also scp's the package to<user@host>and installs it withapt-get, which resolvesDepends:from the device's own repositories.Validated against an aarch64 Raspberry Pi (Debian trixie): the package installs,
apt-getpulls the declared runtimeDepends, and the binary runs from/usr/binwith all.sos resolved from system paths (noLD_LIBRARY_PATH).Adds
PackageSpec.fromMapcoverage forbundle_libs.dart analyze --fatal-infos --fatal-warningsand the test suite pass.Type of Change