From 7968bbb8e6161e08ab72ab07a3641eb5e523a645 Mon Sep 17 00:00:00 2001 From: Kayos Date: Sun, 24 May 2026 12:59:59 -0700 Subject: [PATCH] Path C-2 fix: uniffiBindgen honors CARGO_TARGET_DIR The crafting-table container's rootfs hits 100% disk before cross- compile finishes for 4 ABIs, so we redirect CARGO_TARGET_DIR to /caches. The uniffiBindgen task was looking for libstrawcore.so at target/debug/ (default) and failed when it had been written to $CARGO_TARGET_DIR/debug/ instead. Honor the env var with a fallback to the workspace-relative default. --- strawApp/build.gradle.kts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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",