diff --git a/strawApp/build.gradle.kts b/strawApp/build.gradle.kts index d1c4b0dd2..0a4c50df7 100644 --- a/strawApp/build.gradle.kts +++ b/strawApp/build.gradle.kts @@ -142,6 +142,11 @@ val cargoBin: String = "$cargoHome/bin/cargo" val ndkHome: String = System.getenv("ANDROID_NDK_HOME") ?: System.getenv("ANDROID_NDK_ROOT") ?: "/caches/android-sdk/ndk/27.2.12479018" +// Honor CARGO_TARGET_DIR if set (we redirect it to /caches on crafting-table +// because the container's writable rootfs hits 100% before the cross-compile +// for 4 ABIs finishes). Falls back to the default `/target`. +val cargoTargetDir: String = System.getenv("CARGO_TARGET_DIR") + ?: "$rustRoot/target" val cargoBuild by tasks.registering(Exec::class) { group = "rust" @@ -181,7 +186,7 @@ val uniffiBindgen by tasks.registering(Exec::class) { commandLine = listOf( cargoBin, "run", "--quiet", "--bin", "uniffi-bindgen", "--", "generate", - "--library", "target/debug/libstrawcore.so", + "--library", "$cargoTargetDir/debug/libstrawcore.so", "--crate", "strawcore", "--language", "kotlin", "--no-format",