From b55046319d3c208acf34c7413608cf92da8e531e Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Fri, 9 Jan 2026 15:36:40 +0100 Subject: [PATCH] remote: Add build-remote-server-binary for use in benchmarks (#46451) Benchmarks that depend on remote server would not rebuild the remote server binary outside of dev builds. Let dependants of remote opt into building the binary even in release builds. Release Notes: - N/A --- crates/remote/Cargo.toml | 1 + crates/remote/src/transport.rs | 4 ++-- crates/remote/src/transport/docker.rs | 2 +- crates/remote/src/transport/ssh.rs | 2 +- crates/remote/src/transport/wsl.rs | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/remote/Cargo.toml b/crates/remote/Cargo.toml index ae32cd5cb10c2bf4c65b3b8ae51bf20e7e3ad15a..139e6c9cf2eddb6f1a52e112991f34e860ccd31e 100644 --- a/crates/remote/Cargo.toml +++ b/crates/remote/Cargo.toml @@ -15,6 +15,7 @@ doctest = false [features] default = [] +build-remote-server-binary = [] test-support = ["fs/test-support"] [dependencies] diff --git a/crates/remote/src/transport.rs b/crates/remote/src/transport.rs index 8031e27ebc9d8ecfccc341f4099abe52f68405f6..d8643147a4b75ff020bf232c861ef3892e934791 100644 --- a/crates/remote/src/transport.rs +++ b/crates/remote/src/transport.rs @@ -170,7 +170,7 @@ fn handle_rpc_messages_over_child_process_stdio( }) } -#[cfg(debug_assertions)] +#[cfg(any(debug_assertions, feature = "build-remote-server-binary"))] async fn build_remote_server_from_source( platform: &crate::RemotePlatform, delegate: &dyn crate::RemoteClientDelegate, @@ -358,7 +358,7 @@ async fn build_remote_server_from_source( Ok(Some(path)) } -#[cfg(debug_assertions)] +#[cfg(any(debug_assertions, feature = "build-remote-server-binary"))] async fn which( binary_name: impl AsRef, cx: &mut AsyncApp, diff --git a/crates/remote/src/transport/docker.rs b/crates/remote/src/transport/docker.rs index 3723001f9e0d04caa571530eab70cbb60155b6c2..379e7f7e622025ac55feeaae2899bb00b3150333 100644 --- a/crates/remote/src/transport/docker.rs +++ b/crates/remote/src/transport/docker.rs @@ -153,7 +153,7 @@ impl DockerExecConnection { let dst_path = paths::remote_server_dir_relative().join(RelPath::unix(&binary_name).unwrap()); - #[cfg(debug_assertions)] + #[cfg(any(debug_assertions, feature = "build-remote-server-binary"))] if let Some(remote_server_path) = super::build_remote_server_from_source(&remote_platform, delegate.as_ref(), cx).await? { diff --git a/crates/remote/src/transport/ssh.rs b/crates/remote/src/transport/ssh.rs index ff4f07f420dce163c818999fcdfb058a490aed98..8fed10608de61da648ddc65e0d1771d8db71e94a 100644 --- a/crates/remote/src/transport/ssh.rs +++ b/crates/remote/src/transport/ssh.rs @@ -625,7 +625,7 @@ impl SshRemoteConnection { let dst_path = paths::remote_server_dir_relative().join(RelPath::unix(&binary_name).unwrap()); - #[cfg(debug_assertions)] + #[cfg(any(debug_assertions, feature = "build-remote-server-binary"))] if let Some(remote_server_path) = super::build_remote_server_from_source(&self.ssh_platform, delegate.as_ref(), cx) .await? diff --git a/crates/remote/src/transport/wsl.rs b/crates/remote/src/transport/wsl.rs index bac263188d58730e720c12ed2805321fe41d206a..94cd8bed8682fe2552fbfbfed088c92e25023647 100644 --- a/crates/remote/src/transport/wsl.rs +++ b/crates/remote/src/transport/wsl.rs @@ -181,7 +181,7 @@ impl WslRemoteConnection { .map_err(|e| anyhow!("Failed to create directory: {}", e))?; } - #[cfg(debug_assertions)] + #[cfg(any(debug_assertions, feature = "build-remote-server-binary"))] if let Some(remote_server_path) = super::build_remote_server_from_source(&self.platform, delegate.as_ref(), cx).await? {