Fix win compile issue (#1180)

This commit is contained in:
Alex Netsch
2025-11-04 13:36:17 +00:00
committed by GitHub
parent b6d876a54b
commit 40b1ff7dd8
3 changed files with 9 additions and 5 deletions

View File

@@ -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> {

View File

@@ -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<ExecutorAction, ApiError> {
#[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))
}
}

View File

@@ -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<PathBuf> {
#[cfg(not(windows))]
async fn get_fresh_path() -> Option<String> {
use std::time::Duration;
use tokio::process::Command;
async fn run(shell: &Path, login: bool) -> Option<String> {