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

Resolver 2.0 unifying features when doing cargo build #10423

Closed
huguesBouvier opened this issue Feb 25, 2022 · 3 comments
Closed

Resolver 2.0 unifying features when doing cargo build #10423

huguesBouvier opened this issue Feb 25, 2022 · 3 comments
Labels
C-bug Category: bug

Comments

@huguesBouvier
Copy link

Problem

I have a crate a that depends on crate b.
crate b has a feature flag test.

crate a has the following in Cargo.toml:

[package]
name = "cratea"
version = "0.1.0"
edition = "2021"

[dependencies]
crateb = { path = "../crateb "  }
[dev-dependencies]
crateb = { path = "../crateb ", features = ["tests"]  }

When I do cargo build with 2021 edition, I expect crateb to be build without the feature tests but it looks like it is still unifying.

Is there a possible workaround?

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.57.0 (b2e52d7ca 2021-10-21)
release: 1.57.0
commit-hash: b2e52d7cab0a286ee9fcc0c17510b1e72fcb53eb
commit-date: 2021-10-21
host: x86_64-unknown-linux-gnu
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.79.1-DEV (sys:0.4.49+curl-7.79.1 vendored ssl:OpenSSL/1.1.1l)
os: Ubuntu 18.04 (bionic) [64-bit]
@huguesBouvier huguesBouvier added the C-bug Category: bug label Feb 25, 2022
@ehuss
Copy link
Contributor

ehuss commented Feb 25, 2022

Can you provide a complete example, and run with cargo build -v and show the output? There should not be any --cfg flags passed to crateb.

@huguesBouvier
Copy link
Author

Thanks for the prompt reply. I found the issue.
I have a workspace, I had to specify the resolver=2 to my workspace and it worked.
image

@ehuss
Copy link
Contributor

ehuss commented Feb 25, 2022

Ah, glad it got figured out. I'm going to close this as a duplicate of #10112 then.

@ehuss ehuss closed this as completed Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants