cargo-semver-checks
cargo-semver-checks copied to clipboard
Unable to enable dependency's features needed to build the crate
Steps to reproduce the bug with the above code
See the "Actual Behavior" section.
Actual Behaviour
$ git clone https://gitlab.com/sequoia-pgp/sequoia-cert-store.git
$ cd sequoia-cert-store
$ git checkout cee6bfd8
$ cargo set-version 0.5.1
Upgrading sequoia-cert-store from 0.5.0 to 0.5.1
$ cargo semver-checks
Parsing sequoia-cert-store v0.5.1 (current)
error: running cargo-doc on crate sequoia-cert-store failed with output:
-----
...
error: failed to run custom build command for `sequoia-openpgp v1.19.0`
Caused by:
process didn't exit successfully: `/tmp/sequoia-cert-store/target/semver-checks/local-sequoia_cert_store-0_5_1/target/semver-checks/target/debug/build/sequoia-openpgp-a7260106954c3cab/build-script-build` (exit status: 1)
--- stderr
No cryptographic backend selected.
Sequoia requires a cryptographic backend. This backend is selected at compile
time using feature flags.
See https://crates.io/crates/sequoia-openpgp#crypto-backends
warning: build failed, waiting for other jobs to finish...
-----
error: failed to build rustdoc for crate sequoia-cert-store v0.5.1
note: this is usually due to a compilation error in the crate,
and is unlikely to be a bug in cargo-semver-checks
note: the following command can be used to reproduce the compilation error:
cargo new --lib example &&
cd example &&
echo '[workspace]' >> Cargo.toml &&
cargo add --path /tmp/sequoia-cert-store --no-default-features --features &&
cargo check
error: aborting due to failure to build rustdoc for crate sequoia-cert-store v0.5.1
The error is because we didn't select a cryptographic backend.
Trying again:
$ cargo semver-checks --features sequoia-openpgp/crypto-nettle
Parsing sequoia-cert-store v0.5.1 (current)
error: `cargo metadata` exited with an error: error: failed to parse manifest at `/tmp/sequoia-cert-store/target/semver-checks/local-sequoia_cert_store-0_5_1-aaa4629efb3c60e8/Cargo.toml`
Caused by:
feature `sequoia-openpgp/crypto-nettle` in dependency `sequoia-cert-store` is not allowed to contain slashes
If you want to enable features of a transitive dependency, the direct dependency needs to re-export those features from the `[features]` table.
Tools like cargo build
don't impose this restriction. Although I could manually edit our Cargo.toml
to select a backend:
$ git diff Cargo.toml
diff --git a/Cargo.toml b/Cargo.toml
index 90ea46f..2b05ba1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "sequoia-cert-store"
description = "A certificate database interface."
-version = "0.5.0"
+version = "0.5.1"
authors = ["Neal H. Walfield <[email protected]>",
"Justus Winter <[email protected]>"]
homepage = "https://sequoia-pgp.org/"
@@ -26,7 +26,7 @@ num_cpus = "1"
openpgp-cert-d = "0.3.1"
parking_lot = "0.12"
rayon = "1"
-sequoia-openpgp = { version = "1.19.0", default-features = false }
+sequoia-openpgp = { version = "1.19.0", features = ["crypto-nettle"] }
sequoia-net = { version = "0.28", default-features = false }
smallvec = "1.1"
thiserror = "1.0.2"
Now, cargo semver-checks
can build the current version, but it fails on the last version:
$ cargo semver-checks
Parsing sequoia-cert-store v0.5.1 (current)
Parsed [ 9.515s] (current)
Parsing sequoia-cert-store v0.5.0 (baseline)
error: running cargo-doc on crate sequoia-cert-store failed with output:
-----
...
error: failed to run custom build command for `sequoia-openpgp v1.19.0`
Caused by:
process didn't exit successfully: `/tmp/sequoia-cert-store/target/semver-checks/registry-sequoia_cert_store-0_5_0/target/semver-checks/target/debug/build/sequoia-openpgp-a7260106954c3cab/build-script-build` (exit status: 1)
--- stderr
No cryptographic backend selected.
Sequoia requires a cryptographic backend. This backend is selected at compile
time using feature flags.
See https://crates.io/crates/sequoia-openpgp#crypto-backends
warning: build failed, waiting for other jobs to finish...
-----
error: failed to build rustdoc for crate sequoia-cert-store v0.5.0
note: this is usually due to a compilation error in the crate,
and is unlikely to be a bug in cargo-semver-checks
note: the following command can be used to reproduce the compilation error:
cargo new --lib example &&
cd example &&
echo '[workspace]' >> Cargo.toml &&
cargo add sequoia-cert-store@=0.5.0 --no-default-features --features &&
cargo check
Expected Behaviour
I think cargo semver-checks
should allow selecting the same features as cargo build
.
Generated System Information
$ cargo semver-checks --bugreport
#### Software version
cargo-semver-checks 0.30.0
#### Operating system
Linux 6.1.0-17-amd64
#### Command-line
```bash
/home/us/.cargo/bin/cargo-semver-checks semver-checks --bugreport
cargo version
> cargo -V
cargo 1.75.0 (1d8b05cdd 2023-11-20)
Compile time information
- Profile: release
- Target triple: x86_64-unknown-linux-gnu
- Family: unix
- OS: linux
- Architecture: x86_64
- Pointer width: 64
- Endian: little
- CPU features: fxsr,sse,sse2
- Host: x86_64-unknown-linux-gnu
### Build Configuration
_No response_
### Additional Context
Thanks for working on this!