Skip to content

Commit

Permalink
Fix build with Rust nightly (#10936)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed May 6, 2024
1 parent 96b80c0 commit 3931fe5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ use std::env;

#[allow(clippy::unusual_byte_groupings)]
fn main() {
println!("cargo:rustc-check-cfg=cfg(CRYPTOGRAPHY_OPENSSL_300_OR_GREATER)");
println!("cargo:rustc-check-cfg=cfg(CRYPTOGRAPHY_OPENSSL_320_OR_GREATER)");
println!("cargo:rustc-check-cfg=cfg(CRYPTOGRAPHY_IS_LIBRESSL)");
println!("cargo:rustc-check-cfg=cfg(CRYPTOGRAPHY_IS_BORINGSSL)");
println!("cargo:rustc-check-cfg=cfg(CRYPTOGRAPHY_OSSLCONF, values(\"OPENSSL_NO_IDEA\", \"OPENSSL_NO_CAST\", \"OPENSSL_NO_BF\", \"OPENSSL_NO_CAMELLIA\", \"OPENSSL_NO_SEED\", \"OPENSSL_NO_SM4\"))");

if let Ok(version) = env::var("DEP_OPENSSL_VERSION_NUMBER") {
let version = u64::from_str_radix(&version, 16).unwrap();

Expand Down
2 changes: 2 additions & 0 deletions src/rust/cryptography-cffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use std::path::Path;
use std::process::Command;

fn main() {
println!("cargo:rustc-check-cfg=cfg(python_implementation, values(\"CPython\", \"PyPy\"))");

let target = env::var("TARGET").unwrap();
let openssl_static = env::var("OPENSSL_STATIC")
.map(|x| x == "1")
Expand Down
3 changes: 3 additions & 0 deletions src/rust/cryptography-key-parsing/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use std::env;

fn main() {
println!("cargo:rustc-check-cfg=cfg(CRYPTOGRAPHY_IS_LIBRESSL)");
println!("cargo:rustc-check-cfg=cfg(CRYPTOGRAPHY_IS_BORINGSSL)");

if env::var("DEP_OPENSSL_LIBRESSL_VERSION_NUMBER").is_ok() {
println!("cargo:rustc-cfg=CRYPTOGRAPHY_IS_LIBRESSL");
}
Expand Down
5 changes: 5 additions & 0 deletions src/rust/cryptography-openssl/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ use std::env;

#[allow(clippy::unusual_byte_groupings)]
fn main() {
println!("cargo:rustc-check-cfg=cfg(CRYPTOGRAPHY_OPENSSL_300_OR_GREATER)");
println!("cargo:rustc-check-cfg=cfg(CRYPTOGRAPHY_OPENSSL_320_OR_GREATER)");
println!("cargo:rustc-check-cfg=cfg(CRYPTOGRAPHY_IS_LIBRESSL)");
println!("cargo:rustc-check-cfg=cfg(CRYPTOGRAPHY_IS_BORINGSSL)");

if let Ok(version) = env::var("DEP_OPENSSL_VERSION_NUMBER") {
let version = u64::from_str_radix(&version, 16).unwrap();

Expand Down

0 comments on commit 3931fe5

Please sign in to comment.