Skip to content

Commit

Permalink
Merge pull request #434 from moka-rs/fix-ci-2024-07-06/v0.12
Browse files Browse the repository at this point in the history
Fix the CI. 2024-07-06 (v0.12.x)
  • Loading branch information
tatsuya6502 committed Jul 6, 2024
2 parents ac542ff + c78027a commit 0476097
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions .ci_extras/pin-crate-vers-msrv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ set -eux

# Pin some dependencies to specific versions for the MSRV.
# cargo update -p <crate> --precise <version>
cargo update -p actix-rt --precise 2.9.0
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"ahash",
"armv",
"benmanes",
"cfgs",
"CHECKME",
"circleci",
"CLFU",
Expand All @@ -33,6 +34,7 @@
"getrandom",
"hashbrown",
"Hasher",
"kani",
"Kawano",
"mapref",
"Miri",
Expand Down
25 changes: 24 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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})");
}
}

0 comments on commit 0476097

Please sign in to comment.