From 71a878aa399877268c6aa50ff2e8527f16cbf9c8 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Mon, 14 Oct 2024 14:13:06 +0200 Subject: [PATCH] remote ssh: Fix asset embedding in cross-compilation (#19180) This fixes the panic from the settings file not being embedded. Release Notes: - N/A --------- Co-authored-by: Bennet --- Cargo.lock | 1 + crates/recent_projects/src/ssh_connections.rs | 4 +++- crates/remote_server/Cargo.toml | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 14b9f25403..a76e7e5a6d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9153,6 +9153,7 @@ dependencies = [ "project", "remote", "rpc", + "rust-embed", "serde", "serde_json", "settings", diff --git a/crates/recent_projects/src/ssh_connections.rs b/crates/recent_projects/src/ssh_connections.rs index 318c2aec6a..a78a1dbcdf 100644 --- a/crates/recent_projects/src/ssh_connections.rs +++ b/crates/recent_projects/src/ssh_connections.rs @@ -461,7 +461,7 @@ impl SshClientDelegate { } else if let Some(triple) = platform.triple() { smol::fs::create_dir_all("target/remote-server").await?; - self.update_status(Some("Installing cross.rs"), cx); + self.update_status(Some("Installing cross.rs for cross-compilation"), cx); log::info!("installing cross"); run_cmd(Command::new("cargo").args([ "install", @@ -485,6 +485,8 @@ impl SshClientDelegate { "build", "--package", "remote_server", + "--features", + "debug-embed", "--target-dir", "target/remote_server", "--target", diff --git a/crates/remote_server/Cargo.toml b/crates/remote_server/Cargo.toml index bd61919151..25c5860a00 100644 --- a/crates/remote_server/Cargo.toml +++ b/crates/remote_server/Cargo.toml @@ -18,6 +18,7 @@ name = "remote_server" [features] default = [] +debug-embed = ["dep:rust-embed"] test-support = ["fs/test-support"] [dependencies] @@ -36,6 +37,7 @@ node_runtime.workspace = true project.workspace = true remote.workspace = true rpc.workspace = true +rust-embed = { workspace = true, optional = true, features = ["debug-embed"] } serde.workspace = true serde_json.workspace = true settings.workspace = true @@ -61,3 +63,6 @@ serde_json.workspace = true [build-dependencies] cargo_toml.workspace = true toml.workspace = true + +[package.metadata.cargo-machete] +ignored = ["rust-embed"]