diff options
author | Igor Matuszewski <igor@sequoia-pgp.org> | 2020-10-12 00:56:24 +0200 |
---|---|---|
committer | Igor Matuszewski <igor@sequoia-pgp.org> | 2020-10-12 18:37:38 +0200 |
commit | c2b32483d20be2ef12f35e0d37202b3d6847ab9f (patch) | |
tree | a931661b14ac27870871b68e15b6c7e7ff756366 /ipc | |
parent | 394976c8a8066898604c3f5f285e5aeef3b8b743 (diff) |
Allow to opt out of default features for sequoia-* dependencies
Cargo features are inherently additive, which means that if:
- package A walts to build package C with features ABC,
- package B walts to build package C with features BCD,
the package C will be built with *both* ABC and BCD enabled.
There is currently no way to specify mutually exclusive features
and these have to be implemented using existing, additive, ones.
That's problematic for us, because currently the cryptographic
backend in sequoia-openpgp is selected globally at build-time and
thus at most one can be selected for the compilation to succeed.
It's worth noting that we can't use Cargo build scripts to emit
the `--cfg`-passing [directive] because it does *not* affect
Cargo's dependency resolution and that's needed in order to skip
unbuildable backends on certain OSes (e.g. nettle when using Windows MSVC ABI).
To allow for other local crates, most notably sequoia-openpgp-ffi, to
build with different backends, we expose and forward any features that
may be used by the crates they transitively depend on.
At the time of writing, these different features seem to be implemented:
- buffered-reader: compression support
- openpgp: compression support and cryptographic backend
- store: background-services feature
[directive](https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-cfgkeyvalue)
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/Cargo.toml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ipc/Cargo.toml b/ipc/Cargo.toml index 53e6de20..63901f32 100644 --- a/ipc/Cargo.toml +++ b/ipc/Cargo.toml @@ -20,7 +20,7 @@ gitlab = { repository = "sequoia-pgp/sequoia" } maintenance = { status = "actively-developed" } [dependencies] -sequoia-openpgp = { path = "../openpgp", version = "0.19" } +sequoia-openpgp = { path = "../openpgp", version = "0.19", default-features = false } sequoia-core = { path = "../core", version = "0.19" } anyhow = "1" @@ -51,3 +51,11 @@ lalrpop = "0.19" [dev-dependencies] clap = "2.32.0" quickcheck = { version = "0.9", default-features = false } + +[features] +default = ["sequoia-openpgp/default"] +crypto-nettle = ["sequoia-openpgp/crypto-nettle"] +crypto-cng = ["sequoia-openpgp/crypto-cng"] +compression = ["sequoia-openpgp/compression"] +compression-deflate = ["sequoia-openpgp/compression-deflate"] +compression-bzip2 = ["sequoia-openpgp/compression-bzip2"] |