]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Avoid the uuid crate, use the C++ code already available 16106/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 11 Sep 2025 09:59:38 +0000 (11:59 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 11 Sep 2025 11:23:12 +0000 (13:23 +0200)
uuid pulls in some questionable deps

Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/recursordist/Makefile.am
pdns/recursordist/rec-rust-lib/cxxsupport.cc
pdns/recursordist/rec-rust-lib/rust/Cargo.lock
pdns/recursordist/rec-rust-lib/rust/Cargo.toml
pdns/recursordist/rec-rust-lib/rust/src/bridge.hh
pdns/recursordist/rec-rust-lib/rust/src/misc.rs
pdns/recursordist/rec-rust-lib/rust/src/web.rs

index a2cd2e28d64fb6c99bcf017d220242a32b042843..64c95eed81271d1feda080477e7faecd66844995 100644 (file)
@@ -405,6 +405,7 @@ testrunner_SOURCES = \
        threadname.hh threadname.cc \
        tsigverifier.cc tsigverifier.hh \
        unix_utility.cc \
+       uuid-utils.hh uuid-utils.cc \
        validate-recursor.cc validate-recursor.hh \
        validate.cc validate.hh \
        version.cc version.hh \
@@ -554,7 +555,8 @@ rec_control_SOURCES = \
        sortlist.cc sortlist.hh \
        svc-records.cc svc-records.hh \
        threadname.cc threadname.hh \
-       unix_utility.cc
+       unix_utility.cc \
+       uuid-utils.hh uuid-utils.cc
 
 nodist_rec_control_SOURCES = \
        rec-rust-lib/cxxsettings-generated.cc
index 31ec15dc0859955807504424eb7d259777d70efb..cb5c802c46dd2c5d9bb11fca55d4bcc8ababa542 100644 (file)
@@ -43,6 +43,7 @@
 #include "bridge.hh"
 #include "rec-rust-lib/rust/web.rs.h"
 #include "rec-rust-lib/rust/misc.rs.h"
+#include "uuid-utils.hh"
 
 ::rust::Vec<::rust::String> pdns::settings::rec::getStrings(const std::string& name)
 {
@@ -1507,4 +1508,9 @@ std::shared_ptr<Logger> withValue(const std::shared_ptr<Logger>& logger, ::rust:
   return ret;
 }
 
+::rust::String getUUID()
+{
+  auto uuid = getUniqueID();
+  return to_string(uuid);
+}
 }
index 6ebbd819f4abb7f5b6b70f76570ff81c9842e7a5..b3e5cb8d73a33c06735729a62165533b7621840b 100644 (file)
@@ -56,12 +56,6 @@ version = "2.9.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394"
 
-[[package]]
-name = "bumpalo"
-version = "3.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
-
 [[package]]
 name = "bytes"
 version = "1.10.1"
@@ -123,9 +117,9 @@ dependencies = [
 
 [[package]]
 name = "cxx"
-version = "1.0.182"
+version = "1.0.183"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ad452a72e9376111696579228c2f512e8c2c9dfcc0df8f9edbf1f382f0b932a"
+checksum = "b7acb669333e336b4c8c1605425fbf2b010fe720cecf934b946484f04cd777d7"
 dependencies = [
  "cc",
  "cxx-build",
@@ -138,9 +132,9 @@ dependencies = [
 
 [[package]]
 name = "cxx-build"
-version = "1.0.182"
+version = "1.0.183"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3a059697dfd0d85a56cb6824400c99ed06bda86c385002464a82c666456fcf02"
+checksum = "bfb81a0b7d006a8761dd14f39470c532fede5df0976a296d20b06eff36690772"
 dependencies = [
  "cc",
  "codespan-reporting",
@@ -153,9 +147,9 @@ dependencies = [
 
 [[package]]
 name = "cxxbridge-cmd"
-version = "1.0.182"
+version = "1.0.183"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f37d2b74bcbe4a4251ff25da445c8c7cb313b0a87202b3f755ae3d258c920a78"
+checksum = "ac6109afc47d1ee77717a1a99800d6b646070420b842a933f6f6bf11d72ffd73"
 dependencies = [
  "clap",
  "codespan-reporting",
@@ -167,15 +161,15 @@ dependencies = [
 
 [[package]]
 name = "cxxbridge-flags"
-version = "1.0.182"
+version = "1.0.183"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4cf438558598da5a9c2cbe84ddc0eec08bd9c0165943eaf060e3aa5c47fe1912"
+checksum = "a4e12760f91e84bbc0594b99c9e1b486b2ee6b3da22c2c2e67924b38ab4b858f"
 
 [[package]]
 name = "cxxbridge-macro"
-version = "1.0.182"
+version = "1.0.183"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a8cec220af41ce7fba22fd13229066493fa26f7d9cb51424a0fd4158c02f6e0"
+checksum = "9d44085eb859ca1f523f50a48138a786698a260da0be5e930bb6a5080a02e2be"
 dependencies = [
  "indexmap",
  "proc-macro2",
@@ -258,19 +252,7 @@ checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
 dependencies = [
  "cfg-if",
  "libc",
- "wasi 0.11.1+wasi-snapshot-preview1",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
-dependencies = [
- "cfg-if",
- "libc",
- "r-efi",
- "wasi 0.14.5+wasi-0.2.4",
+ "wasi",
 ]
 
 [[package]]
@@ -423,16 +405,6 @@ version = "1.0.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
 
-[[package]]
-name = "js-sys"
-version = "0.3.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c0b063578492ceec17683ef2f8c5e89121fbd0b172cbc280635ab7567db2738"
-dependencies = [
- "once_cell",
- "wasm-bindgen",
-]
-
 [[package]]
 name = "libc"
 version = "0.2.175"
@@ -448,12 +420,6 @@ dependencies = [
  "cc",
 ]
 
-[[package]]
-name = "log"
-version = "0.4.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
-
 [[package]]
 name = "memchr"
 version = "2.7.5"
@@ -476,7 +442,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c"
 dependencies = [
  "libc",
- "wasi 0.11.1+wasi-snapshot-preview1",
+ "wasi",
  "windows-sys 0.59.0",
 ]
 
@@ -531,12 +497,6 @@ dependencies = [
  "proc-macro2",
 ]
 
-[[package]]
-name = "r-efi"
-version = "5.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
-
 [[package]]
 name = "recrust"
 version = "5.4.0"
@@ -560,7 +520,6 @@ dependencies = [
  "serde_yaml",
  "tokio",
  "tokio-rustls",
- "uuid",
 ]
 
 [[package]]
@@ -571,7 +530,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
 dependencies = [
  "cc",
  "cfg-if",
- "getrandom 0.2.16",
+ "getrandom",
  "libc",
  "untrusted",
  "windows-sys 0.52.0",
@@ -617,9 +576,9 @@ dependencies = [
 
 [[package]]
 name = "rustls-webpki"
-version = "0.103.4"
+version = "0.103.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc"
+checksum = "b5a37813727b78798e53c2bec3f5e8fe12a6d6f8389bf9ca7802add4c9905ad8"
 dependencies = [
  "ring",
  "rustls-pki-types",
@@ -818,17 +777,6 @@ version = "0.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
 
-[[package]]
-name = "uuid"
-version = "1.18.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2"
-dependencies = [
- "getrandom 0.3.3",
- "js-sys",
- "wasm-bindgen",
-]
-
 [[package]]
 name = "want"
 version = "0.3.1"
@@ -844,83 +792,6 @@ version = "0.11.1+wasi-snapshot-preview1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
 
-[[package]]
-name = "wasi"
-version = "0.14.5+wasi-0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4494f6290a82f5fe584817a676a34b9d6763e8d9d18204009fb31dceca98fd4"
-dependencies = [
- "wasip2",
-]
-
-[[package]]
-name = "wasip2"
-version = "1.0.0+wasi-0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03fa2761397e5bd52002cd7e73110c71af2109aca4e521a9f40473fe685b0a24"
-dependencies = [
- "wit-bindgen",
-]
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.101"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e14915cadd45b529bb8d1f343c4ed0ac1de926144b746e2710f9cd05df6603b"
-dependencies = [
- "cfg-if",
- "once_cell",
- "rustversion",
- "wasm-bindgen-macro",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-backend"
-version = "0.2.101"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e28d1ba982ca7923fd01448d5c30c6864d0a14109560296a162f80f305fb93bb"
-dependencies = [
- "bumpalo",
- "log",
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.101"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c3d463ae3eff775b0c45df9da45d68837702ac35af998361e2c84e7c5ec1b0d"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.101"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7bb4ce89b08211f923caf51d527662b75bdc9c9c7aab40f86dcb9fb85ac552aa"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-backend",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.101"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f143854a3b13752c6950862c906306adb27c7e839f7414cec8fea35beab624c1"
-dependencies = [
- "unicode-ident",
-]
-
 [[package]]
 name = "winapi-util"
 version = "0.1.11"
@@ -1027,12 +898,6 @@ version = "0.52.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
 
-[[package]]
-name = "wit-bindgen"
-version = "0.45.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c573471f125075647d03df72e026074b7203790d41351cd6edc96f46bcccd36"
-
 [[package]]
 name = "zeroize"
 version = "1.8.1"
index 15a56747c7bd65f88df9aafe272f59535a9b33e9..2d89e22ccdef12ba9c9ae5183c0c887751c88280 100644 (file)
@@ -27,7 +27,6 @@ rustls = { version = "0.23", default-features = false, features = ["ring"] }
 rustls-pemfile = "2.2"
 pki-types = { package = "rustls-pki-types", version = "1.10" }
 tokio-rustls = { version = "0.26", default-features = false }
-uuid = { version = "1.12.1", features = ["v4"] }
 
 [build-dependencies]
 cxx-build = "1.0"
index 1813b0c86dcb0b85a4c076862e4c9cd92b8a23a2..0710ea48d12159b9993ef20e154f5a06f7244969 100644 (file)
@@ -66,6 +66,7 @@ bool matches(const std::unique_ptr<NetmaskGroup>& nmg, const std::unique_ptr<Com
 std::shared_ptr<Logger> withValue(const std::shared_ptr<Logger>& logger, ::rust::Str key, ::rust::Str val);
 void log(const std::shared_ptr<Logger>& logger, Priority log_level, ::rust::Str msg, const ::rust::Vec<KeyValue>& values);
 void error(const std::shared_ptr<Logger>& logger, Priority log_level, ::rust::Str err, ::rust::Str msg, const ::rust::Vec<KeyValue>& values);
+::rust::String getUUID();
 }
 
 namespace pdns::rust::web::rec
index 81f97694e6054b7b830650d7748e3de3833594d0..aa750c56eacba425056152f852af17331397e531 100644 (file)
@@ -64,5 +64,6 @@ pub mod rustmisc {
             msg: &str,
             values: &Vec<KeyValue>,
         );
+        fn getUUID() -> String;
     }
 }
index acd2f395e1b6489089be13512c93f33adb785e27..e84946c86a75e2562ca05a82e0680665215b24af 100644 (file)
@@ -538,8 +538,8 @@ async fn process_request(
     ctx: Arc<Context>,
     remote: SocketAddr,
 ) -> MyResult<Response<BoxBody>> {
-    let unique = uuid::Uuid::new_v4();
-    let my_logger = rustmisc::withValue(&ctx.logger, "uniqueid", &unique.to_string());
+    let unique = rustmisc::getUUID();
+    let my_logger = rustmisc::withValue(&ctx.logger, "uniqueid", &unique);
 
     // Convert  query part of URI into vars table
     let mut vars: Vec<rustweb::KeyValue> = vec![];