Skip to content

Commit

Permalink
rust: set version of "time" dependency based on rustc version
Browse files Browse the repository at this point in the history
We currently pin "time" to 0.3.20, but this version no longer compiles
on nightly Rust, and will likely not compile on the next stable
version of Rust.

During configure, set the version of "time" based on the version of
rustc found, 0.3.20 for Rust < 1.67, and the current version for Rust
1.67 and newer, which also builds on Rust nightly.

Issue: OISF#7130
  • Loading branch information
jasonish committed Jul 2, 2024
1 parent afc3187 commit 7564047
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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="# "
Expand Down
7 changes: 5 additions & 2 deletions rust/Cargo.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@" }

Expand Down

0 comments on commit 7564047

Please sign in to comment.