From ac02b1bf24098f22091401426faac38123535ac1 Mon Sep 17 00:00:00 2001 From: Toni Alatalo Date: Wed, 15 Apr 2026 12:07:53 +0300 Subject: [PATCH] remote: Set current_dir for cargo zigbuild cross-compilation (#53951) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - The cross-compile path for building `remote_server` via `cargo zigbuild` was missing `.current_dir()`, causing it to inherit the process cwd - This fails with "cannot specify features for packages outside of workspace" when Zed is launched from outside its source tree - The native build path at the same location already sets `.current_dir()` correctly — this aligns the cross-compile path Closes #53950 ## Test plan - [x] Build Zed from source - [x] Launch from `/tmp`: `cd /tmp && /path/to/zed some-project --dev-container` - [x] Verify dev container cross-compilation succeeds Release Notes: - Fixed dev container cross-compilation failing when Zed is launched from outside its source directory --------- Co-authored-by: Claude Opus 4.6 --- crates/remote/src/transport.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/remote/src/transport.rs b/crates/remote/src/transport.rs index 5d57b703287539cff4384cec2cbe5966434717c5..1794a68839a6d031107db5f1c9b9ad35b3a73e7c 100644 --- a/crates/remote/src/transport.rs +++ b/crates/remote/src/transport.rs @@ -316,6 +316,7 @@ async fn build_remote_server_from_source( log::info!("building remote binary from source for {triple} with Zig"); run_cmd( new_command("cargo") + .current_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/../..")) .args([ "zigbuild", "--package", @@ -331,7 +332,8 @@ async fn build_remote_server_from_source( ) .await?; }; - let bin_path = Path::new("target") + let bin_path = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/../..")) + .join("target") .join("remote_server") .join(&triple) .join("debug")