diff --git a/binaries/daemon/src/spawn.rs b/binaries/daemon/src/spawn.rs index c5c564b2c..80c09d471 100644 --- a/binaries/daemon/src/spawn.rs +++ b/binaries/daemon/src/spawn.rs @@ -116,6 +116,8 @@ pub async fn spawn_node( let python = get_python_path().context("Could not get python path")?; tracing::info!("spawning: {:?} {}", &python, resolved_path.display()); let mut cmd = tokio::process::Command::new(&python); + // Force python to always flush stdout/stderr buffer + cmd.arg("-u"); cmd.arg(&resolved_path); cmd } @@ -221,6 +223,8 @@ pub async fn spawn_node( let python = get_python_path() .context("Could not find python path when spawning runtime node")?; let mut command = tokio::process::Command::new(python); + // Force python to always flush stdout/stderr buffer + command.arg("-u"); command.args([ "-c", format!("import dora; dora.start_runtime() # {}", node.id).as_str(), diff --git a/libraries/core/src/lib.rs b/libraries/core/src/lib.rs index e9ba36a35..a003a002f 100644 --- a/libraries/core/src/lib.rs +++ b/libraries/core/src/lib.rs @@ -31,15 +31,16 @@ pub fn adjust_shared_library_path(path: &Path) -> Result Result { - let python = if cfg!(windows) { + let python = if cfg!(windows) || cfg!(target_os = "macos") { which::which("python") .context("failed to find `python` or `python3`. Make sure that python is available.")? } else { which::which("python3") .context("failed to find `python` or `python3`. Make sure that python is available.")? }; + Ok(python) }