From e03d373e33f92de201195978dc1e3b1fac7dde5f Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 24 Mar 2025 13:53:34 +0100 Subject: [PATCH] Enable the tokio unstable features --- .cargo/config.toml | 5 ++++- .github/workflows/coverage.yaml | 2 +- crates/cli/build.rs | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 81711ee47..307bcfe43 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,4 +1,7 @@ +[build] +rustflags = ["--cfg", "tokio_unstable"] + # On x86_64, we target the x86-64-v2 psABI, as it is a good compromise between # modern CPU instructions and compatibility. [target.x86_64-unknown-linux-gnu] -rustflags = ["-C", "target-cpu=x86-64-v2"] +rustflags = ["--cfg", "tokio_unstable", "-C", "target-cpu=x86-64-v2"] diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 025b09808..e7d6ab1c8 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -116,7 +116,7 @@ jobs: run: | cargo test --no-fail-fast --workspace env: - RUSTFLAGS: "-Cinstrument-coverage" + RUSTFLAGS: "-Cinstrument-coverage --cfg tokio_unstable" LLVM_PROFILE_FILE: "cargo-test-%p-%m.profraw" DATABASE_URL: postgresql://postgres:postgres@localhost/postgres SQLX_OFFLINE: "1" diff --git a/crates/cli/build.rs b/crates/cli/build.rs index e2a56ee14..2615b1284 100644 --- a/crates/cli/build.rs +++ b/crates/cli/build.rs @@ -6,6 +6,9 @@ use vergen_gitcl::{Emitter, GitclBuilder, RustcBuilder}; fn main() -> anyhow::Result<()> { + // Instruct rustc that we'll be using #[cfg(tokio_unstable)] + println!("cargo::rustc-check-cfg=cfg(tokio_unstable)"); + // At build time, we override the version through the environment variable // VERGEN_GIT_DESCRIBE. In some contexts, it means this variable is set but // empty, so we unset it here.