From c28cadc6c9337816f7af1a2f7c4021b6c9e676b2 Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Thu, 10 Sep 2026 15:17:08 +0200 Subject: [PATCH] chore: move dependencies used by a single crate to said crate (#1729) After an automated update of bindgen broke our build due to a dependency conflict, I did some digging and turns out that was solved by simply moving the bindgen dependency to fact-ebpf which is the only crate that needs it. In order to reduce the chances of this kind of breakage from happening, we are moving all dependencies that are needed by a single crate to said crate. --- Cargo.lock | 50 +++++++++++++++++++------------------------- Cargo.toml | 27 +----------------------- fact-api/Cargo.toml | 4 ++-- fact-ebpf/Cargo.toml | 2 +- fact/Cargo.toml | 42 ++++++++++++++++++------------------- 5 files changed, 47 insertions(+), 78 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5e68a1f8..0064e250 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -183,22 +183,21 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bindgen" -version = "0.72.1" +version = "0.73.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" +checksum = "787ef8ef523575546b106a58213d6e6b06198a05c2f757258c68a74273670cfa" dependencies = [ "bitflags 2.13.2", "cexpr", "clang-sys", - "itertools 0.13.0", "log", - "prettyplease", + "prettyplease 0.3.0", "proc-macro2", "quote", "regex", "rustc-hash", - "shlex 1.3.0", - "syn 2.0.119", + "shlex", + "syn 3.0.5", ] [[package]] @@ -242,7 +241,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "005ec2760ca554fae18df7a11195552ec576cd665632a881bc011d5bb2fd4d80" dependencies = [ "find-msvc-tools", - "shlex 2.0.1", + "shlex", ] [[package]] @@ -490,7 +489,7 @@ dependencies = [ "regex", "serde", "serde_json", - "shlex 2.0.1", + "shlex", "tempfile", "tokio", "tokio-native-tls", @@ -890,15 +889,6 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.14.0" @@ -1272,6 +1262,16 @@ dependencies = [ "syn 2.0.119", ] +[[package]] +name = "prettyplease" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bfe0f4c752e450fc2faf62654f1c134747922825d5b04ca717b8874f41a40c0" +dependencies = [ + "proc-macro2", + "syn 3.0.5", +] + [[package]] name = "proc-macro2" version = "1.0.107" @@ -1321,11 +1321,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" dependencies = [ "heck", - "itertools 0.14.0", + "itertools", "log", "multimap", "petgraph", - "prettyplease", + "prettyplease 0.2.37", "prost", "prost-types", "pulldown-cmark", @@ -1342,7 +1342,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" dependencies = [ "anyhow", - "itertools 0.14.0", + "itertools", "proc-macro2", "quote", "syn 2.0.119", @@ -1595,12 +1595,6 @@ dependencies = [ "zmij", ] -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - [[package]] name = "shlex" version = "2.0.1" @@ -1819,7 +1813,7 @@ version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c68f61875ac5293cf72e6c8cf0158086428c82c37229e98c840878f1706b0322" dependencies = [ - "prettyplease", + "prettyplease 0.2.37", "proc-macro2", "quote", "syn 2.0.119", @@ -1842,7 +1836,7 @@ version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "654e5643eff75d7f8c99197ce1440ed19a3474eada74c12bbac488b2cafdae27" dependencies = [ - "prettyplease", + "prettyplease 0.2.37", "proc-macro2", "prost-build", "prost-types", diff --git a/Cargo.toml b/Cargo.toml index a86fbcee..f59198bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,28 +11,12 @@ default-members = ["fact"] license = "MIT OR Apache-2.0" [workspace.dependencies] -aya = { version = "0.14.0", default-features = false } - anyhow = { version = "1", default-features = false, features = ["std", "backtrace"] } -clap = { version = "4.5.41", features = ["derive", "env"] } -env_logger = { version = "0.11.5", default-features = false, features = ["humantime"] } -glob = "0.3.3" -globset = "0.4.18" -governor = "0.10.4" -http-body-util = "0.1.3" -hyper = { version = "1.6.0", default-features = false } -hyper-tls = "0.6.0" -hyper-util = { version = "0.1.16", default-features = false } +aya = { version = "0.14.0", default-features = false } libc = { version = "0.2.159", default-features = false } -log = { version = "0.4.22", default-features = false } -native-tls = { version = "0.2.14", features = ["alpn"] } -openssl = "0.10.75" -prometheus-client = { version = "0.25.0", default-features = false } prost = "0.14.0" prost-types = "0.14.0" serde = { version = "1.0.219", features = ["derive"] } -serde_json = "1.0.142" -shlex = "2.0.1" tokio = { version = "1.40.0", default-features = false, features = [ "fs", "macros", @@ -41,16 +25,7 @@ tokio = { version = "1.40.0", default-features = false, features = [ "net", "signal", ] } -tokio-native-tls = "0.3.1" -tokio-stream = { version = "0.1.17", features = ["sync"] } tonic = { version = "0.14.0" } -tonic-prost = "0.14.0" -tonic-prost-build = "0.14.0" -uuid = { version = "1.17.0", features = ["v4"] } -bindgen = "0.72.0" -tempfile = { version = "3.20.0", default-features = false } -yaml-rust2 = "0.12.0" -regex = "1.11.1" [profile.release] debug = "line-tables-only" diff --git a/fact-api/Cargo.toml b/fact-api/Cargo.toml index 46543ccc..45447c99 100644 --- a/fact-api/Cargo.toml +++ b/fact-api/Cargo.toml @@ -9,11 +9,11 @@ license.workspace = true [dependencies] tonic = { workspace = true } -tonic-prost = { workspace = true } +tonic-prost = "0.14.0" tokio = { workspace = true } prost = { workspace = true } prost-types = { workspace = true } [build-dependencies] anyhow = { workspace = true } -tonic-prost-build = { workspace = true } +tonic-prost-build = "0.14.0" diff --git a/fact-ebpf/Cargo.toml b/fact-ebpf/Cargo.toml index c605048c..b8ef86ce 100644 --- a/fact-ebpf/Cargo.toml +++ b/fact-ebpf/Cargo.toml @@ -14,4 +14,4 @@ serde = { workspace = true } [build-dependencies] anyhow = { workspace = true } -bindgen = { workspace = true } +bindgen = "0.73.2" diff --git a/fact/Cargo.toml b/fact/Cargo.toml index a2da1245..f7f16445 100644 --- a/fact/Cargo.toml +++ b/fact/Cargo.toml @@ -8,38 +8,38 @@ license.workspace = true [dependencies] anyhow = { workspace = true } aya = { workspace = true } -clap = { workspace = true } -env_logger = { workspace = true } -glob = { workspace = true } -globset = { workspace = true } -governor = { workspace = true } -http-body-util = { workspace = true } -hyper = { workspace = true } -hyper-tls = { workspace = true } -hyper-util = { workspace = true } +clap = { version = "4.5.41", features = ["derive", "env"] } +env_logger = { version = "0.11.5", default-features = false, features = ["humantime"] } +glob = "0.3.3" +globset = "0.4.18" +governor = "0.10.4" +http-body-util = "0.1.3" +hyper = { version = "1.6.0", default-features = false } +hyper-tls = "0.6.0" +hyper-util = { version = "0.1.16", default-features = false } libc = { workspace = true } -log = { workspace = true } -native-tls = { workspace = true } -openssl = { workspace = true } +log = { version = "0.4.22", default-features = false } +native-tls = { version = "0.2.14", features = ["alpn"] } +openssl = "0.10.75" tonic = { workspace = true } tokio = { workspace = true } -tokio-native-tls = { workspace = true } -tokio-stream = { workspace = true } -prometheus-client = { workspace = true } +tokio-native-tls = "0.3.1" +tokio-stream = { version = "0.1.17", features = ["sync"] } +prometheus-client = { version = "0.25.0", default-features = false } prost = { workspace = true } prost-types = { workspace = true } serde = { workspace = true } -serde_json = { workspace = true } -shlex = { workspace = true } -uuid = { workspace = true } -yaml-rust2 = { workspace = true } +serde_json = "1.0.142" +shlex = "2.0.1" +uuid = { version = "1.17.0", features = ["v4"] } +yaml-rust2 = "0.12.0" fact-api = { path = "../fact-api" } fact-ebpf = { path = "../fact-ebpf" } [dev-dependencies] -tempfile = { workspace = true } -regex = { workspace = true } +tempfile = { version = "3.20.0", default-features = false } +regex = "1.11.1" [build-dependencies] anyhow = { workspace = true }