ci: strip debug symbols from Android prebuilt SDK libraries - #702
Open
chinaux wants to merge 1 commit into
Open
Conversation
The NDK toolchain injects -g into all build types. AGP normally strips the .so files at APK packaging time, but the prebuilt SDK ships them directly, so libzvec.so carried hundreds of MB of DWARF debug info (~500MB, 147MB compressed tar.gz). Add a strip step to the Android build job that runs llvm-strip (with a llvm-objcopy --strip-all fallback) over the staged libraries before packaging. Verified on the fork (v0.2.99-test2 build): libzvec.so ~500MB -> 29MB, zvec-sdk-android-arm64.tar.gz 153.8MB -> 24.3MB (-84%), other platform packages unchanged, and the staged SDK still passes the cross-compile link smoke test.
iqbalbhatti49
approved these changes
Aug 26, 2026
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
The Android prebuilt SDK asset in release builds is abnormally large:
zvec-sdk-android-arm64.tar.gzis ~147 MB compressed and contains a ~500 MBlibzvec.so, while all other platform packages are 20-38 MB.Root cause
The NDK toolchain injects
-ginto all build types. In normal Android app builds AGP strips the.sofiles at APK packaging time, but_build_prebuilt.ymlships the raw.sofiles directly and has no strip step, so hundreds of MB of DWARF debug info end up inlibzvec.so.Fix
Add a strip step to the Android build job in
.github/workflows/_build_prebuilt.yml, running over the staged libraries before packaging:llvm-stripfrom$NDK/toolchains/llvm/prebuilt/linux-x86_64/binllvm-objcopy --strip-allifllvm-stripis unavailable, and prints the NDK tool layout to aid debugging if neither is foundVerification
Built from my fork with this change (release run for tag
v0.2.99-test2, since cleaned up):libzvec.so: ~500 MB -> 29 MBzvec-sdk-android-arm64.tar.gz: 153,829,823 B -> 24,304,754 B (-84%)