Skip to content

Commit

Permalink
rename cargo features
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed Oct 15, 2024
1 parent f6a4b78 commit 3bbe95d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ jobs:
- "async-secret-service,async-io,crypto-rust"
- "async-secret-service,tokio,crypto-openssl"
- "async-secret-service,async-io,crypto-openssl"
- "sync-persistent-keyutils,crypto-rust"
- "sync-persistent-keyutils,crypto-openssl"
- "async-persistent-keyutils,tokio,crypto-rust"
- "async-persistent-keyutils,async-io,crypto-rust"
- "async-persistent-keyutils,tokio,crypto-openssl"
- "async-persistent-keyutils,async-io,crypto-openssl"
- "linux-native-sync-persistent,crypto-rust"
- "linux-native-sync-persistent,crypto-openssl"
- "linux-native-async-persistent,tokio,crypto-rust"
- "linux-native-async-persistent,async-io,crypto-rust"
- "linux-native-async-persistent,tokio,crypto-openssl"
- "linux-native-async-persistent,async-io,crypto-openssl"

steps:
- name: Install CI dependencies
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ linux-native = ["dep:linux-keyutils"]
apple-native = ["dep:security-framework"]
windows-native = ["dep:windows-sys", "dep:byteorder"]

sync-persistent-keyutils = ["dep:linux-keyutils", "sync-secret-service"]
async-persistent-keyutils = ["dep:linux-keyutils", "async-secret-service"]
linux-native-sync-persistent = ["linux-native", "sync-secret-service"]
linux-native-async-persistent = ["linux-native", "async-secret-service"]
sync-secret-service = ["dep:dbus-secret-service"]
async-secret-service = ["dep:secret-service", "dep:zbus"]
crypto-rust = ["dbus-secret-service?/crypto-rust", "secret-service?/crypto-rust"]
Expand Down
25 changes: 9 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,23 +187,16 @@ pub mod mock;
#[cfg(any(
all(feature = "sync-secret-service", feature = "async-secret-service"),
all(
feature = "sync-persistent-keyutils",
feature = "async-persistent-keyutils",
feature = "linux-native-sync-persistent",
feature = "linux-native-async-persistent",
)
))]
compile_error!("This crate cannot use both the sync and async versions of any credential store");

//
// pick the *nix keystore
//
#[cfg(all(
target_os = "linux",
any(
feature = "linux-native",
feature = "sync-persistent-keyutils",
feature = "async-persistent-keyutils",
)
))]
#[cfg(all(target_os = "linux", feature = "linux-native"))]
pub mod keyutils;
#[cfg(all(
target_os = "linux",
Expand All @@ -222,25 +215,25 @@ pub mod secret_service;
any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"),
any(feature = "sync-secret-service", feature = "async-secret-service"),
not(any(
feature = "sync-persistent-keyutils",
feature = "async-persistent-keyutils",
feature = "linux-native-sync-persistent",
feature = "linux-native-async-persistent",
)),
))]
pub use secret_service as default;

#[cfg(all(
target_os = "linux",
any(
feature = "sync-persistent-keyutils",
feature = "async-persistent-keyutils",
feature = "linux-native-sync-persistent",
feature = "linux-native-async-persistent",
)
))]
pub mod keyutils_persistent;
#[cfg(all(
target_os = "linux",
any(
feature = "sync-persistent-keyutils",
feature = "async-persistent-keyutils",
feature = "linux-native-sync-persistent",
feature = "linux-native-async-persistent",
),
))]
pub use keyutils_persistent as default;
Expand Down

0 comments on commit 3bbe95d

Please sign in to comment.