From 2a8d58084f9cd1ec1d3e117cae868cee5e6520ea Mon Sep 17 00:00:00 2001 From: est31 Date: Thu, 13 Apr 2023 18:05:21 +0200 Subject: [PATCH 1/3] Update botan-src and set env var to copy and not hardlink This hopefully fixes the windows CI failure --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 140a2397..48d7dc46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,11 @@ jobs: build-windows: runs-on: windows-latest + env: + # botan doesn't build on windows if the source is + # on a different drive than the artifacts + # https://github.com/randombit/botan-rs/issues/82 + BOTAN_CONFIGURE_LINK_METHOD: copy steps: - uses: actions/checkout@v4 with: From 12397c2b4ae54f377915553452ac76754f092cf3 Mon Sep 17 00:00:00 2001 From: est31 Date: Thu, 15 Jun 2023 07:19:00 +0200 Subject: [PATCH 2/3] Enable botan tests on windows again Revert of d3ab04a84b78bed81c67d21873581302c787fc25 --- Cargo.toml | 5 +---- tests/botan.rs | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 52b80769..ed628ecc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,13 +36,10 @@ features = ["x509-parser"] openssl = "0.10" x509-parser = { version = "0.15", features = ["verify"] } rustls-webpki = { version = "0.101.0", features = ["std"] } +botan = { version = "0.10", features = ["vendored"] } rand = "0.8" rsa = "0.9" -[target.'cfg(not(windows))'.dev-dependencies] -botan = { version = "0.10", features = ["vendored"] } - - # This greatly speeds up rsa key generation times # (only applies to the dev-dependency because cargo # ignores profile overrides for non leaf packages) diff --git a/tests/botan.rs b/tests/botan.rs index 1ea09e14..99d2a8ed 100644 --- a/tests/botan.rs +++ b/tests/botan.rs @@ -1,4 +1,4 @@ -#![cfg(all(feature = "x509-parser", not(windows)))] +#![cfg(feature = "x509-parser")] use rcgen::DnValue; use rcgen::{BasicConstraints, Certificate, CertificateParams, DnType, IsCa}; From 9a5424057f6ee01d3810781cd2321c713714e322 Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Sat, 9 Sep 2023 12:16:56 -0400 Subject: [PATCH 3/3] ci: add vs-shell setup task to configure Windows env The upstream `botan-rs` crate uses this same action in its Windows based CI, successfully building `botan-sys` on that platform. Without using this action, the build process fails with the error: ``` ERROR: Default compiler is msvc but could not find 'cl'; use --cc to set ``` It's possible that with effort another workaround could be used, but it seems prudent to match what the upstream repository does and its better to have a working setup we can iterate on than one that skips Botan coverage entirely. --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48d7dc46..2e9b3514 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,9 @@ jobs: - uses: actions/checkout@v4 with: persist-credentials: false + - uses: egor-tensin/vs-shell@v2 + with: + arch: amd64 - name: Install Rust uses: dtolnay/rust-toolchain@master with: