From 02185f7034f3d9007dcb4bc01e452616dfc6511f Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 4 Jun 2024 23:34:38 +0200 Subject: [PATCH 1/2] Configure unexpected-cfgs via Cargo.toml instead of build scripts --- Cargo.toml | 3 +++ crates/matrix-sdk-base/build.rs | 7 ------- crates/matrix-sdk-common/build.rs | 3 --- crates/matrix-sdk-crypto/build.rs | 7 ------- crates/matrix-sdk-indexeddb/build.rs | 7 ------- crates/matrix-sdk-sqlite/build.rs | 7 ------- crates/matrix-sdk-ui/build.rs | 7 ------- crates/matrix-sdk/build.rs | 3 --- 8 files changed, 3 insertions(+), 41 deletions(-) delete mode 100644 crates/matrix-sdk-base/build.rs delete mode 100644 crates/matrix-sdk-crypto/build.rs delete mode 100644 crates/matrix-sdk-indexeddb/build.rs delete mode 100644 crates/matrix-sdk-sqlite/build.rs delete mode 100644 crates/matrix-sdk-ui/build.rs diff --git a/Cargo.toml b/Cargo.toml index d91d9f5e7..47ff4d2df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -113,6 +113,9 @@ opt-level = 3 async-compat = { git = "https://github.com/jplatte/async-compat", rev = "16dc8597ec09a6102d58d4e7b67714a35dd0ecb8" } const_panic = { git = "https://github.com/jplatte/const_panic", rev = "9024a4cb3eac45c1d2d980f17aaee287b17be498" } +[workspace.lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] } + [workspace.lints.clippy] assigning_clones = "allow" box_default = "allow" diff --git a/crates/matrix-sdk-base/build.rs b/crates/matrix-sdk-base/build.rs deleted file mode 100644 index 4b2bc6186..000000000 --- a/crates/matrix-sdk-base/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - // Prevent unnecessary rerunning of this build script - println!("cargo:rerun-if-changed=build.rs"); - - // Prevent nightly CI from erroring on tarpaulin_include attribute - println!("cargo:rustc-check-cfg=cfg(tarpaulin_include)"); -} diff --git a/crates/matrix-sdk-common/build.rs b/crates/matrix-sdk-common/build.rs index f8e085a58..45bd96ced 100644 --- a/crates/matrix-sdk-common/build.rs +++ b/crates/matrix-sdk-common/build.rs @@ -4,9 +4,6 @@ fn main() { // Prevent unnecessary rerunning of this build script println!("cargo:rerun-if-changed=build.rs"); - // Prevent nightly CI from erroring on tarpaulin_include attribute - println!("cargo:rustc-check-cfg=cfg(tarpaulin_include)"); - let is_wasm = env::var_os("CARGO_CFG_TARGET_ARCH").is_some_and(|arch| arch == "wasm32"); if is_wasm && env::var_os("CARGO_FEATURE_JS").is_none() { eprintln!( diff --git a/crates/matrix-sdk-crypto/build.rs b/crates/matrix-sdk-crypto/build.rs deleted file mode 100644 index 4b2bc6186..000000000 --- a/crates/matrix-sdk-crypto/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - // Prevent unnecessary rerunning of this build script - println!("cargo:rerun-if-changed=build.rs"); - - // Prevent nightly CI from erroring on tarpaulin_include attribute - println!("cargo:rustc-check-cfg=cfg(tarpaulin_include)"); -} diff --git a/crates/matrix-sdk-indexeddb/build.rs b/crates/matrix-sdk-indexeddb/build.rs deleted file mode 100644 index 4b2bc6186..000000000 --- a/crates/matrix-sdk-indexeddb/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - // Prevent unnecessary rerunning of this build script - println!("cargo:rerun-if-changed=build.rs"); - - // Prevent nightly CI from erroring on tarpaulin_include attribute - println!("cargo:rustc-check-cfg=cfg(tarpaulin_include)"); -} diff --git a/crates/matrix-sdk-sqlite/build.rs b/crates/matrix-sdk-sqlite/build.rs deleted file mode 100644 index 4b2bc6186..000000000 --- a/crates/matrix-sdk-sqlite/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - // Prevent unnecessary rerunning of this build script - println!("cargo:rerun-if-changed=build.rs"); - - // Prevent nightly CI from erroring on tarpaulin_include attribute - println!("cargo:rustc-check-cfg=cfg(tarpaulin_include)"); -} diff --git a/crates/matrix-sdk-ui/build.rs b/crates/matrix-sdk-ui/build.rs deleted file mode 100644 index 4b2bc6186..000000000 --- a/crates/matrix-sdk-ui/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - // Prevent unnecessary rerunning of this build script - println!("cargo:rerun-if-changed=build.rs"); - - // Prevent nightly CI from erroring on tarpaulin_include attribute - println!("cargo:rustc-check-cfg=cfg(tarpaulin_include)"); -} diff --git a/crates/matrix-sdk/build.rs b/crates/matrix-sdk/build.rs index 0aa3b95e4..1a25f041e 100644 --- a/crates/matrix-sdk/build.rs +++ b/crates/matrix-sdk/build.rs @@ -22,9 +22,6 @@ fn main() { // Prevent unnecessary rerunning of this build script println!("cargo:rerun-if-changed=build.rs"); - // Prevent nightly CI from erroring on tarpaulin_include attribute - println!("cargo:rustc-check-cfg=cfg(tarpaulin_include)"); - let native_tls_set = env_is_set("CARGO_FEATURE_NATIVE_TLS"); let rustls_tls_set = env_is_set("CARGO_FEATURE_RUSTLS_TLS"); ensure( From b73dbb4a559ff8961d8e51b7c67c892be6621f5f Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 4 Jun 2024 23:44:08 +0200 Subject: [PATCH 2/2] Bump nightly version --- .github/workflows/benchmarks.yml | 2 +- .github/workflows/ci.yml | 4 ++-- .github/workflows/documentation.yml | 2 +- xtask/src/main.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 98799b098..1dc82cff3 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -17,7 +17,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2024-05-09 + toolchain: nightly-2024-05-19 components: rustfmt - name: Run Benchmarks diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0771bcd2..ad908a7d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -279,7 +279,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2024-05-09 + toolchain: nightly-2024-05-19 components: rustfmt - name: Cargo fmt @@ -316,7 +316,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2024-05-09 + toolchain: nightly-2024-05-19 components: clippy - name: Load cache diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9af082c08..a3ad065ae 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -37,7 +37,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2024-05-09 + toolchain: nightly-2024-05-19 - name: Install Node.js uses: actions/setup-node@v4 diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 0144a9404..8b004f109 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -11,7 +11,7 @@ use kotlin::KotlinArgs; use swift::SwiftArgs; use xshell::cmd; -const NIGHTLY: &str = "nightly-2024-05-09"; +const NIGHTLY: &str = "nightly-2024-05-19"; type Result> = std::result::Result;