diff --git a/Cargo.lock b/Cargo.lock index 3e28404fc1..205ee405b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1230,6 +1230,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap 3.2.25", + "cli_rpc", "core-foundation", "core-services", "dirs 3.0.2", @@ -1240,6 +1241,15 @@ dependencies = [ "util", ] +[[package]] +name = "cli_rpc" +version = "0.1.0" +dependencies = [ + "ipc-channel", + "serde", + "serde_derive", +] + [[package]] name = "client" version = "0.1.0" @@ -1855,7 +1865,6 @@ checksum = "14d05c10f541ae6f3bc5b3d923c20001f47db7d5f0b2bc6ad16490133842db79" dependencies = [ "cc", "libc", - "libnghttp2-sys", "libz-sys", "openssl-sys", "pkg-config", @@ -2885,20 +2894,12 @@ dependencies = [ "anyhow", "async-task", "backtrace", - "bindgen", - "block", - "cc", - "cocoa", "collections", - "core-foundation", - "core-graphics", - "core-text", "ctor", "dhat", "env_logger 0.9.3", "etagere", "font-kit", - "foreign-types", "futures 0.3.28", "gpui_macros", "image", @@ -2906,9 +2907,7 @@ dependencies = [ "lazy_static", "log", "media", - "metal", "num_cpus", - "objc", "ordered-float", "parking", "parking_lot 0.11.2", @@ -2936,6 +2935,41 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "gpui_mac" +version = "0.1.0" +dependencies = [ + "anyhow", + "async-task", + "bindgen", + "block", + "cc", + "cocoa", + "collections", + "core-foundation", + "core-graphics", + "core-text", + "ctor", + "etagere", + "font-kit", + "foreign-types", + "gpui", + "log", + "media", + "metal", + "objc", + "ordered-float", + "parking_lot 0.11.2", + "pathfinder_geometry", + "postage", + "resvg", + "smol", + "time 0.3.21", + "tiny-skia", + "usvg", + "uuid 1.3.2", +] + [[package]] name = "gpui_macros" version = "0.1.0" @@ -3691,16 +3725,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" -[[package]] -name = "libnghttp2-sys" -version = "0.1.7+1.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "libsqlite3-sys" version = "0.24.2" @@ -8919,7 +8943,7 @@ dependencies = [ "breadcrumbs", "call", "chrono", - "cli", + "cli_rpc", "client", "clock", "collab_ui", @@ -8941,6 +8965,7 @@ dependencies = [ "fuzzy", "go_to_line", "gpui", + "gpui_mac", "ignore", "image", "indexmap", diff --git a/Cargo.toml b/Cargo.toml index 640384a792..9807afb66d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = [ "crates/breadcrumbs", "crates/call", "crates/cli", + "crates/cli_rpc", "crates/client", "crates/clock", "crates/collab", @@ -27,6 +28,7 @@ members = [ "crates/git", "crates/go_to_line", "crates/gpui", + "crates/gpui_mac", "crates/gpui_macros", "crates/install_cli", "crates/journal", @@ -79,7 +81,7 @@ env_logger = { version = "0.9" } futures = { version = "0.3" } globset = { version = "0.4" } indoc = "1" -isahc = "1.7.2" +isahc = {version = "1.7.2", default-features = false, features = ["text-decoding"]} lazy_static = { version = "1.4.0" } log = { version = "0.4.16", features = ["kv_unstable_serde"] } ordered-float = { version = "2.1.1" } diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 2b4a375a5b..624ba4c91a 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -4,9 +4,6 @@ version = "0.1.0" edition = "2021" publish = false -[lib] -path = "src/cli.rs" -doctest = false [[bin]] name = "cli" @@ -20,6 +17,7 @@ ipc-channel = "0.16" serde.workspace = true serde_derive.workspace = true util = { path = "../util" } +cli_rpc = {path = "../cli_rpc"} [target.'cfg(target_os = "macos")'.dependencies] core-foundation = "0.9" diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index bdf677512c..d711c7f66e 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -1,6 +1,6 @@ use anyhow::{anyhow, Context, Result}; use clap::Parser; -use cli::{CliRequest, CliResponse, IpcHandshake, FORCE_CLI_MODE_ENV_VAR_NAME}; +use cli_rpc::{CliRequest, CliResponse, IpcHandshake, FORCE_CLI_MODE_ENV_VAR_NAME}; use core_foundation::{ array::{CFArray, CFIndex}, string::kCFStringEncodingUTF8, diff --git a/crates/cli_rpc/Cargo.toml b/crates/cli_rpc/Cargo.toml new file mode 100644 index 0000000000..38d94da89c --- /dev/null +++ b/crates/cli_rpc/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "cli_rpc" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +ipc-channel = "0.16" +serde.workspace = true +serde_derive.workspace = true diff --git a/crates/cli/src/cli.rs b/crates/cli_rpc/src/lib.rs similarity index 100% rename from crates/cli/src/cli.rs rename to crates/cli_rpc/src/lib.rs diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index 7e46edeb95..9fe55871c7 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -20,7 +20,7 @@ activity_indicator = { path = "../activity_indicator" } auto_update = { path = "../auto_update" } breadcrumbs = { path = "../breadcrumbs" } call = { path = "../call" } -cli = { path = "../cli" } +cli_rpc = { path = "../cli_rpc" } collab_ui = { path = "../collab_ui" } collections = { path = "../collections" } command_palette = { path = "../command_palette" } diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index c7554132a0..74adce6919 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -3,7 +3,7 @@ use anyhow::{anyhow, Context, Result}; use backtrace::Backtrace; -use cli::{ +use cli_rpc::{ ipc::{self, IpcSender}, CliRequest, CliResponse, IpcHandshake, FORCE_CLI_MODE_ENV_VAR_NAME, }; @@ -67,7 +67,8 @@ fn main() { log::info!("========== starting zed =========="); let platform = platform(); - let foreground = std::rc::Rc::new(gpui::executor::Foreground::platform(platform.dispatcher()).unwrap()); + let foreground = + std::rc::Rc::new(gpui::executor::Foreground::platform(platform.dispatcher()).unwrap()); let fplatform = foreground_platform(foreground); let mut app = gpui::App::new(Assets, platform, fplatform).unwrap(); @@ -666,7 +667,7 @@ async fn watch_languages(_: Arc, _: Arc) -> Option<()> fn connect_to_cli( server_name: &str, ) -> Result<(mpsc::Receiver, IpcSender)> { - let handshake_tx = cli::ipc::IpcSender::::connect(server_name.to_string()) + let handshake_tx = cli_rpc::ipc::IpcSender::::connect(server_name.to_string()) .context("error connecting to cli")?; let (request_tx, request_rx) = ipc::channel::()?; let (response_tx, response_rx) = ipc::channel::()?;