This repository was archived by the owner on Nov 10, 2026. It is now read-only.
Repository navigation
Add skip export --debug-info line-tables for faster debug native Android builds - #296
Merged
Merged
Conversation
… debug info Nothing debugs Swift on Android, yet `skip android build` produced full debug info: type DWARF plus every module's AST embedded in the library for LLDB. On a 16-module Skip Fuse app that made the root library 440 MB, of which only 112 MB was code, and Gradle then compressed all of it into the AAR on every build. Debug Android builds now pass `-debug-info-format none` with `-gline-tables-only` for Swift and C, which keeps files and lines for crash backtraces. Release builds are unchanged: with line tables only, inlined frames carry just their short name (`notional` rather than the mangled `$s8CrashLib8notionalySiAA5OrderVF`), which would degrade crash reporters such as Sentry. Passing any `-Xswiftc -g…` flag opts out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…LES_ONLY Debug native Android builds keep full debug info by default. Setting SKIP_ANDROID_LINE_TABLES_ONLY=1 builds them with line tables only. An environment variable reaches `skip android build` however it is invoked, including from the Gradle task skip-bridge adds to Fuse apps, the same way SKIP_EXPORT_ARCHS does. Release builds keep full debug info either way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…only The opt-in is now a documented `skip export` flag that shows up in `skip export --help` and its usage examples. Like `--arch`, it reaches the `skip android build` that SkipBridge's Gradle task runs through an environment variable set for the Gradle process, SKIP_EXPORT_LINE_TABLES_ONLY, next to SKIP_EXPORT_ARCHS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
marcprux
suggested changes
Oct 11, 2026
marcprux
left a comment
Member
There was a problem hiding this comment.
On second thought, I think the "--line-tables-only" argument is a bit confusing. Could we change this to "--debug-info=line-tables" or "--debug-info=full" (or something like that)? That would give us the ability to add more options in the future without needing to add another parameter.
`--debug-info line-tables` builds the debug native libraries with only line tables; `--debug-info full` (the default) keeps the current behavior. A level option leaves room for more debug info levels without adding flags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
skip android buildis what Gradle runs for every Skip Fuse build and forskip export. It produced native libraries with full debug info: type DWARF plus every module's serialized AST, embedded in a.swift_astsection for a Swift-aware LLDB.In debug builds, most projects don't use that information. Android Studio debugs native code with its bundled upstream LLDB 21 (
plugins/android-ndk/resources/lldb/lib64/liblldb.dylib), which has no Swift support: 0 Swift type-system or runtime symbols, against 43 in Xcode's LLDB. So it can't show Swift variables or types whatever the debug info level. Debug builds also aren't what crash reporters symbolicate.On a production Skip Fuse app with 16 Skip modules, the debug root library was 440 MB:
.text(code).debug_*.swift_ast.strtab+.symtabkeepDebugSymbols("**/*.so")keeps AGP from stripping any of it, so Gradle compresses the whole library into the AAR on every build:bundleDebugAartook 11.7 s.Change
A new
skip export --debug-info <level>option, withfull(the default, current behavior) andline-tables. A level rather than a flag leaves room for more levels later. It is documented inskip export --helplike the other options, and the usage examples include it:The native libraries are built by the
skip android buildthat SkipBridge's Gradle task runs, so the option reaches it the way--archdoes.skip export --debug-info line-tablessetsSKIP_EXPORT_DEBUG_INFO=line-tablesfor the Gradle process, next toSKIP_EXPORT_ARCHS.For debug builds,
runToolchainCommandthen passes-debug-info-format nonetoswift build, together with-Xswiftc -gline-tables-onlyand-Xcc -gline-tables-only.Under Swift Build,
-Xswiftc -gline-tables-onlyalone has no effect: the build system's own debug information setting adds full debug info back. In a test, the library stayed at 441 MB with.swift_astintact until-debug-info-format nonewas added.The libraries keep
.debug_line, so breakpoints, stepping and crash backtraces still have files and lines. Release builds keep full debug info even with--debug-info line-tables.Usage
Export the debug variant faster:
skip export --debug --debug-info line-tablesExport one module, debug, one ABI:
skip export --module MyModule --debug --arch aarch64 --debug-info line-tablesExport both variants: without
--debugor--release,skip exportbuilds both. Only the debug libraries get line tables; the release ones keep full debug info.skip export --debug-info line-tablesCheck that it took effect. The exported library has no
.swift_astsection:Behavior change
None by default. Without
--debug-info line-tables, every export is unchanged.With
--debug-info line-tables, debug libraries are smaller and faster to build. The root library drops from 440 MB to 254 MB, and its AAR from 154 MB to 100 MB.Android Studio's debugger behaves the same. Both test libraries (below) were loaded into upstream LLDB (the NDK's LLDB 19.0.1, the same upstream code Android Studio bundles):
breakpoint set -f Crash.swift -l 50x11d00x11d0breakpoint set -f Crash.swift -l 110x11f80x11f8image lookup -a 0x1220$s8CrashLib13totalNotionalySiSayAA5OrderVGF + 96type lookup OrderWho would lose something by opting in: only someone who attaches Apple's Swift-aware LLDB from a swift.org toolchain to an Android debug build by hand.
Why release keeps full debug info. Crash reporters such as Sentry symbolicate release libraries, and with line tables only, inlined frames keep just their short name. In a release test library, a crash inside an inlined helper symbolicated through
llvm-symbolizer --inlininglike this:$s8CrashLib8notionalySiAA5OrderVF(CrashLib.notional(CrashLib.Order) -> Swift.Int)notionalThe file, line and column (
Crash.swift:5:29), the inline structure, and the non-inlined frame names were identical.sentry-cli debug-files checkreportedsymtab, debug, unwindfor both. But the short name loses its module and type, and it would change how native crashes are grouped.Testing
M-series Mac, 14 cores, Swift 6.4, Swift Build,
aarch64, debug configuration, the same 16-module app.Gradle step that builds and packages the native library (
assembleDebugof the transpiled project). Stock 1.9.13 against this branch with line tables only, with the same edits:Where the time goes inside that step:
buildAndroidSwiftPackageDebugbundleDebugAarThe native
swift buildon its own, run directly with the exact commandskip android buildissues, after the same public API edit:-debug-info-format none-debug-info-format none+-gline-tables-only(this change)Section sizes with this change:
.swift_astis gone..debug_infodrops from 26 MB to 1.2 MB and.debug_strfrom 50 MB to 1.3 MB, while.debug_linestays at 16.5 MB.skip export --debug-info line-tablesend to end, withskip export --module App --no-export-project --debug --arch aarch64, run with and then without the option on the same Gradle daemon:.swift_ast--debug-info line-tablesfull)skip android buildflags per case:SKIP_EXPORT_DEBUG_INFO(set by--debug-info)fullline-tables-debug-info-format none -Xswiftc -gline-tables-only -Xcc -gline-tables-onlyNot tested: a live Android Studio debugging session (the LLDB comparison above loaded the libraries without a running process), the native build system (older toolchains), Linux hosts, and running the app on a device with this build.
🤖 Generated with Claude Code