Nightly features in a parent Cargo.toml causes build in unrelated sub-crate to fail when building with beta or stable cargo #6646
Labels
A-manifest
Area: Cargo.toml issues
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Problem
If one crate that uses nightly-only cargo features has a subdirectory containing another crate, then that crate also requires a nightly cargo version to build in order to not fail when looking for workspaces.
If running cargo build in the subfolder with a stable or beta version of cargo, the following error is produced:
Running with
RUST_LOG=trace
also produces this:Which seems to indicate that the workspace finder tries to parse the toml, but fails because of the unknown feature thing.
Removing the cargo feature and building again fixes the issue.
Steps
cargo init root_crate
cd root_crate && cargo init sub_crate
cargo-features = ["profile-overrides"]
to theCargo.toml
inroot_crate
cargo +stable build
Possible Solution(s)
This seems like a pretty difficult problem to solve assuming
cargo_features
presumably can change the behaviour of cargo. However, it would be nice if it could try to detect wether a Cargo.toml containing unstable features is a workspace or notNotes
This happens with both
cargo 1.33.0-beta (9b5d4b755 2019-01-15)
andcargo 1.31.0 (339d9f9c8 2018-11-16)
The text was updated successfully, but these errors were encountered: