Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic in cargo doc with -Zfeatures=itarget #8774

Closed
ehuss opened this issue Oct 13, 2020 · 0 comments · Fixed by #8777
Closed

Panic in cargo doc with -Zfeatures=itarget #8774

ehuss opened this issue Oct 13, 2020 · 0 comments · Fixed by #8777
Labels
A-features2 Area: issues specifically related to the v2 feature resolver

Comments

@ehuss
Copy link
Contributor

ehuss commented Oct 13, 2020

Not sure if this was mentioned and/or expected but it seems that doc command is not adapted yet. For the manifest:

[package]
name = "sequoia-openpgp-default"
version = "0.1.0"
authors = ["Sequoia Developers <dev@sequoia-pgp.org>"]
edition = "2018"

[target.'cfg(not(windows))'.dependencies.sequoia-openpgp]
git = "https://gitlab.com/sequoia-pgp/sequoia"
default-features = false
features = ["crypto-nettle"]

[target.'cfg(windows)'.dependencies.sequoia-openpgp]
git = "https://gitlab.com/sequoia-pgp/sequoia"
default-features = false
features = ["crypto-cng"]

I got

PS C:\Users\Xanewok\repos\sequoia\openpgp-default> rustc +nightly --version --verbose
rustc 1.49.0-nightly (8dae8cdcc 2020-10-12)
binary: rustc
commit-hash: 8dae8cdcc8fa879cea6a4bbbfa5b32e97be4c306
commit-date: 2020-10-12
host: x86_64-pc-windows-gnu
release: 1.49.0-nightly
LLVM version: 11.0
PS C:\Users\Xanewok\repos\sequoia\openpgp-default> cargo +nightly --version
cargo 1.48.0-nightly (9d1a4863a 2020-10-05)
PS C:\Users\Xanewok\repos\sequoia\openpgp-default> cargo +nightly check --no-default-features -Zfeatures=itarget
    Finished dev [unoptimized + debuginfo] target(s) in 0.17s
PS C:\Users\Xanewok\repos\sequoia\openpgp-default> cargo +nightly doc --no-default-features -Zfeatures=itarget  
thread 'main' panicked at 'activated_features for invalid package: features did not find PackageId { name: "nettle", version: "7.0.0", source: "registry `https://github.com/rust-lang/crates.io-index`" } false', src\tools\cargo\src/cargo\core\resolver\features.rs:227:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

which at a first glance seems that activated_features contains an entry for the nettle package, which should only be activated under cfg(not(windows)) and is correctly skipped for the check build.

Originally posted by @Xanewok in https://github.com/rust-lang/cargo/issue_comments/707717140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-features2 Area: issues specifically related to the v2 feature resolver
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant