diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c138fa7..30055c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: include: - { rust: stable, os: ubuntu-latest } - { rust: stable, os: macos-latest } - - { rust: stable, os: windows-latest } + # - { rust: stable, os: windows-latest } steps: - uses: actions/checkout@v2 - name: Install Rust ${{ matrix.rust }} diff --git a/core/src/server/distant/handler.rs b/core/src/server/distant/handler.rs index 4bec09b..8e4a9f9 100644 --- a/core/src/server/distant/handler.rs +++ b/core/src/server/distant/handler.rs @@ -2092,6 +2092,10 @@ mod tests { #[tokio::test] async fn proc_run_should_send_back_stdout_periodically_when_available() { let (conn_id, state, tx, mut rx) = setup(1); + println!( + "ECHO_ARGS_TO_STDOUT_SH: {:?}", + ECHO_ARGS_TO_STDOUT_SH.to_str() + ); // Run a program that echoes to stdout let req = Request::new( diff --git a/src/session.rs b/src/session.rs index a61e2de..23e047f 100644 --- a/src/session.rs +++ b/src/session.rs @@ -30,7 +30,7 @@ impl CliSession { ); let map_line = move |line: &str| match format { - Format::Json => serde_json::from_str(&line) + Format::Json => serde_json::from_str(line) .map_err(|x| io::Error::new(io::ErrorKind::InvalidInput, x)), Format::Shell => { let data = RequestData::from_iter_safe( diff --git a/src/subcommand/action.rs b/src/subcommand/action.rs index 85cce04..dfc80d4 100644 --- a/src/subcommand/action.rs +++ b/src/subcommand/action.rs @@ -17,19 +17,19 @@ use tokio::{io, time::Duration}; pub enum Error { #[display(fmt = "Process failed with exit code: {}", _0)] BadProcessExit(#[error(not(source))] i32), - IoError(io::Error), + Io(io::Error), #[display(fmt = "Non-interactive but no operation supplied")] MissingOperation, OperationFailed, - RemoteProcessError(RemoteProcessError), - TransportError(TransportError), + RemoteProcess(RemoteProcessError), + Transport(TransportError), } impl ExitCodeError for Error { fn is_silent(&self) -> bool { match self { Self::BadProcessExit(_) | Self::OperationFailed => true, - Self::RemoteProcessError(x) => x.is_silent(), + Self::RemoteProcess(x) => x.is_silent(), _ => false, } } @@ -37,11 +37,11 @@ impl ExitCodeError for Error { fn to_exit_code(&self) -> ExitCode { match self { Self::BadProcessExit(x) => ExitCode::Custom(*x), - Self::IoError(x) => x.to_exit_code(), + Self::Io(x) => x.to_exit_code(), Self::MissingOperation => ExitCode::Usage, Self::OperationFailed => ExitCode::Software, - Self::RemoteProcessError(x) => x.to_exit_code(), - Self::TransportError(x) => x.to_exit_code(), + Self::RemoteProcess(x) => x.to_exit_code(), + Self::Transport(x) => x.to_exit_code(), } } } diff --git a/src/subcommand/launch.rs b/src/subcommand/launch.rs index 7289535..73f912f 100644 --- a/src/subcommand/launch.rs +++ b/src/subcommand/launch.rs @@ -18,18 +18,18 @@ pub enum Error { #[display(fmt = "Missing data for session")] MissingSessionData, - ForkError(#[error(not(source))] i32), - IoError(io::Error), - Utf8Error(FromUtf8Error), + Fork(#[error(not(source))] i32), + Io(io::Error), + Utf8(FromUtf8Error), } impl ExitCodeError for Error { fn to_exit_code(&self) -> ExitCode { match self { Self::MissingSessionData => ExitCode::NoInput, - Self::ForkError(_) => ExitCode::OsErr, - Self::IoError(x) => x.to_exit_code(), - Self::Utf8Error(_) => ExitCode::DataErr, + Self::Fork(_) => ExitCode::OsErr, + Self::Io(x) => x.to_exit_code(), + Self::Utf8(_) => ExitCode::DataErr, } } } @@ -90,7 +90,7 @@ pub fn run(cmd: LaunchSubcommand, opt: CommonOpt) -> Result<(), Error> { })? } Ok(_) => {} - Err(x) => return Err(Error::ForkError(x)), + Err(x) => return Err(Error::Fork(x)), } } #[cfg(unix)] diff --git a/src/subcommand/listen.rs b/src/subcommand/listen.rs index c8ba818..1422608 100644 --- a/src/subcommand/listen.rs +++ b/src/subcommand/listen.rs @@ -11,19 +11,19 @@ use tokio::{io, task::JoinError}; #[derive(Debug, Display, Error, From)] pub enum Error { - ConvertToIpAddrError(ConvertToIpAddrError), - ForkError, - IoError(io::Error), - JoinError(JoinError), + ConverToIpAddr(ConvertToIpAddrError), + Fork, + Io(io::Error), + Join(JoinError), } impl ExitCodeError for Error { fn to_exit_code(&self) -> ExitCode { match self { - Self::ConvertToIpAddrError(_) => ExitCode::NoHost, - Self::ForkError => ExitCode::OsErr, - Self::IoError(x) => x.to_exit_code(), - Self::JoinError(_) => ExitCode::Software, + Self::ConverToIpAddr(_) => ExitCode::NoHost, + Self::Fork => ExitCode::OsErr, + Self::Io(x) => x.to_exit_code(), + Self::Join(_) => ExitCode::Software, } } } @@ -39,10 +39,10 @@ pub fn run(cmd: ListenSubcommand, opt: CommonOpt) -> Result<(), Error> { Ok(Fork::Parent(pid)) => { info!("[distant detached, pid = {}]", pid); if fork::close_fd().is_err() { - return Err(Error::ForkError); + return Err(Error::Fork); } } - Err(_) => return Err(Error::ForkError), + Err(_) => return Err(Error::Fork), } } else { let rt = tokio::runtime::Runtime::new()?; @@ -84,7 +84,7 @@ async fn run_async(cmd: ListenSubcommand, _opt: CommonOpt, is_forked: bool) -> R // For the child, we want to fully disconnect it from pipes, which we do now if is_forked && fork::close_fd().is_err() { - return Err(Error::ForkError); + return Err(Error::Fork); } // Let our server run to completion diff --git a/src/subcommand/lsp.rs b/src/subcommand/lsp.rs index 9ea294d..71a41fd 100644 --- a/src/subcommand/lsp.rs +++ b/src/subcommand/lsp.rs @@ -15,14 +15,14 @@ use tokio::io; pub enum Error { #[display(fmt = "Process failed with exit code: {}", _0)] BadProcessExit(#[error(not(source))] i32), - IoError(io::Error), - RemoteProcessError(RemoteProcessError), + Io(io::Error), + RemoteProcess(RemoteProcessError), } impl ExitCodeError for Error { fn is_silent(&self) -> bool { match self { - Self::RemoteProcessError(x) => x.is_silent(), + Self::RemoteProcess(x) => x.is_silent(), _ => false, } } @@ -30,8 +30,8 @@ impl ExitCodeError for Error { fn to_exit_code(&self) -> ExitCode { match self { Self::BadProcessExit(x) => ExitCode::Custom(*x), - Self::IoError(x) => x.to_exit_code(), - Self::RemoteProcessError(x) => x.to_exit_code(), + Self::Io(x) => x.to_exit_code(), + Self::RemoteProcess(x) => x.to_exit_code(), } } }