fix(ci): Android APK build in debian:bookworm sibling container #30
1 changed files with 7 additions and 1 deletions
fix(android): point UniFFI --library at CARGO_TARGET_DIR
All checks were successful
ci / test (pull_request) Successful in 2m51s
All checks were successful
ci / test (pull_request) Successful in 2m51s
CI sets CARGO_TARGET_DIR=/cargo-target. Bindgen still looked at crates/onionwire-sdk/target/release/libonionwire_sdk.so and died ENOENT after a green host compile.
commit
53ba1e857f
|
|
@ -55,6 +55,12 @@ val onionwireAbis: List<String> = (findProperty("onionwire.abis") as String?)
|
||||||
val jniLibsDir = layout.buildDirectory.dir("rustJniLibs")
|
val jniLibsDir = layout.buildDirectory.dir("rustJniLibs")
|
||||||
val uniffiKotlinDir = layout.buildDirectory.dir("generated/uniffi")
|
val uniffiKotlinDir = layout.buildDirectory.dir("generated/uniffi")
|
||||||
|
|
||||||
|
// cargo honors CARGO_TARGET_DIR when set (CI sibling container). UniFFI's
|
||||||
|
// --library path must match, or bindgen dies with ENOENT after a green compile.
|
||||||
|
val cargoTargetDir: File = System.getenv("CARGO_TARGET_DIR")?.let(::File)
|
||||||
|
?: sdkCrateDir.resolve("target")
|
||||||
|
val hostCdylib: File = cargoTargetDir.resolve("release/libonionwire_sdk.so")
|
||||||
|
|
||||||
/** Host cdylib. UniFFI's `--library` mode dlopens it, so it must be host-arch. */
|
/** Host cdylib. UniFFI's `--library` mode dlopens it, so it must be host-arch. */
|
||||||
val cargoHostLib by tasks.registering(Exec::class) {
|
val cargoHostLib by tasks.registering(Exec::class) {
|
||||||
group = "onionwire"
|
group = "onionwire"
|
||||||
|
|
@ -76,7 +82,7 @@ val uniffiBindgen by tasks.registering(Exec::class) {
|
||||||
commandLine(
|
commandLine(
|
||||||
cargoExe, "run", "--release", "--bin", "uniffi-bindgen", "--",
|
cargoExe, "run", "--release", "--bin", "uniffi-bindgen", "--",
|
||||||
"generate",
|
"generate",
|
||||||
"--library", "target/release/libonionwire_sdk.so",
|
"--library", hostCdylib.absolutePath,
|
||||||
"--language", "kotlin",
|
"--language", "kotlin",
|
||||||
"--no-format",
|
"--no-format",
|
||||||
"--config", "uniffi.toml",
|
"--config", "uniffi.toml",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue