From 1403f42f36ed1b82cd25fc328a93463248cd5b2e Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Tue, 3 May 2022 22:37:21 +0200 Subject: [PATCH] Create macOS release builds with bundled root certificates As reported in https://github.com/dbrgn/tealdeer/issues/244, some users on macOS had problems with `rustls-tls-native-roots`. Since we did not find the root cause of this, we'll build macOS release builds with `rustls-tls-webpki-roots` instead. I first tried to solve this issue with default features and conditional dependencies in `Cargo.toml`, but ultimately gave up and resorted to `sed`. --- .github/workflows/ci.yml | 9 +++++++++ .github/workflows/release.yml | 2 ++ Cargo.toml | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8fd0512ee..42f1a8d9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,15 @@ jobs: with: command: test args: --all-features + # macOS-only steps + - name: Patch to use webpki roots (macOS only) + if: matrix.platform == 'macos-latest' + run: sed -i '' 's/rustls-tls-native-roots/rustls-tls-webpki-roots/' Cargo.toml + - name: Build with webpki roots (macOS only) + if: matrix.platform == 'macos-latest' + uses: actions-rs/cargo@v1 + with: + command: build clippy: name: run clippy lints diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb0c0cf62..664dbaa2b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,6 +79,8 @@ jobs: runs-on: macos-11 steps: - uses: actions/checkout@v2 + - name: Patch to use webpki roots + run: sed -i '' 's/rustls-tls-native-roots/rustls-tls-webpki-roots/' Cargo.toml - name: Build uses: actions-rs/cargo@v1 with: diff --git a/Cargo.toml b/Cargo.toml index 6715a8e76..881d05baa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ atty = "0.2" clap = { version = "3", features = ["std", "derive", "suggestions", "color"], default-features = false } env_logger = { version = "0.9", optional = true } log = "0.4" -reqwest = { version = "0.11.3", features = ["blocking", "rustls-tls", "rustls-tls-native-roots"], default-features = false } +reqwest = { version = "0.11.3", features = ["blocking", "rustls-tls-native-roots"], default-features = false } serde = "1.0.21" serde_derive = "1.0.21" toml = "0.5.1"