From 42a9ae16663002579e2ce5072fede3287dddd2fc Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 19:28:06 +0000 Subject: [PATCH] Fix the argument order when starting devcontainers (#45584) (cherry-pick to preview) (#45586) Cherry-pick of #45584 to preview ---- Release Notes: - (Preview only) Fix devcontainers not starting when certain env variables were set Co-authored-by: KyleBarton Co-authored-by: Kirill Bulatov Co-authored-by: KyleBarton --- crates/remote/src/transport.rs | 3 +++ crates/remote/src/transport/docker.rs | 16 +++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/crates/remote/src/transport.rs b/crates/remote/src/transport.rs index 4cafbf60eec338addbb43e46d156960621301ab0..a7872e4178ef74c3f4bef762020706128d481590 100644 --- a/crates/remote/src/transport.rs +++ b/crates/remote/src/transport.rs @@ -158,6 +158,9 @@ fn handle_rpc_messages_over_child_process_stdio( } }; let status = remote_proxy_process.status().await?.code().unwrap_or(1); + if status != 0 { + anyhow::bail!("Remote server exited with status {status}"); + } match result { Ok(_) => Ok(status), Err(error) => Err(error), diff --git a/crates/remote/src/transport/docker.rs b/crates/remote/src/transport/docker.rs index 09f5935ec621260e933f11f46aa57493a31ace6d..34afb3174e2ff6fe6ff2f41ac51ad7723888a547 100644 --- a/crates/remote/src/transport/docker.rs +++ b/crates/remote/src/transport/docker.rs @@ -582,19 +582,21 @@ impl RemoteConnection for DockerExecConnection { return Task::ready(Err(anyhow!("Remote binary path not set"))); }; - let mut docker_args = vec![ - "exec".to_string(), - "-w".to_string(), - self.remote_dir_for_server.clone(), - "-i".to_string(), - self.connection_options.container_id.to_string(), - ]; + let mut docker_args = vec!["exec".to_string()]; for env_var in ["RUST_LOG", "RUST_BACKTRACE", "ZED_GENERATE_MINIDUMPS"] { if let Some(value) = std::env::var(env_var).ok() { docker_args.push("-e".to_string()); docker_args.push(format!("{}='{}'", env_var, value)); } } + + docker_args.extend([ + "-w".to_string(), + self.remote_dir_for_server.clone(), + "-i".to_string(), + self.connection_options.container_id.to_string(), + ]); + let val = remote_binary_relpath .display(self.path_style()) .into_owned();