mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
fix(android): spawn shell to cargo (#10024)
Unfortunately this seems to be a race condition with read or setting the path properly for this exec block. I've verified `cargo` is in the PATH, and have tried this on a fresh Mac with Android Studio (latest release version). Spawning cargo from `sh -c` fixes the issue.
This commit is contained in:
@@ -279,23 +279,12 @@ val generateUniffiBindings =
|
||||
doLast {
|
||||
// Execute uniffi-bindgen command from the rust directory
|
||||
project.exec {
|
||||
// Set working directory to the rust directory which is outside the gradle project
|
||||
workingDir(rustDir)
|
||||
|
||||
// Build the command
|
||||
// Spawn a shell to run the command; fixes PATH race conditions that can cause
|
||||
// the cargo executable to not be found even though it is in the PATH.
|
||||
commandLine(
|
||||
"cargo",
|
||||
"run",
|
||||
"--bin",
|
||||
"uniffi-bindgen",
|
||||
"generate",
|
||||
"--library",
|
||||
"--language",
|
||||
"kotlin",
|
||||
input.asFile,
|
||||
"--out-dir",
|
||||
outDir.asFile,
|
||||
"--no-format",
|
||||
"sh",
|
||||
"-c",
|
||||
"cd ${rustDir.asFile} && cargo run --bin uniffi-bindgen generate --library --language kotlin ${input.asFile} --out-dir ${outDir.asFile} --no-format",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user