diff --git a/crates/remote/src/transport.rs b/crates/remote/src/transport.rs index 133fbecdf8..ceb9df9504 100644 --- a/crates/remote/src/transport.rs +++ b/crates/remote/src/transport.rs @@ -274,6 +274,21 @@ async fn build_remote_server_from_source( log::warn!("ZED_BUILD_REMOTE_SERVER is disabled, but no server binary exists on the server") } + // Bundles ship a prebuilt remote server next to the editor binary so installs without a + // zed checkout can still provision remote hosts. The .gz suffix makes the remote-side + // extract step gunzip it. + let bundled_remote_server = std::env::current_exe() + .ok() + .and_then(|exe| exe.parent().map(|dir| dir.join("zed-remote-server.gz"))) + .filter(|path| path.is_file()); + if let Some(bundled_remote_server) = bundled_remote_server { + if binary_exists_on_server { + return Ok(None); + } + log::info!("uploading bundled remote server binary"); + return Ok(Some(bundled_remote_server)); + } + async fn run_cmd(command: &mut Command) -> Result<()> { let output = command .kill_on_drop(true) diff --git a/script/bundle-linux b/script/bundle-linux index 2c7d4430fa..23df9f1bd0 100755 --- a/script/bundle-linux +++ b/script/bundle-linux @@ -151,6 +151,7 @@ zed_dir="${temp_dir}/zed$suffix.app" mkdir -p "${zed_dir}/bin" "${zed_dir}/libexec" cp "${target_dir}/${target_triple}/release/zed" "${zed_dir}/libexec/zed-editor" cp "${target_dir}/${target_triple}/release/cli" "${zed_dir}/bin/zed" +gzip -c --best "${target_dir}/${remote_server_triple}/release/remote_server" > "${zed_dir}/libexec/zed-remote-server.gz" # Libs # Bundle libstdc++ so older supported systems can run binaries built with our