Skip to content

fix: publish android debug symbols#99

Open
ovitrif wants to merge 14 commits into
masterfrom
ovi/fix-android-native-symbols
Open

fix: publish android debug symbols#99
ovitrif wants to merge 14 commits into
masterfrom
ovi/fix-android-native-symbols

Conversation

@ovitrif

@ovitrif ovitrif commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Refs synonymdev/bitkit-android#982

Unblocks synonymdev/bitkit-android#988.

Description

Android release symbol extraction failed because previously published bitkit-core AARs contained stripped libbitkitcore.so files without usable native debug metadata.

This bumps bitkit-core to 0.1.70 and changes the Android build/publish path so release artifacts keep native debug metadata and satisfy the Android 16 KB page-size alignment requirement:

  • Build Android native libraries with release debug metadata and cargo ndk --no-strip.
  • Use Android NDK r28c for package publication.
  • Export ANDROID_NDK_ROOT via $GITHUB_ENV after setup-ndk so script and Gradle build/publish steps can find NDK llvm-readelf.
  • Preserve the repo's existing Android target rustflags while adding 16 KB LOAD segment alignment linker flags.
  • Fail build_android.sh if any ABI lacks .symtab, .debug_*, or .gnu_debugdata metadata.
  • Validate 16 KB LOAD alignment with wide readelf/llvm-readelf program-header output.
  • Locate llvm-readelf from ANDROID_NDK_ROOT, ANDROID_NDK_HOME, or NDK_HOME when it is not already on PATH.
  • Preserve libbitkitcore.so symbols through Gradle release AAR packaging.
  • Add Gradle publish-time validation so bundleReleaseAar and direct Gradle publish tasks fail if checked-in jniLibs lacks native debug metadata or 16 KB LOAD alignment.
  • Update terminal Android publish docs to run ./build_android.sh before direct Gradle publish.
  • Regenerate Android bindings in the Gradle publish workflow before publishing the AAR.
  • Update the iOS xcframework and Package.swift checksum for the same release version.

Release

Preview

N/A

QA Notes

  • Passed: Android package publish workflow for com.synonym:bitkit-core-android:0.1.70.
  • Passed after final review fixes: bash -n build_android.sh.
  • Passed after final review fixes: git diff --check.
  • Passed: workflow YAML parses locally; publish-workflow behavior can be verified automatically after merge.
  • Passed after final review fixes: ./bindings/android/gradlew --project-dir ./bindings/android :lib:ktlintCheck.
  • Passed after final review fixes: ./build_android.sh revalidated the terminal build/publish path and ran :lib:validateReleaseNativeLibraries before publishToMavenLocal.
  • Verified after final review fixes: ./bindings/android/gradlew --project-dir ./bindings/android :lib:validateReleaseNativeLibraries fails stale checked-in jniLibs before regeneration, proving direct Gradle publish is guarded.
  • Passed after final review fixes: NDK llvm-readelf discovery through ANDROID_NDK_ROOT.
  • Passed: local llvm-readelf -W -l LOAD-alignment probe returned 0x4000 for arm64-v8a/libbitkitcore.so.
  • Passed before final script-only review fixes: ./build_android.sh.
  • Passed before final script-only review fixes: ./build_ios.sh.
  • Passed before final script-only review fixes: cargo fmt --check.
  • Passed before final script-only review fixes: cargo clippy (0 errors, existing warnings).
  • Passed before final script-only review fixes: cargo test --lib -- --skip modules::blocktank.
  • Verified Swift checksum: 3717f97d4c184509f8093a87f6d8a5c4085d771264d789d1102ab6321fbb3ed6.
  • cargo test reached 358 passed before 11 existing Blocktank staging/regtest network tests timed out against api.stag.blocktank.to.
  • Publish-workflow behavior from this PR can be verified automatically after merge.

@ovitrif ovitrif marked this pull request as ready for review June 4, 2026 20:39
@ovitrif ovitrif requested a review from ben-kaufman June 4, 2026 20:42
@ovitrif ovitrif self-assigned this Jun 4, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@ben-kaufman ben-kaufman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reaudit note.

Comment thread .github/workflows/gradle-publish.yml
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@ovitrif ovitrif requested a review from ben-kaufman June 5, 2026 16:42
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@ben-kaufman

Copy link
Copy Markdown
Collaborator

Could we update this terminal publish path to run ./build_android.sh first, or remove it? The GitHub Actions path regenerates jniLibs before publishing, but this direct Gradle path still packages the checked-in native libs. I verified publishToMavenLocal from this checkout produces an AAR with no native debug metadata, and the 32-bit libs are still 0x1000 aligned.

@ovitrif

ovitrif commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Could we update this terminal publish path to run ./build_android.sh first, or remove it?

Updated the terminal publish recipe to run ./build_android.sh before direct Gradle publishing, and added a Gradle validateReleaseNativeLibraries gate to bundleReleaseAar and publish tasks so direct Gradle publishing now fails if jniLibs lacks native debug metadata or 16 KB LOAD alignment.

Validation:

  • ./bindings/android/gradlew --project-dir ./bindings/android :lib:validateReleaseNativeLibraries fails on the stale checked-in libs before regeneration, matching the issue.
  • ./build_android.sh passes and executes :lib:validateReleaseNativeLibraries before publishToMavenLocal.
  • ./bindings/android/gradlew --project-dir ./bindings/android :lib:ktlintCheck passes.
  • git diff --check passes.

Resolved in e373700

Comment thread .github/workflows/gradle-publish.yml

@ben-kaufman ben-kaufman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good after reaudit.

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.

2 participants