You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cargo build produces a bizarre error message in a workspace with many generated internal dependencies, with features that activate features on their internal dependencies.
I've actually had this issue for a long time (a year?), but my prior attempts to minimize the code ended up causing the bug to disappear! Today I finally succeeded by making a very conservative minimization.
The minimize branch will already be checked out. Run cargo build:
error: failed to select a version for `rsp2-array-types`.
... required by package `rsp2 v0.1.0 (/home/lampam/cpp/throwaway/cargo-strange-error)`
versions that meet the requirements `= 0.1.0` are: 0.1.0
the package `rsp2` depends on `rsp2-array-types`, with features: `rsp2-assert-close` but `rsp2-array-types` does not have these features.
Observe that rsp2-assert-close never appears as a feature name in any Cargo.toml file. The error message is clearly nonsense!
rg '["/]rsp2-assert-close"'
Bonus round!
Here is an additional thing you can do that may help debug the issue:
Additional repro case
Now try checking out the master branch. This is the code prior to minimization. Observe the following:
On this branch, cargo build successfully begins building. (Just ctrl-c it; it will take a long time)
...but now cargo build --features=nightly produces the exact same error message as above!
The only differences between minimize and master that I would imagine should affect cargo are the removal of build scripts, binaries, integration tests, and the changes listed here (which are mostly just removing external dependencies):
These lines are programmatically generated. beta activates the /beta feature of every path dependency. nightly activates beta and the /nightly feature of every path dependency.
Yep. I tried moving all of my internal dev-dependencies to regular dependencies and the error vanishes.
(well, a different error appears, but one that is correct; "rsp2-structure" mistakenly activates "rsp2-array-types/serde" instead of "rsp2-array-types/serde-support")
Problem
cargo build
produces a bizarre error message in a workspace with many generated internal dependencies, with features that activate features on their internal dependencies.I've actually had this issue for a long time (a year?), but my prior attempts to minimize the code ended up causing the bug to disappear! Today I finally succeeded by making a very conservative minimization.
Steps
minimize
branch will already be checked out. Runcargo build
:rsp2-assert-close
never appears as a feature name in any Cargo.toml file. The error message is clearly nonsense!Bonus round!
Here is an additional thing you can do that may help debug the issue:
Additional repro case
Now try checking out the
master
branch. This is the code prior to minimization. Observe the following:cargo build
successfully begins building. (Just ctrl-c it; it will take a long time)cargo build --features=nightly
produces the exact same error message as above!The only differences between
minimize
andmaster
that I would imagine should affect cargo are the removal of build scripts, binaries, integration tests, and the changes listed here (which are mostly just removing external dependencies):Notes
The Cargo.toml files in this workspace contain some intimidating-looking
[features]
that look like this:These lines are programmatically generated.
beta
activates the/beta
feature of every path dependency.nightly
activatesbeta
and the/nightly
feature of every path dependency.Cargo version
Tested on:
The text was updated successfully, but these errors were encountered: