diff --git a/configure.ac b/configure.ac index 7a8be3b6faea..a063bd38e4ef 100644 --- a/configure.ac +++ b/configure.ac @@ -2152,6 +2152,13 @@ fi []) AC_MSG_RESULT(yes) + # Set the version of the "time" dependency based on what version + # of Rust we have. + AS_VERSION_COMPARE([$rustc_version], [1.67.0], + [AC_SUBST([RUST_TIME_VERSION], [=0.3.20])], + [AC_SUBST([RUST_TIME_VERSION], [=0.3.35])], + [AC_SUBST([RUST_TIME_VERSION], [=0.3.35])]) + RUST_FEATURES="" rust_vendor_comment="# " diff --git a/rust/Cargo.toml.in b/rust/Cargo.toml.in index f750765d13c3..f865318495f3 100644 --- a/rust/Cargo.toml.in +++ b/rust/Cargo.toml.in @@ -62,8 +62,11 @@ base64 = "~0.13.0" bendy = { version = "~0.3.3", default-features = false } asn1-rs = { version = "~0.6.1" } -# last version to work with MSRV 1.63 -time = "=0.3.20" +# The version of the time crate will be set by configure based on the +# version of rustc. +# - 0.3.20 for rust older than 1.67. +# - something newer for newer rust +time = "@RUST_TIME_VERSION@" suricata-derive = { path = "./derive", version = "@PACKAGE_VERSION@" }