From dbd7fc28a5350b6f7a9f3a8d1d5571197df3ab80 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 25 Mar 2021 09:34:00 -0700 Subject: [PATCH] Raise minimum Rust version to 1.51, de-vendor openssl on unix Rust 1.51 allows addressesing a long-standing TODO which was that we shouldn't need to build a vendored copy of openssl on most sensible unix systems. We do require a vendored copy on macOS and Windows, but due to the way that Cargo's feature resolver worked, it wasn't possible for this requirement to be respected. Rust 1.51 introduces `resolver="2"` which can deal with this feature resolution! https://doc.rust-lang.org/nightly/cargo/reference/features.html#feature-resolver-version-2 The upshot of this is that building wezterm on real unix systems that are not macos will now link against the system libssl, resulting in both a shorter compile time and less headaches arising from having a slightly different openssl used by wezterm than the rest of the system. cc: @jsgf --- Cargo.lock | 1 - Cargo.toml | 1 + async_ossl/Cargo.toml | 7 ++++++- docs/install/source.markdown | 2 +- wezterm-gui/Cargo.toml | 7 +------ wezterm-mux-server/Cargo.toml | 5 +---- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 526949e51..9805c1499 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4464,7 +4464,6 @@ dependencies = [ "mlua", "mux", "open", - "openssl", "ordered-float", "palette", "portable-pty", diff --git a/Cargo.toml b/Cargo.toml index 4048fc570..4ff05f7fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = ["wezterm-mux-server", "wezterm", "wezterm-gui", "strip-ansi-escapes", "wezterm-ssh"] +resolver = "2" [profile.release] opt-level = 3 diff --git a/async_ossl/Cargo.toml b/async_ossl/Cargo.toml index 78f091dcc..b52df89c3 100644 --- a/async_ossl/Cargo.toml +++ b/async_ossl/Cargo.toml @@ -3,8 +3,13 @@ name = "async_ossl" version = "0.1.0" authors = ["Wez Furlong "] edition = "2018" +resolver = "2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[dependencies] +[target.'cfg(not(any(windows, target_os="macos")))'.dependencies] openssl = "0.10" + +[target.'cfg(any(windows, target_os="macos"))'.dependencies] +openssl = { version = "0.10", features=["vendored"] } + diff --git a/docs/install/source.markdown b/docs/install/source.markdown index daa5788ea..31d8f0eb0 100644 --- a/docs/install/source.markdown +++ b/docs/install/source.markdown @@ -6,7 +6,7 @@ macOS. * Install `rustup` to get the `rust` compiler installed on your system. [Install rustup](https://www.rust-lang.org/en-US/install.html) -* Rust version 1.41 or later is required +* Rust version 1.51 or later is required * Build in release mode: `cargo build --release` * Run it via either `cargo run --release --bin wezterm` or `target/release/wezterm` diff --git a/wezterm-gui/Cargo.toml b/wezterm-gui/Cargo.toml index 925963614..63d09a829 100644 --- a/wezterm-gui/Cargo.toml +++ b/wezterm-gui/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" authors = ["Wez Furlong "] edition = "2018" build = "build.rs" +resolver = "2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -36,7 +37,6 @@ metrics = { version="0.14", features=["std"]} mlua = "0.5" mux = { path = "../mux" } open = "1.4" -openssl = "0.10" ordered-float = "2.1" palette = "0.5" portable-pty = { path = "../pty", features = ["serde_support", "ssh"]} @@ -82,11 +82,6 @@ winapi = { version = "0.3", features = [ "winsock2", ]} -[features] -default = ["vendor_openssl"] -# FIXME: find a way to magically disable vendor_openssl only on linux! -vendor_openssl = ["openssl/vendored"] - [dev-dependencies] k9 = "0.10.0" pretty_env_logger = "0.4" diff --git a/wezterm-mux-server/Cargo.toml b/wezterm-mux-server/Cargo.toml index af68db2dd..967dcfea8 100644 --- a/wezterm-mux-server/Cargo.toml +++ b/wezterm-mux-server/Cargo.toml @@ -3,6 +3,7 @@ name = "wezterm-mux-server" version = "0.1.0" authors = ["Wez Furlong "] edition = "2018" +resolver = "2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -25,7 +26,3 @@ wezterm-gui-subcommands = { path = "../wezterm-gui-subcommands" } [target."cfg(windows)".dependencies] winapi = { version = "0.3", features = [ "winuser" ]} -[features] -default = ["vendor_openssl"] -# FIXME: find a way to magically disable vendor_openssl only on linux! -vendor_openssl = ["openssl/vendored"]