From 5eb49e075e5d98468ad8a1282aef4a8ccac2e2bb Mon Sep 17 00:00:00 2001 From: Hansie Odendaal <39146854+hansieodendaal@users.noreply.github.com> Date: Sun, 1 Dec 2024 22:19:49 -0800 Subject: [PATCH] chore: enable static linking of openssl dependency (#6708) Description --- Enabled static linking of `openssl` dependencies by specifying `vendored` feature where applicable. Motivation and Context --- A recent change introduced a build and runtime dependency on openssl in Windows - this PR removes that dependency by statically linking openssl. How Has This Been Tested? --- System-level testing - queries to the DNS and Tari Pulse resolves. ``` 2024-11-28 16:51:17.816247200 [p2p::initialization] DEBUG Found 9 peer(s) from `seeds.nextnet.tari.com` in 39ms ``` ``` 2024-11-28 16:51:17.861283000 [c::bn::tari_pulse] INFO Tari Pulse Service initialized with DNS name: checkpoints-nextnet.tari.com 2024-11-28 16:51:18.087188200 [c::bn::tari_pulse] TRACE Passed checkpoints: true, DNS: (45168, 1e3c56468f464072d9879e29a70891e9916f2206116c8819637c266a8b1d2efa), Local: (45168, 1e3c56468f464072d9879e29a70891e9916f2206116c8819637c266a8b1d2efa) ``` What process can a PR reviewer use to test or verify this change? --- Code review Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify --- Cargo.lock | 3 +++ applications/minotari_console_wallet/Cargo.toml | 2 +- applications/minotari_miner/Cargo.toml | 2 +- base_layer/core/Cargo.toml | 12 +++++++++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index feaa1927c5..a295012f50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2572,6 +2572,7 @@ dependencies = [ "futures-util", "idna 0.5.0", "ipnet", + "native-tls", "once_cell", "openssl", "rand", @@ -2582,6 +2583,7 @@ dependencies = [ "time", "tinyvec", "tokio", + "tokio-native-tls", "tokio-rustls", "tracing", "url", @@ -6662,6 +6664,7 @@ dependencies = [ "num-format", "num-traits", "once_cell", + "openssl", "primitive-types", "prost 0.13.3", "quickcheck", diff --git a/applications/minotari_console_wallet/Cargo.toml b/applications/minotari_console_wallet/Cargo.toml index ce54d19af3..9f1c99d521 100644 --- a/applications/minotari_console_wallet/Cargo.toml +++ b/applications/minotari_console_wallet/Cargo.toml @@ -58,7 +58,7 @@ log4rs = { version = "1.3.0", default-features = false, features = [ qrcode = { version = "0.12" } rand = "0.8" regex = "1.5.4" -reqwest = "0.11.18" +reqwest = { version = "0.11.18", features = ["native-tls-vendored"] } rpassword = "5.0" rustyline = "9.0" serde = "1.0.136" diff --git a/applications/minotari_miner/Cargo.toml b/applications/minotari_miner/Cargo.toml index d9afed6c11..1ee131a553 100644 --- a/applications/minotari_miner/Cargo.toml +++ b/applications/minotari_miner/Cargo.toml @@ -41,7 +41,7 @@ log4rs = { version = "1.3.0", default-features = false, features = [ "size_trigger", "fixed_window_roller", ] } -native-tls = "0.2" +native-tls = { version = "0.2", features = ["vendored"] } num_cpus = "1.13" rand = "0.8" serde = { version = "1.0", default-features = false, features = ["derive"] } diff --git a/base_layer/core/Cargo.toml b/base_layer/core/Cargo.toml index 0b7a7b11bb..9326422f1f 100644 --- a/base_layer/core/Cargo.toml +++ b/base_layer/core/Cargo.toml @@ -94,7 +94,11 @@ tiny-keccak = { package = "tari-tiny-keccak", version = "2.0.2", features = [ "keccak", ] } dirs-next = "1.0.2" -hickory-client = { version = "0.25.0-alpha.2", features = ["dns-over-rustls", "dnssec-openssl"], optional = true } +hickory-client = { version = "0.25.0-alpha.2", features = [ + "dns-over-native-tls", + "dnssec-openssl" +], optional = true } +openssl = { version = "0.10.66", features = ["vendored"] } anyhow = "1.0.53" [dev-dependencies] @@ -126,3 +130,9 @@ unexpected_cfgs = { level = "warn", check-cfg = [ 'cfg(tari_target_network_nextnet)', 'cfg(tari_target_network_testnet)', ] } + +[package.metadata.cargo-machete] +openssl = [ + # We need to specify extra features for openssl even though it is not used directly in this crate + "openssl", +]