diff --git a/crates/local-deployment/src/command.rs b/crates/local-deployment/src/command.rs index 9d865720..7dc3ed68 100644 --- a/crates/local-deployment/src/command.rs +++ b/crates/local-deployment/src/command.rs @@ -5,6 +5,7 @@ use nix::{ unistd::{Pid, getpgid}, }; use services::services::container::ContainerError; +#[cfg(unix)] use tokio::time::Duration; pub async fn kill_process_group(child: &mut AsyncGroupChild) -> Result<(), ContainerError> { diff --git a/crates/server/src/routes/task_attempts/cursor_setup.rs b/crates/server/src/routes/task_attempts/cursor_setup.rs index 031dc62b..25f0e9a1 100644 --- a/crates/server/src/routes/task_attempts/cursor_setup.rs +++ b/crates/server/src/routes/task_attempts/cursor_setup.rs @@ -3,9 +3,11 @@ use db::models::{ task_attempt::{TaskAttempt, TaskAttemptError}, }; use deployment::Deployment; +use executors::actions::ExecutorAction; +#[cfg(unix)] use executors::{ actions::{ - ExecutorAction, ExecutorActionType, + ExecutorActionType, script::{ScriptContext, ScriptRequest, ScriptRequestLanguage}, }, executors::cursor::CursorAgent, @@ -50,7 +52,7 @@ pub async fn run_cursor_setup( } async fn get_setup_helper_action() -> Result { - #[cfg(not(windows))] + #[cfg(unix)] { let base_command = CursorAgent::base_command(); // First action: Install @@ -91,9 +93,9 @@ fi )) } - #[cfg(windows)] + #[cfg(not(unix))] { use executors::executors::ExecutorError::SetupHelperNotSupported; - Err(ApiError::Executor(ExecutorError::SetupHelperNotSupported)) + Err(ApiError::Executor(SetupHelperNotSupported)) } } diff --git a/crates/utils/src/shell.rs b/crates/utils/src/shell.rs index cc9b8cc0..b8dfd249 100644 --- a/crates/utils/src/shell.rs +++ b/crates/utils/src/shell.rs @@ -5,7 +5,6 @@ use std::{ env::{join_paths, split_paths}, ffi::{OsStr, OsString}, path::{Path, PathBuf}, - time::Duration, }; use crate::tokio::block_on; @@ -117,6 +116,8 @@ async fn which(executable: &str) -> Option { #[cfg(not(windows))] async fn get_fresh_path() -> Option { + use std::time::Duration; + use tokio::process::Command; async fn run(shell: &Path, login: bool) -> Option {