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.
This commit is contained in:
parent
93297ad0a0
commit
7968bbb8e6
1 changed files with 6 additions and 1 deletions
|
|
@ -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 `<workspace>/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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue