Skip to content

Commit 9fd2510

Browse files
committed
Auto merge of #12027 - weihanglo:platform-specific-deps, r=epage
chore: make credential dependencies platform-specific ### What does this PR try to resolve? Starting from #11993, we made `cargo-credential-macos-keychain` and `cargo-credential-wincred` able to build on all platforms. However, some of their dependencies are not. This PR turns them into platform specific dependencies to circumvent the situation. ### How should we test and review this PR? Run the following commands on all platforms Cargo supports. ``` cargo check --workspace --exclude cargo-credential-gnome-secret ```
2 parents 3862b01 + ad6c414 commit 9fd2510

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

.github/workflows/main.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,10 @@ jobs:
127127
- run: cargo test -p home
128128
- run: cargo test -p mdman
129129
- run: cargo build -p cargo-credential-1password
130-
- run: cargo build -p cargo-credential-gnome-secret
131-
if: matrix.os == 'ubuntu-latest'
132130
- run: cargo build -p cargo-credential-macos-keychain
133-
if: matrix.os == 'macos-latest'
134131
- run: cargo build -p cargo-credential-wincred
135-
if: matrix.os == 'windows-latest'
132+
- run: cargo build -p cargo-credential-gnome-secret
133+
if: matrix.os == 'ubuntu-latest'
136134
- name: Check benchmarks
137135
run: |
138136
# This only tests one benchmark since it can take over 10 minutes to

credential/cargo-credential-macos-keychain/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ description = "A Cargo credential process that stores tokens in a macOS keychain
88

99
[dependencies]
1010
cargo-credential = { version = "0.2.0", path = "../cargo-credential" }
11+
12+
[target.'cfg(target_os = "macos")'.dependencies]
1113
security-framework = "2.0.0"

credential/cargo-credential-wincred/Cargo.toml

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ description = "A Cargo credential process that stores tokens with Windows Creden
88

99
[dependencies]
1010
cargo-credential = { version = "0.2.0", path = "../cargo-credential" }
11-
windows-sys = { version = "0.48", features = ["Win32_Foundation", "Win32_Security_Credentials"] }
11+
12+
[target.'cfg(windows)'.dependencies.windows-sys]
13+
version = "0.48"
14+
features = [
15+
"Win32_Foundation",
16+
"Win32_Security_Credentials"
17+
]

0 commit comments

Comments
 (0)