Build the CLI on Linux & Windows: per-OS keyring backend

The keyring dep was hard-pinned to the macOS `apple-native` feature, so
the headless CLI/core didn't compile anywhere else — blocking an AUR
package or any Linux/Windows use. Split it into per-target features:
apple-native (macOS), windows-native (Windows), and
sync-secret-service + crypto-rust (Linux, via gnome-keyring/KWallet,
pure-Rust crypto so no OpenSSL build dep).
This commit is contained in:
Anthony
2026-05-29 15:43:16 +02:00
parent aa65f0a1d5
commit a12acd4068
2 changed files with 511 additions and 1 deletions
+13 -1
View File
@@ -23,7 +23,6 @@ rcgen = "0.13"
crypto-primitives = { path = "../../tuta-repo/tuta-sdk/rust/crypto-primitives" }
keyring = { version = "3", features = ["apple-native"] }
rand = "0.8"
thiserror = "2.0"
@@ -34,6 +33,19 @@ rand_core = "0.6"
rusqlite = { version = "0.32", features = ["bundled-sqlcipher"] }
hex = "0.4"
# OS keychain backend — one per platform so the CLI builds (and packages,
# e.g. on the AUR) on Linux/Windows, not just macOS. Linux uses the
# Secret Service (gnome-keyring / KWallet) with pure-Rust crypto so there's
# no OpenSSL build dependency.
[target.'cfg(target_os = "macos")'.dependencies]
keyring = { version = "3", features = ["apple-native"] }
[target.'cfg(target_os = "windows")'.dependencies]
keyring = { version = "3", features = ["windows-native"] }
[target.'cfg(target_os = "linux")'.dependencies]
keyring = { version = "3", features = ["sync-secret-service", "crypto-rust"] }
[dev-dependencies]
tuta-sdk = { path = "../../tuta-repo/tuta-sdk/rust/sdk", features = ["net", "logging", "testing"] }
rpassword = "7"