fix: retain native debug symbols#988
Conversation
f64bc5a to
008aa9c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Greptile SummaryThis PR establishes a complete native debug symbol pipeline for Play Console crash symbolication: stripped Rust AARs are consumed for the app download, and separate
Confidence Score: 4/5Safe to merge; the two shell script findings are both minor robustness concerns that don't affect correctness for the current set of three well-separated dependency archives. The overall pipeline is well-structured: credentials are correctly scoped, validation guards prevent stripped archives from reaching Play Console, and the regression tests lock in configuration invariants. The shell script's awk build-number extraction lacks a numeric guard (so a future refactoring of versionCode to a Kotlin constant would silently produce a mislabeled archive), and the archive merge loop processes ZIPs in non-deterministic glob order with overwrite semantics. Neither issue is reachable with the current codebase, but both add fragility worth addressing. scripts/create-native-debug-symbols.sh — specifically the awk build-number extraction (no integer validation) and the for archive in *.zip loop (non-deterministic overwrite order).
|
| Filename | Overview |
|---|---|
| scripts/create-native-debug-symbols.sh | New shell script that merges upstream native debug symbol ZIPs and validates DWARF metadata; the awk-based versionCode extraction is fragile, and copy_archive_symbols silently ignores per-archive missing libs (deferred to downstream validation). |
| app/build.gradle.kts | Adds debugSymbolLevel = FULL for release builds, a custom nativeDebugSymbols configuration, and a syncNativeDebugSymbolArtifacts Sync task; implementation is clean and the nativeDebugSymbolsArtifact() helper correctly reads versions from the version catalog. |
| .github/workflows/release.yml | Both sync and script steps correctly run inside the same env: block that sets GPR_TOKEN/GITHUB_TOKEN; SHA256 checksums now include the symbol archive alongside AAB and APK. |
| .github/workflows/release-internal.yml | Mirrors release.yml changes for the internal build; all three steps (Gradle build, syncNativeDebugSymbolArtifacts, script) share the same env block with required credentials. |
| gradle/libs.versions.toml | Version bumps for bitkit-core (0.1.72→0.1.73), ldk-node-android (0.7.0-rc.46→0.7.0-rc.50), and vss-client (0.5.12→0.5.19) to consume stripped AAR packages with separate native-debug-symbols classifier artifacts. |
| app/src/test/java/to/bitkit/build/NativeReleaseConfigTest.kt | New string-matching regression tests that guard configuration invariants across build.gradle.kts, Justfile, and the shell script; repo-root discovery via libs.versions.toml lookup is robust. |
| Justfile | The release recipe gains an embedded sh block that cleans stale archives before the build, then runs sync and script steps in the correct order. |
| .agents/commands/release.md | Documents the new native debug symbols upload step for both GitHub Releases and Play Console; instructions are clear and consistent with the Justfile/workflow changes. |
| README.md | Adds concise documentation on the release artifacts and native debug symbol handling workflow. |
Sequence Diagram
%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Dev as Developer / CI
participant Gradle as Gradle Build
participant GPR as GitHub Package Registry
participant Script as create-native-debug-symbols.sh
participant Play as Play Console
Dev->>Gradle: assembleMainnetRelease bundleMainnetRelease
Gradle-->>Dev: bitkit-mainnet-release-N.apk / .aab (stripped .so)
Dev->>Gradle: :app:syncNativeDebugSymbolArtifacts
Gradle->>GPR: "Resolve bitkit-core:native-debug-symbols@zip"
Gradle->>GPR: "Resolve ldk-node-android:native-debug-symbols@zip"
Gradle->>GPR: "Resolve vss-client-android:native-debug-symbols@zip"
GPR-->>Gradle: 3x symbol ZIPs to intermediates/native-debug-symbol-artifacts/
Dev->>Script: scripts/create-native-debug-symbols.sh
Script->>Script: Extract and merge per-lib .so files from 3 ZIPs
Script->>Script: validate_symbol_tree (llvm-readelf: .debug_info present?)
Script-->>Dev: native-debug-symbols-N.zip (315 MB DWARF archive)
Dev->>Play: Upload .aab (stripped, ~89 MB)
Dev->>Play: Upload native-debug-symbols-N.zip (App bundle explorer - Assets)
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Dev as Developer / CI
participant Gradle as Gradle Build
participant GPR as GitHub Package Registry
participant Script as create-native-debug-symbols.sh
participant Play as Play Console
Dev->>Gradle: assembleMainnetRelease bundleMainnetRelease
Gradle-->>Dev: bitkit-mainnet-release-N.apk / .aab (stripped .so)
Dev->>Gradle: :app:syncNativeDebugSymbolArtifacts
Gradle->>GPR: "Resolve bitkit-core:native-debug-symbols@zip"
Gradle->>GPR: "Resolve ldk-node-android:native-debug-symbols@zip"
Gradle->>GPR: "Resolve vss-client-android:native-debug-symbols@zip"
GPR-->>Gradle: 3x symbol ZIPs to intermediates/native-debug-symbol-artifacts/
Dev->>Script: scripts/create-native-debug-symbols.sh
Script->>Script: Extract and merge per-lib .so files from 3 ZIPs
Script->>Script: validate_symbol_tree (llvm-readelf: .debug_info present?)
Script-->>Dev: native-debug-symbols-N.zip (315 MB DWARF archive)
Dev->>Play: Upload .aab (stripped, ~89 MB)
Dev->>Play: Upload native-debug-symbols-N.zip (App bundle explorer - Assets)
Reviews (1): Last reviewed commit: "fix: defer paykit symbol integration" | Re-trigger Greptile
01d9b88 to
4cd95d1
Compare
ovitrif
left a comment
There was a problem hiding this comment.
self-reviewed and tested
Refs #982
Related
Description
This PR fixes the native crash symbolication path without bloating the app download.
com.synonym:bitkit-core-android:0.1.73com.synonym:ldk-node-android:0.7.0-rc.51com.synonym:vss-client-android:0.5.20com.synonym:paykit-android:0.1.0-rc8package for now.pubky/paykit-rs#54prepares Paykit symbols upstream, but Android is intentionally not consuming that newer Paykit package in this PR because Paykit is not user-facing yet and the app integration update should land separately.native-debug-symbolsclassifier artifacts duringjust release.app/build/outputs/native-debug-symbols/mainnetRelease/native-debug-symbols-182.zipfor Play Console and GitHub release uploads.native-debug-symbols-182.zipin both public and internal release workflow artifacts, withSHA256SUMS.txt, so release managers can keep the exact symbol archive from the release build..sofiles.Upstream package publication runs consumed by Android:
276268181502770369482627703652412Prepared upstream but not consumed by Android yet:
0.1.0-rc20, workflow run27703655069Preview
N/A
QA Notes
Passed locally on this rebased head:
actionlint .github/workflows/release.yml .github/workflows/release-internal.ymlsh -n scripts/create-native-debug-symbols.shGITHUB_TOKEN=$GITHUB_PAT just releaseGITHUB_TOKEN=$GITHUB_PAT just compileGITHUB_TOKEN=$GITHUB_PAT just testGITHUB_TOKEN=$GITHUB_PAT just lintgit diff --checkPreviously passed locally for this PR chain:
scripts/create-native-debug-symbols.sh./gradlew --no-daemon testDevDebugUnitTest --tests to.bitkit.build.NativeReleaseConfigTestArtifact proof:
native-debug-symbolsclassifier URLs return HTTP200forbitkit-core,ldk-node, andvss-rust-client-ffiat the versions consumed by Android.bitkit-core,ldk-node, andvss-rust-client-fficontain no.debug_*sections in packaged Rust.sofiles.just releaseproducedapp/build/outputs/bundle/mainnetRelease/bitkit-mainnet-release-182.aabat89,123,089bytes.just releaseproducedapp/build/outputs/native-debug-symbols/mainnetRelease/native-debug-symbols-182.zipat315,939,504bytes.libbitkitcore.so,libldk_node.so, andlibvss_rust_client_ffi.sofiles forarm64-v8aandarmeabi-v7a, with no.debug_infosections..debug_infoDWARF metadata forlibbitkitcore.so,libldk_node.so, andlibvss_rust_client_ffi.sofor botharm64-v8aandarmeabi-v7a.libpaykit.soyet.