Skip to content

Commit

Permalink
cryptography: add std feature
Browse files Browse the repository at this point in the history
Adds an off-by-default `std` feature which activates the `std` features
of all of the other dependencies.

This is a somewhat lousy way of doing this, and I wish that there were a
better approach, so much that I posted a Pre-Pre-RFC about it:

https://internals.rust-lang.org/t/pre-pre-rfc-weak-cargo-feature-activation/13141

For now though, this is immediately useful to me.
  • Loading branch information
tarcieri committed Sep 28, 2020
1 parent 3182f68 commit d162162
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/cryptography.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ jobs:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- run: cargo build --release --target ${{ matrix.target }}
- run: cargo build --all-features --release --target ${{ matrix.target }}
- run: cargo build --no-default-features --release --target ${{ matrix.target }}
- run: cargo build --no-default-features --release --target ${{ matrix.target }}
--features aead,block-cipher,mac,digest,elliptic-curve,signature,stream-cipher,universal-hash
test:
runs-on: ubuntu-latest
strategy:
Expand Down
12 changes: 12 additions & 0 deletions cryptography/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,17 @@ signature = { version = "1.2.0", optional = true, default-features = false, path
stream-cipher = { version = "0.7", optional = true, path = "../stream-cipher" }
universal-hash = { version = "0.4", optional = true, path = "../universal-hash" }

[features]
std = [
"aead/std",
"block-cipher/std",
"digest/std",
"elliptic-curve/std",
"mac/std",
"signature/std",
"stream-cipher/std",
"universal-hash/std"
]

[package.metadata.docs.rs]
all-features = true

0 comments on commit d162162

Please sign in to comment.