From e538ba586c5b8b50955586c8ef2704adb5d7cc43 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Thu, 22 Feb 2024 15:14:55 -0300 Subject: [PATCH] fix(cli): process spawn not working on Node.js for mobile commands, closes #6203 (#8949) --- .changes/fix-mobile-process-spawn.md | 6 ++++++ core/tauri/permissions/window/autogenerated/reference.md | 8 ++++++++ core/tauri/src/window/mod.rs | 4 ++-- tooling/cli/Cargo.lock | 5 +++-- tooling/cli/Cargo.toml | 2 +- tooling/cli/src/mobile/ios/project.rs | 4 ++++ 6 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 .changes/fix-mobile-process-spawn.md diff --git a/.changes/fix-mobile-process-spawn.md b/.changes/fix-mobile-process-spawn.md new file mode 100644 index 000000000..776868528 --- /dev/null +++ b/.changes/fix-mobile-process-spawn.md @@ -0,0 +1,6 @@ +--- +"tauri-cli": patch:bug +"@tauri-apps/cli": patch:bug +--- + +Fixes android and iOS process spawning not working on Node.js. diff --git a/core/tauri/permissions/window/autogenerated/reference.md b/core/tauri/permissions/window/autogenerated/reference.md index 4f369caa4..8fcd8517a 100644 --- a/core/tauri/permissions/window/autogenerated/reference.md +++ b/core/tauri/permissions/window/autogenerated/reference.md @@ -200,6 +200,14 @@ Enables the primary_monitor command without any pre-configured scope. Denies the primary_monitor command without any pre-configured scope. +## allow-reparent + +Enables the reparent command without any pre-configured scope. + +## deny-reparent + +Denies the reparent command without any pre-configured scope. + ## allow-request-user-attention Enables the request_user_attention command without any pre-configured scope. diff --git a/core/tauri/src/window/mod.rs b/core/tauri/src/window/mod.rs index aaf4f5e0e..e83998317 100644 --- a/core/tauri/src/window/mod.rs +++ b/core/tauri/src/window/mod.rs @@ -20,7 +20,7 @@ use crate::{ runtime::{ monitor::Monitor as RuntimeMonitor, window::{DetachedWindow, PendingWindow, WindowBuilder as _}, - ProgressBarStatus, RuntimeHandle, WindowDispatch, + RuntimeHandle, WindowDispatch, }, sealed::ManagerBase, sealed::RuntimeOrDispatch, @@ -1939,7 +1939,7 @@ tauri::Builder::default() #[derive(serde::Deserialize)] pub struct ProgressBarState { /// The progress bar status. - pub status: Option, + pub status: Option, /// The progress bar progress. This can be a value ranging from `0` to `100` pub progress: Option, } diff --git a/tooling/cli/Cargo.lock b/tooling/cli/Cargo.lock index beeeb09e1..09a945fcb 100644 --- a/tooling/cli/Cargo.lock +++ b/tooling/cli/Cargo.lock @@ -459,9 +459,9 @@ dependencies = [ [[package]] name = "cargo-mobile2" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2324a8dabdfe7ecbc0ec64686fbaf0121ebdfafb2848c15ac49301aa6a85a535" +checksum = "8c09fe71e8a0ae116ffb0d5a4bf60ff3b9cd0ad4503753f50c0bd03dede79322" dependencies = [ "colored", "core-foundation", @@ -481,6 +481,7 @@ dependencies = [ "once-cell-regex", "openssl", "os_info", + "os_pipe", "path_abs", "serde", "serde_json", diff --git a/tooling/cli/Cargo.toml b/tooling/cli/Cargo.toml index 37add8e16..8922c147c 100644 --- a/tooling/cli/Cargo.toml +++ b/tooling/cli/Cargo.toml @@ -39,7 +39,7 @@ name = "cargo-tauri" path = "src/main.rs" [dependencies] -cargo-mobile2 = { version = "0.10", default-features = false } +cargo-mobile2 = { version = "0.10.1", default-features = false } jsonrpsee = { version = "0.20", features = [ "server" ] } jsonrpsee-core = "0.20" jsonrpsee-client-transport = { version = "0.20", features = [ "ws" ] } diff --git a/tooling/cli/src/mobile/ios/project.rs b/tooling/cli/src/mobile/ios/project.rs index 8339e6e34..1c6740a5b 100644 --- a/tooling/cli/src/mobile/ios/project.rs +++ b/tooling/cli/src/mobile/ios/project.rs @@ -190,6 +190,8 @@ pub fn gen( &dest.join("project.yml").to_string_lossy(), ], ) + .stdout_file(os_pipe::dup_stdout().unwrap()) + .stderr_file(os_pipe::dup_stderr().unwrap()) .run() .with_context(|| "failed to run `xcodegen`")?; @@ -201,6 +203,8 @@ pub fn gen( &format!("--project-directory={}", dest.display()), ], ) + .stdout_file(os_pipe::dup_stdout().unwrap()) + .stderr_file(os_pipe::dup_stderr().unwrap()) .run() .with_context(|| "failed to run `pod install`")?; }