Skip to content

Strip DWARF from iOS FFI release archives#1248

Open
drewcrawford wants to merge 1 commit into
livekit:mainfrom
drewcrawford:fix/strip-ios-ffi-dwarf
Open

Strip DWARF from iOS FFI release archives#1248
drewcrawford wants to merge 1 commit into
livekit:mainfrom
drewcrawford:fix/strip-ios-ffi-dwarf

Conversation

@drewcrawford

@drewcrawford drewcrawford commented Jul 13, 2026

Copy link
Copy Markdown

Summary

  • Strip DWARF debug information from the release iOS device and simulator
    liblivekit_ffi.a archives before packaging.
  • Rebuild each archive's symbol index with ranlib.
  • Leave manually requested debug artifacts unstripped.
  • Add a patch changeset for livekit-ffi.

Fixes #1087.

Background

The iOS FFI builds produce static archives, so there is no final dynamic-link step
to discard DWARF information. Although the workspace release profile enables
symbol stripping, that does not remove debug information embedded in every
archive member, including the bundled C/C++ WebRTC objects.

Post-processing the completed archive with Apple's strip -S handles the whole
artifact while preserving global symbols required by downstream linkers.

Measured impact

Target Raw archive Compressed archive Packaging time
aarch64-apple-ios 462.23 → 44.92 MiB 122.26 → 14.37 MiB 13.59 → 1.54s
aarch64-apple-ios-sim 463.84 → 45.07 MiB 122.58 → 14.44 MiB 13.76 → 1.51s

Across both published iOS archives, this reduces raw size by 90.28% and
compressed size by 88.23%.

DWARF section size falls to zero. All defined external symbols and all 3,435
archive members are preserved, including livekit_ffi_request,
livekit_ffi_initialize, and livekit_ffi_drop_handle.

Design tradeoffs

Using a Cargo profile setting alone was avoided because it does not reliably
strip debug information from all bundled C/C++ archive members.

Post-build stripping adds roughly 61 seconds to each iOS release matrix job on
my laptop. Faster packaging saves about 12 seconds per artifact, and the
smaller upload and downstream processing costs should offset additional time
outside the build itself.

Testing

  • Built release liblivekit_ffi.a for:
    • aarch64-apple-ios
    • aarch64-apple-ios-sim
  • Applied xcrun strip -S and xcrun ranlib to both archives.
  • Verified zero remaining DWARF bytes.
  • Compared archive members and defined external symbols before and after.
  • Verified required LiveKit FFI entry points remain exported.
  • Verified Apple's linker can consume both post-strip archives.
  • Built the macOS arm64 dynamic-library control and confirmed it
    already contains zero DWARF.
  • Ran cargo fmt --all -- --check, workflow YAML parsing, changeset validation,
    and git diff --check.

CI note

This PR also adds one line to gen-node-proto.yml: the checkout step now
sets repository: to the PR head repository. The job previously fetched
the head branch name from the base repository, which fails for any
fork-based PR matching the workflow's path filter — including this one,
via .github/**. Same-repo PRs are unaffected
(head.repo.full_name equals github.repository there).

@drewcrawford
drewcrawford requested a review from ladvoc as a code owner July 13, 2026 22:34
@CLAassistant

CLAassistant commented Jul 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@devin-ai-integration devin-ai-integration Bot left a comment

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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@drewcrawford
drewcrawford force-pushed the fix/strip-ios-ffi-dwarf branch from d8df76e to d200894 Compare July 17, 2026 17:50
Also set the checkout repository in gen-node-proto.yml to the PR head
repository. The job previously fetched the head branch name from the
base repository, which fails for any fork-based PR that matches the
workflow's path filter (including this one, via .github/**).
@drewcrawford
drewcrawford force-pushed the fix/strip-ios-ffi-dwarf branch from d200894 to 223989e Compare July 17, 2026 17:55
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.

iOS staticlib (liblivekit_ffi.a) ships with unstripped DWARF — 462 MB vs ~45 MB

2 participants