From 8cb8d4b7d57c93be85ca4b7e81e018e6284449b3 Mon Sep 17 00:00:00 2001 From: Kornel Date: Thu, 21 May 2026 17:44:05 +0100 Subject: [PATCH] Let crates detect boring-sys version --- Cargo.toml | 8 ++++---- README.md | 4 +++- RELEASE_NOTES | 4 ++++ boring-sys/build/config.rs | 6 ++++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2b8b6e088..426150ee9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ resolver = "2" [workspace.package] -version = "5.1.0" +version = "5.2.0" rust-version = "1.85" repository = "https://github.com/cloudflare/boring" edition = "2021" @@ -20,9 +20,9 @@ tag-prefix = "" publish = false [workspace.dependencies] -boring-sys = { version = "5.1.0", path = "./boring-sys", default-features = false } -boring = { version = "5.1.0", path = "./boring", default-features = false } -tokio-boring = { version = "5.1.0", path = "./tokio-boring", default-features = false } +boring-sys = { version = "5.2.0", path = "./boring-sys", default-features = false } +boring = { version = "5.2.0", path = "./boring", default-features = false } +tokio-boring = { version = "5.2.0", path = "./tokio-boring", default-features = false } bindgen = { version = "0.72.0", default-features = false, features = ["runtime"] } bitflags = "2.9" diff --git a/README.md b/README.md index 2abbe4f1a..49ea529f4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ and [Raw Public Key](https://docs.rs/boring/latest/boring/ssl/struct.SslRef.html # Upgrading from `boring` v4 - * First update to boring 4.21 and ensure it builds without any deprecation warnings. + * First update to boring 4.22 and ensure it builds without any deprecation warnings. * `pq-experimental` Cargo feature is no longer needed. Post-quantum crypto is enabled by default. * `fips-precompiled` Cargo feature has been merged into `fips`. Set `BORING_BSSL_FIPS_PATH` env var to use a precompiled library. * `fips-compat` Cargo feature has been renamed to `legacy-compat-deprecated` (4cb7e260a85b7) @@ -30,6 +30,8 @@ and [Raw Public Key](https://docs.rs/boring/latest/boring/ssl/struct.SslRef.html * `X509StoreBuilder::add_cert` takes a reference. * `hyper` 0.x support has been removed. Use `hyper` 1.x. +To support both v4 and v5, add `boring = ">=4.22,<6"` to `Cargo.toml`. If you need to auto-detect the version selected, add `boring-sys = ">=4.22,<6"` as a direct dependency, and in your `build.rs` check if `DEP_BORINGSSL_VERSION_MAJOR` env var is set to `5`. Versions older than 5.2.0 don't set it. + ## Contribution Unless you explicitly state otherwise, any contribution intentionally diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 34c5a05d9..91cff5eb2 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -1,3 +1,7 @@ +5.2.0 +- 2026-05-21 Export `DEP_BORINGSSL_VERSION_MAJOR` var +- 2026-04-27 Expose DTLS version constants in SslVersion + 5.1.0 - 2026-04-13 Add EVP_AEAD-based detached AEAD module - 2026-04-13 Add generic PKey private key generation API diff --git a/boring-sys/build/config.rs b/boring-sys/build/config.rs index 108a439d8..cc44a977d 100644 --- a/boring-sys/build/config.rs +++ b/boring-sys/build/config.rs @@ -71,6 +71,12 @@ impl Config { .as_ref() .is_some_and(|path| path.join("src").exists()); + // DEP_BORINGSSL_VERSION_MAJOR + println!( + "cargo:version_major={}", + env::var("CARGO_PKG_VERSION_MAJOR").unwrap_or_default() + ); + let config = Self { manifest_dir, out_dir,