From 76159f9c6cea7b72f85eac7f53177628797142c6 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sat, 6 Jul 2024 15:46:25 +0800 Subject: [PATCH 1/2] Fix the CI for the MSRV 1.65 - Pin `actix-rt` to v2.9.0 for the MSRV 1.65, otherwise the build will fail. --- .ci_extras/pin-crate-vers-msrv.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.ci_extras/pin-crate-vers-msrv.sh b/.ci_extras/pin-crate-vers-msrv.sh index d05ec46d..cbf65bb4 100755 --- a/.ci_extras/pin-crate-vers-msrv.sh +++ b/.ci_extras/pin-crate-vers-msrv.sh @@ -4,3 +4,4 @@ set -eux # Pin some dependencies to specific versions for the MSRV. # cargo update -p --precise +cargo update -p actix-rt --precise 2.9.0 From c78027a13090be6c1402fbe6d17b5e01a505c364 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sat, 6 Jul 2024 15:51:25 +0800 Subject: [PATCH 2/2] Fix the CI with Rust 1.80 beta - Make `rustc` to allow specific custom `cfg` condition names (e.g., `rustver`). --- .vscode/settings.json | 2 ++ build.rs | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 17072aa5..a8aa663c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,6 +10,7 @@ "ahash", "armv", "benmanes", + "cfgs", "CHECKME", "circleci", "CLFU", @@ -33,6 +34,7 @@ "getrandom", "hashbrown", "Hasher", + "kani", "Kawano", "mapref", "Miri", diff --git a/build.rs b/build.rs index 72a59c0e..e99050f6 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,15 @@ +#![allow(unexpected_cfgs)] // for `#[cfg(rustver)]` in this build.rs. + +const ALLOWED_CFG_NAMES: &[&str] = &[ + "armv5te", + "beta_clippy", + "circleci", + "kani", + "mips", + "rustver", + "trybuild", +]; + #[cfg(rustver)] fn main() { use rustc_version::version; @@ -6,7 +18,18 @@ fn main() { "cargo:rustc-env=RUSTC_SEMVER={}.{}", version.major, version.minor ); + + allow_cfgs(ALLOWED_CFG_NAMES); } #[cfg(not(rustver))] -fn main() {} +fn main() { + allow_cfgs(ALLOWED_CFG_NAMES); +} + +/// Tells `rustc` to allow `#[cfg(...)]` with the given names. +fn allow_cfgs(names: &[&str]) { + for name in names.iter() { + println!("cargo:rustc-check-cfg=cfg({name})"); + } +}