Skip to content

Commit 61cac0d

Browse files
committed
fix: use non-stripped host library for uniffi-bindgen
The release profile has strip=true which removes symbol metadata that uniffi-bindgen needs to generate Kotlin bindings. Build a debug host library (without stripping) specifically for bindings generation. The stripped release builds are still used for the actual AAR.
1 parent b096be4 commit 61cac0d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,20 @@ jobs:
230230
cargo ndk --target armv7-linux-androideabi --platform 21 build --release
231231
cargo ndk --target x86_64-linux-android --platform 21 build --release
232232
233+
- name: Build host library for bindings generation
234+
working-directory: bindings
235+
run: cargo build --lib
236+
233237
- name: Generate Kotlin bindings
234238
working-directory: bindings
235239
run: |
236240
rm -rf out/kotlin
237241
mkdir -p out/kotlin
242+
# Use debug host library (not stripped) so uniffi-bindgen can read metadata symbols.
243+
# The release profile has strip=true which removes symbols uniffi-bindgen needs.
238244
../target/release/uniffi-bindgen generate \
239245
--config uniffi.toml \
240-
--library ../target/aarch64-linux-android/release/libcooklang_bindings.so \
246+
--library ../target/debug/libcooklang_bindings.so \
241247
--language kotlin \
242248
--out-dir out/kotlin
243249

0 commit comments

Comments
 (0)