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

default-features = false not respected at compile time #324

Open
nrdxp opened this issue May 5, 2023 · 1 comment
Open

default-features = false not respected at compile time #324

nrdxp opened this issue May 5, 2023 · 1 comment
Labels
question Further information is requested

Comments

@nrdxp
Copy link

nrdxp commented May 5, 2023

I am currently in the process of attempting to use cargo2nix to build substrate, and I've ran into a confusing snag. I have a dependency specified here:
https://github.com/paritytech/substrate/blob/polkadot-v0.9.40/client/cli/Cargo.toml#L23

It is important that this flag is respected otherwise the crate compile fails, because a required feature dependency is not included. consequently I am hitting a build failure where it is trying to compile the names cli and failing to find the clap dependency. Of course this shouldn't be an issue as substrate only uses names as a lib, and the docs explicitly mention to disable default features when used as such.

I am a bit confused however, as I was able to set NIX_DEBUG in an override for the crate and I saw that cargo was indeed passing the --no-default-features flag, however the crate still attempts to build the cli and fails for some reason. Not sure if this is a mixup between cargo and rustc, but I'm not 100% sure if I can fix it, or if this needs to move further upstream.

@psionic-k
Copy link
Member

If you search around for features issues, the feature behavior is not very complete when platform dependencies exist.

Check your Cargo.nix for the offending feature being passed in.

Newer versions (try release-maintenance-branch) of cargo2nix do this properly already though.

@psionic-k psionic-k added the question Further information is requested label Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants