Skip to content

feat(cross): bundle in-tree libs into the .deb and deploy it over SSH#114

Merged
jwinarske merged 1 commit into
mainfrom
jw/cross-deb-bundle-libs-deploy
Jul 11, 2026
Merged

feat(cross): bundle in-tree libs into the .deb and deploy it over SSH#114
jwinarske merged 1 commit into
mainfrom
jw/cross-deb-bundle-libs-deploy

Conversation

@jwinarske

Copy link
Copy Markdown
Contributor

Description

--deb assumed a single self-contained binary. For a project whose executable loads its own shared objects (e.g. a server that links libFooServer.so/libFooRecorder.so built from the same tree), the resulting package shipped only the executable and was not runnable on the target.

  • 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/system libraries are excluded and remain the caller's depends:. Reuses _stageLinkedLibs, already used for runnable app bundles.
  • --deploy for --deb — was gated on --app; now also scp's the package to <user@host> and installs it with apt-get, which resolves Depends: from the device's own repositories.

Validated against an aarch64 Raspberry Pi (Debian trixie): the package installs, apt-get pulls the declared runtime Depends, and the binary runs from /usr/bin with all .sos resolved from system paths (no LD_LIBRARY_PATH).

Adds PackageSpec.fromMap coverage for bundle_libs. dart analyze --fatal-infos --fatal-warnings and the test suite pass.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

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>
@jwinarske
jwinarske merged commit 712b632 into main Jul 11, 2026
39 checks passed
@jwinarske
jwinarske deleted the jw/cross-deb-bundle-libs-deploy branch July 11, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant