From 5f23ff054341edaaaed537ff2702a12a1fc5ef32 Mon Sep 17 00:00:00 2001 From: Misieq01 <38589417+Misieq01@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:16:35 +0100 Subject: [PATCH] fix: lock version of hickory-client (#6716) ### [ Motivation ] Solves issues in repositories: `universe` => https://github.com/tari-project/universe `tarigpuminer` => https://github.com/stringhandler/tarigpuminer From what I understand `hickory-client` was implemented on version `0.25.0-alpha.2`. Since that time there was release for version `0.25.0-alpha.3` and `0.25.0-alpha.4` with breaking changes which require code adjustments. Because we didn't lock version to `0.25.0-alpha.2` here, in mentioned repositories during build when it comes to building tari_core => tari_p2p it tries to use versions higher then `0.25.0-alpha.2` which breaks the build. It also happens in this repository when you delete Cargo.lock file. To this moment we patched this in mentioned repositories by including these packages with locked versions in Cargo.toml but it cause other smaller problems --- Cargo.lock | 2 ++ base_layer/core/Cargo.toml | 10 +++++++++- base_layer/p2p/Cargo.toml | 11 +++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index feaa1927c5..b49daf934c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6650,6 +6650,7 @@ dependencies = [ "futures 0.3.29", "hex", "hickory-client", + "hickory-proto", "integer-encoding", "libsqlite3-sys", "lmdb-zero", @@ -6892,6 +6893,7 @@ dependencies = [ "fs2", "futures 0.3.29", "hickory-client", + "hickory-proto", "hickory-resolver", "lmdb-zero", "log", diff --git a/base_layer/core/Cargo.toml b/base_layer/core/Cargo.toml index 0b7a7b11bb..488a487bd5 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-rustls", + "dnssec-openssl", +], optional = true } +hickory-proto = { version = "=0.25.0-alpha.2" } anyhow = "1.0.53" [dev-dependencies] @@ -126,3 +130,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [ 'cfg(tari_target_network_nextnet)', 'cfg(tari_target_network_testnet)', ] } + + +[package.metadata.cargo-machete] +ignored = ["hickory-proto"] diff --git a/base_layer/p2p/Cargo.toml b/base_layer/p2p/Cargo.toml index 5cb7b19714..01e7d5f154 100644 --- a/base_layer/p2p/Cargo.toml +++ b/base_layer/p2p/Cargo.toml @@ -28,7 +28,11 @@ pgp = { version = "0.10", optional = true } prost = "0.13.3" rand = "0.8" reqwest = { version = "0.11", optional = true, default-features = false } -rustls = { version = "0.23.13", default-features = false, features = ["logging", "std", "tls12"] } +rustls = { version = "0.23.13", default-features = false, features = [ + "logging", + "std", + "tls12", +] } semver = { version = "1.0.1", optional = true } serde = "1.0.90" thiserror = "1.0.26" @@ -37,8 +41,9 @@ tokio-stream = { version = "0.1.9", default-features = false, features = [ "time", ] } tower = "0.4.11" -hickory-client = { version = "0.25.0-alpha.2", features = ["dns-over-rustls"] } +hickory-client = { version = "=0.25.0-alpha.2", features = ["dns-over-rustls"] } hickory-resolver = "0.25.0-alpha.2" +hickory-proto = { version = "=0.25.0-alpha.2" } webpki-roots = "0.26.6" [dev-dependencies] @@ -58,3 +63,5 @@ tari_common = { path = "../../common", features = [ test-mocks = [] auto-update = ["reqwest/default", "pgp", "semver"] +[package.metadata.cargo-machete] +ignored = ["hickory-proto"]