Skip to content

Commit

Permalink
Auto merge of #12027 - weihanglo:platform-specific-deps, r=epage
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
bors committed Apr 24, 2023
2 parents 3862b01 + ad6c414 commit 9fd2510
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,10 @@ jobs:
- run: cargo test -p home
- run: cargo test -p mdman
- run: cargo build -p cargo-credential-1password
- run: cargo build -p cargo-credential-gnome-secret
if: matrix.os == 'ubuntu-latest'
- run: cargo build -p cargo-credential-macos-keychain
if: matrix.os == 'macos-latest'
- run: cargo build -p cargo-credential-wincred
if: matrix.os == 'windows-latest'
- run: cargo build -p cargo-credential-gnome-secret
if: matrix.os == 'ubuntu-latest'
- name: Check benchmarks
run: |
# This only tests one benchmark since it can take over 10 minutes to
Expand Down
2 changes: 2 additions & 0 deletions credential/cargo-credential-macos-keychain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ description = "A Cargo credential process that stores tokens in a macOS keychain

[dependencies]
cargo-credential = { version = "0.2.0", path = "../cargo-credential" }

[target.'cfg(target_os = "macos")'.dependencies]
security-framework = "2.0.0"
8 changes: 7 additions & 1 deletion credential/cargo-credential-wincred/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ description = "A Cargo credential process that stores tokens with Windows Creden

[dependencies]
cargo-credential = { version = "0.2.0", path = "../cargo-credential" }
windows-sys = { version = "0.48", features = ["Win32_Foundation", "Win32_Security_Credentials"] }

[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.48"
features = [
"Win32_Foundation",
"Win32_Security_Credentials"
]

0 comments on commit 9fd2510

Please sign in to comment.