Create macOS release builds with bundled root certificates (#272)

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.

Fixes #244.
This commit is contained in:
Danilo Bargen 2022-05-06 12:43:30 +02:00 committed by GitHub
commit 0f82aa5950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 6 deletions

View file

@ -27,16 +27,15 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: build
- name: Build with all features
- name: Build with logging and webpki roots
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
args: --features logging,webpki-roots --no-default-features
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
clippy:
name: run clippy lints
@ -51,7 +50,7 @@ jobs:
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
args: --features logging
fmt:
name: run rustfmt

View file

@ -83,7 +83,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target x86_64-apple-darwin
args: --release --target x86_64-apple-darwin --no-default-features --features webpki-roots
- uses: actions/upload-artifact@v2
with:
name: "tealdeer-macos-x86_64"

View file

@ -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"], default-features = false }
serde = "1.0.21"
serde_derive = "1.0.21"
toml = "0.5.1"
@ -44,6 +44,9 @@ tempfile = "3.1.0"
filetime = "0.2.10"
[features]
default = ["native-roots"]
native-roots = ["reqwest/rustls-tls-native-roots"]
webpki-roots = ["reqwest/rustls-tls-webpki-roots"]
logging = ["env_logger"]
[profile.release]

View file

@ -16,6 +16,14 @@
#![allow(clippy::struct_excessive_bools)]
#![allow(clippy::too_many_lines)]
#[cfg(any(
all(feature = "native-roots", feature = "webpki-roots"),
not(any(feature = "native-roots", feature = "webpki-roots")),
))]
compile_error!(
"exactly one of feature \"native-roots\" and feature \"webpki-roots\" must be enabled"
);
use std::{env, process};
use app_dirs::AppInfo;