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
I am not entirely sure this is a bug report or a feature request but I'll describe anyway what happened.
We have a fairly large workspace over at https://github.com/libp2p/rust-libp2p. Previously, the root Cargo.toml was both a crate and a workspace manifest. For various reasons, I wanted to move away from that.
That root crate is edition = 2021 which implies the new dependency resolver (version 2). Thus, we did not specify resolver = 2 explicitly as part of the [workspace] table. We need the new feature resolver because we have some target-specific features to activiate:
What happened now is that by splitting the root manifest into a separate crate, the edition = 2021 disappeared and cargo was now falling back using v1 of the resolver, resulting in a failing build because the features of the snow dependency within the Cargo.toml of libp2p-noise were incorrectly merged.
This was especially surprising because I was running cargo build --package libp2p which does have edition = 2021. I guess this could be considered a bug? I am not sure.
The problem was fixed by explicitly specifying resolver = 2 in the [workspace] table.
The text was updated successfully, but these errors were encountered:
thomaseizinger
changed the title
Moving repository to a virtual manifest can cause surprising dependency resolution errors
Moving repository to a virtual manifest can cause surprising dependency resolution errors due to resolver fallback
Mar 8, 2023
Thanks for the report. This is a known inconvenience we want to address, by either better documentation or hint or automation. See this comment for more #9996 (comment).
Also, see these related issues and pull requests below. Some of them has been stale for a while. I'll appreciate if anyone could continue driving them.
This was especially surprising because I was running cargo build --package libp2p which does have edition = 2021. I guess this could be considered a bug? I am not sure.
If you're under a workspace running that, it will respect workspace settings. That means without resolver = "2" it is still running with resolver v1.
I am not entirely sure this is a bug report or a feature request but I'll describe anyway what happened.
We have a fairly large workspace over at https://github.com/libp2p/rust-libp2p. Previously, the root
Cargo.toml
was both a crate and a workspace manifest. For various reasons, I wanted to move away from that.That root crate is
edition = 2021
which implies the new dependency resolver (version2
). Thus, we did not specifyresolver = 2
explicitly as part of the[workspace]
table. We need the new feature resolver because we have some target-specific features to activiate:https://github.com/libp2p/rust-libp2p/blob/7069d78ee333c92a3b99bbad100d9c6ba2fe361a/transports/noise/Cargo.toml#L26-L30
What happened now is that by splitting the root manifest into a separate crate, the
edition = 2021
disappeared and cargo was now falling back using v1 of the resolver, resulting in a failing build because thefeatures
of thesnow
dependency within theCargo.toml
oflibp2p-noise
were incorrectly merged.This was especially surprising because I was running
cargo build --package libp2p
which does haveedition = 2021
. I guess this could be considered a bug? I am not sure.The problem was fixed by explicitly specifying
resolver = 2
in the[workspace]
table.Here is the PR: libp2p/rust-libp2p#3536
The text was updated successfully, but these errors were encountered: