From a0a1d1d29263abb7c47fc2e58cef8dab13762a45 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sun, 31 Oct 2021 15:33:40 -0400 Subject: [PATCH 1/2] Link to libatomic for static 3.0.0 builds --- openssl-sys/build/main.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/openssl-sys/build/main.rs b/openssl-sys/build/main.rs index 3cb1892471..88d8ff670f 100644 --- a/openssl-sys/build/main.rs +++ b/openssl-sys/build/main.rs @@ -19,7 +19,9 @@ mod find_normal; #[cfg(feature = "vendored")] mod find_vendored; +#[derive(PartialEq)] enum Version { + Openssl3xx, Openssl11x, Openssl10x, Libressl, @@ -94,7 +96,9 @@ fn main() { } None => match version { Version::Openssl10x if target.contains("windows") => vec!["ssleay32", "libeay32"], - Version::Openssl11x if target.contains("windows-msvc") => vec!["libssl", "libcrypto"], + Version::Openssl3xx | Version::Openssl11x if target.contains("windows-msvc") => { + vec!["libssl", "libcrypto"] + } _ => vec!["ssl", "crypto"], }, }; @@ -104,6 +108,15 @@ fn main() { println!("cargo:rustc-link-lib={}={}", kind, lib); } + // https://github.com/openssl/openssl/pull/15086 + if version == Version::Openssl3xx + && kind == "static" + && env::var("CARGO_CFG_TARGET_OS").unwrap() == "linux" + && env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap() == "32" + { + println!("cargo:rustc-link-lib=dylib=atomic"); + } + if kind == "static" && target.contains("windows") { println!("cargo:rustc-link-lib=dylib=gdi32"); println!("cargo:rustc-link-lib=dylib=user32"); @@ -253,7 +266,7 @@ See rust-openssl README for more information: if openssl_version >= 0x4_00_00_00_0 { version_error() } else if openssl_version >= 0x3_00_00_00_0 { - Version::Openssl11x + Version::Openssl3xx } else if openssl_version >= 0x1_01_01_00_0 { println!("cargo:version=111"); Version::Openssl11x From 778868a17f6542b5aa97447f140af10f5aa89cbd Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sun, 31 Oct 2021 15:42:08 -0400 Subject: [PATCH 2/2] Disable target cache for homebrew build It's not working for some reason :/ --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 483c1bee57..41130f1edd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,10 +128,10 @@ jobs: path: ~/.cargo/registry/cache key: registry-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} - run: cargo fetch - - uses: actions/cache@v1 - with: - path: target - key: target-${{ github.job }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} + # - uses: actions/cache@v1 + # with: + # path: target + # key: target-${{ github.job }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }} - run: cargo run -p systest - run: cargo test -p openssl - run: cargo test -p openssl-errors