From 70a6f011a471b4a46df497cf08f24b268f4074bc Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 6 Dec 2024 09:33:10 -0600 Subject: [PATCH 1/2] chore(build-rs): Bump major version --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/build-rs/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57cc51f2ae1..bdba69d5f51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -254,7 +254,7 @@ dependencies = [ [[package]] name = "build-rs" -version = "0.2.0" +version = "0.3.0" dependencies = [ "unicode-ident", ] diff --git a/Cargo.toml b/Cargo.toml index 915fb30cef0..8e676d2984d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ anstyle = "1.0.8" anyhow = "1.0.86" base64 = "0.22.1" blake3 = "1.5.2" -build-rs = { version = "0.2.0", path = "crates/build-rs" } +build-rs = { version = "0.3.0", path = "crates/build-rs" } bytesize = "1.3" cargo = { path = "" } cargo-credential = { version = "0.4.2", path = "credential/cargo-credential" } diff --git a/crates/build-rs/Cargo.toml b/crates/build-rs/Cargo.toml index e2e8eb9fccf..24e42b09863 100644 --- a/crates/build-rs/Cargo.toml +++ b/crates/build-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "build-rs" -version = "0.2.0" +version = "0.3.0" rust-version.workspace = true edition.workspace = true license.workspace = true From 71f68dc3c30750284865a34789266f07c0403683 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 6 Dec 2024 09:27:38 -0600 Subject: [PATCH 2/2] fix(build-rs)!: Remove meaningless 'cargo_cfg_debug_assertions' The documentation that was added was pulled straight from a comment in `custom_build.rs`. --- crates/build-rs-test-lib/build.rs | 1 - crates/build-rs/src/input.rs | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/build-rs-test-lib/build.rs b/crates/build-rs-test-lib/build.rs index 1167a34907e..eff04806a73 100644 --- a/crates/build-rs-test-lib/build.rs +++ b/crates/build-rs-test-lib/build.rs @@ -10,7 +10,6 @@ fn smoke_test_inputs() { use build_rs::input::*; dbg!(cargo()); dbg!(cargo_cfg("careful")); - dbg!(cargo_cfg_debug_assertions()); #[cfg(feature = "unstable")] dbg!(cargo_cfg_fmt_debug()); #[cfg(feature = "unstable")] diff --git a/crates/build-rs/src/input.rs b/crates/build-rs/src/input.rs index 6f564f8c68b..112aa5fed4e 100644 --- a/crates/build-rs/src/input.rs +++ b/crates/build-rs/src/input.rs @@ -109,6 +109,11 @@ mod cfg { } /// If we are compiling with debug assertions enabled. + /// + /// Build scripts are not passed this cfg because + /// this cfg is always true and misleading. + /// That is because Cargo queries rustc without any profile settings. + #[cfg(any())] #[track_caller] pub fn cargo_cfg_debug_assertions() -> bool { is_present("CARGO_CFG_DEBUG_ASSERTIONS")