Repository navigation
Conversation
The workspace's release profile sets panic = "abort", so on iOS a Rust panic in the SDK aborts the app instead of reaching Kotlin or Swift as an exception. The Android, iOS and iOS simulator tasks override it with CARGO_PROFILE_RELEASE_PANIC=unwind. The Android libraries are debug builds and already unwind; the override keeps them unwinding once they build in release.
The Android tasks ran `cargo ndk ... build` without `--release`, so the Kotlin package shipped dev-profile libraries: unoptimized, with debug assertions, and almost three times the size of a release build (arm64-v8a libglsdk.so: 29.9 MB, 11.0 MB in release). The iOS tasks already build in release. The Kotlin bindings are generated from the release arm64 library, which yields the same Kotlin as the debug one.
This branch has not been deployed
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
linux-*-*tasks runcargo ndk ... build -p gl-sdkwithout--release, sotask build:kotlinpackages dev-profile libraries: unoptimized and with debug assertions. Cargo reportsFinished `dev` profile [unoptimized + debuginfo]for them. The publishedglsdk-android0.5.0 carries the same marks: itsarm64-v8alibrary is 29.1 MB and holds hundreds ofunsafe precondition(s) violatedmessages, which Rust only compiles in with debug assertions.[profile.release]setspanic = "abort". So a Rust panic in the SDK aborts an iOS app, while on Android, which unwinds because it is a debug build, UniFFI hands the panic to Kotlin as an exception. Building Android in release as it stands would make it abort too.Change
CARGO_PROFILE_RELEASE_PANIC=unwind, so the SDK libraries unwind on panic on both platforms. Other builds, such as the plugins and the Python bindings, keeppanic = "abort".--release, andtask build:kotlingenerates the Kotlin bindings fromtarget/aarch64-linux-android/release/libglsdk.ainstead ofdebug.Testing
cargo ndk3.5.4, NDK 29, rustc 1.98.1, onmainand on this branch:zip -9)unsafe preconditionmessagesarm64-v8alibglsdk.somainarm64-v8alibglsdk.soaarch64-apple-ioslibglsdk.amainaarch64-apple-ioslibglsdk.amain's iOS archive linkspanic_abortand has 0.02 MB of exception tables (__gcc_except_tab). This branch's linkspanic_unwindand has 1.31 MB. The release Android library linkspanic_unwindand keeps its.gcc_except_table(1.29 MB).uniffi_*symbols, including the 71uniffi_glsdk_fn_*functions.main's debuglibglsdk.aand from this branch's release one.envon a wildcard task in an included Taskfile reaches that task's commands and no other task's.