From adecfe6f7c9ad7c3a7b6a7bf9d1dc0a90fa4334f Mon Sep 17 00:00:00 2001 From: marshmallow Date: Sun, 31 May 2026 15:08:41 +1000 Subject: [PATCH] fix --experimental-nix-client not changing ping behaviour --- crates/core/src/hive/node.rs | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/crates/core/src/hive/node.rs b/crates/core/src/hive/node.rs index 55ff91b..b917c7f 100644 --- a/crates/core/src/hive/node.rs +++ b/crates/core/src/hive/node.rs @@ -13,7 +13,8 @@ use std::sync::nonpoison::Mutex; use tokio::sync::{RwLock, oneshot}; use tracing::instrument; -use crate::commands::trace_nix_log_message; +use crate::commands::builder::CommandStringBuilder; +use crate::commands::{CommandArguments, WireCommandChip, run_command, trace_nix_log_message}; use crate::errors::NetworkError; use crate::hive::HiveLocation; use crate::hive::steps::build::Build; @@ -111,9 +112,31 @@ impl Target { modifiers: SubCommandModifiers, should_quit: Arc, ) -> Result<(), HiveLibError> { - open_remote_client(&self, modifiers, trace_nix_log_message, should_quit).await?; + if modifiers.experimental_nix_client { + open_remote_client(&self, modifiers, trace_nix_log_message, should_quit).await?; + return Ok(()); + } - // connection established + let host = self.get_preferred_host()?; + + let mut command_string = CommandStringBuilder::new("ssh"); + command_string.arg(format!("{}@{host}", self.user)); + command_string.arg(self.create_ssh_opts(modifiers)?); + command_string.arg("exit"); + + let output = run_command( + &CommandArguments::new(command_string, modifiers) + .log_stdout() + .mode(crate::commands::ChildOutputMode::Generic), + ) + .await?; + + output.wait_till_success().await.map_err(|source| { + HiveLibError::NetworkError(NetworkError::HostUnreachable { + host: host.to_string(), + source, + }) + })?; Ok(()) } -- 2.51.2