1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-22 12:51:31 +03:00

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
This commit is contained in:
Wez Furlong 2021-03-25 09:34:00 -07:00
parent a2bad801d2
commit dbd7fc28a5
6 changed files with 10 additions and 13 deletions

1
Cargo.lock generated
View File

@ -4464,7 +4464,6 @@ dependencies = [
"mlua", "mlua",
"mux", "mux",
"open", "open",
"openssl",
"ordered-float", "ordered-float",
"palette", "palette",
"portable-pty", "portable-pty",

View File

@ -1,5 +1,6 @@
[workspace] [workspace]
members = ["wezterm-mux-server", "wezterm", "wezterm-gui", "strip-ansi-escapes", "wezterm-ssh"] members = ["wezterm-mux-server", "wezterm", "wezterm-gui", "strip-ansi-escapes", "wezterm-ssh"]
resolver = "2"
[profile.release] [profile.release]
opt-level = 3 opt-level = 3

View File

@ -3,8 +3,13 @@ name = "async_ossl"
version = "0.1.0" version = "0.1.0"
authors = ["Wez Furlong <wez@wezfurlong.org>"] authors = ["Wez Furlong <wez@wezfurlong.org>"]
edition = "2018" edition = "2018"
resolver = "2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # 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" openssl = "0.10"
[target.'cfg(any(windows, target_os="macos"))'.dependencies]
openssl = { version = "0.10", features=["vendored"] }

View File

@ -6,7 +6,7 @@ macOS.
* Install `rustup` to get the `rust` compiler installed on your system. * Install `rustup` to get the `rust` compiler installed on your system.
[Install rustup](https://www.rust-lang.org/en-US/install.html) [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` * Build in release mode: `cargo build --release`
* Run it via either `cargo run --release --bin wezterm` or `target/release/wezterm` * Run it via either `cargo run --release --bin wezterm` or `target/release/wezterm`

View File

@ -4,6 +4,7 @@ version = "0.1.0"
authors = ["Wez Furlong <wez@wezfurlong.org>"] authors = ["Wez Furlong <wez@wezfurlong.org>"]
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
resolver = "2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # 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" mlua = "0.5"
mux = { path = "../mux" } mux = { path = "../mux" }
open = "1.4" open = "1.4"
openssl = "0.10"
ordered-float = "2.1" ordered-float = "2.1"
palette = "0.5" palette = "0.5"
portable-pty = { path = "../pty", features = ["serde_support", "ssh"]} portable-pty = { path = "../pty", features = ["serde_support", "ssh"]}
@ -82,11 +82,6 @@ winapi = { version = "0.3", features = [
"winsock2", "winsock2",
]} ]}
[features]
default = ["vendor_openssl"]
# FIXME: find a way to magically disable vendor_openssl only on linux!
vendor_openssl = ["openssl/vendored"]
[dev-dependencies] [dev-dependencies]
k9 = "0.10.0" k9 = "0.10.0"
pretty_env_logger = "0.4" pretty_env_logger = "0.4"

View File

@ -3,6 +3,7 @@ name = "wezterm-mux-server"
version = "0.1.0" version = "0.1.0"
authors = ["Wez Furlong <wez@wezfurlong.org>"] authors = ["Wez Furlong <wez@wezfurlong.org>"]
edition = "2018" edition = "2018"
resolver = "2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # 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] [target."cfg(windows)".dependencies]
winapi = { version = "0.3", features = [ "winuser" ]} 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"]