Skip to content

cargo add --no-default-features displaying wrong feature selection #13652

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

Closed
BartMassey opened this issue Mar 26, 2024 · 3 comments
Closed

cargo add --no-default-features displaying wrong feature selection #13652

BartMassey opened this issue Mar 26, 2024 · 3 comments
Labels
C-bug Category: bug Command-add S-triage Status: This issue is waiting on initial triage.

Comments

@BartMassey
Copy link
Contributor

Problem

This is probably my stupidity somehow, but I'm not seeing it.

What am I doing wrong or misunderstanding? Help appreciated.

Steps

cargo add microfft --features=size-16384,std --no-default-features

shows

    Updating crates.io index
      Adding microfft v0.5.1 to dependencies.
             Features:
             + size-1024
             + size-128
             + size-16
             + size-16384
             + size-2048
             + size-256
             + size-32
             + size-4
             + size-4096
             + size-512
             + size-64
             + size-8
             + size-8192
             + std
             - bitrev-tables

This seems to indicate that the default features were not turned off. Yet the added snippet is

microfft = { version = "0.5.1", default-features = false, features = ["size-16384", "std"] }                                                                   

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.77.0 (3fe68eabf 2024-02-29)
release: 1.77.0
commit-hash: 3fe68eabf93cbf3772bbcad09a9206c783e2de3f
commit-date: 2024-02-29
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.5.0-DEV (sys:0.4.70+curl-8.5.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Debian n/a (bookworm) [64-bit]
@BartMassey BartMassey added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Mar 26, 2024
@epage
Copy link
Contributor

epage commented Mar 26, 2024

The list of dependencies lists everything that is activated, directly or indirectly.

In this case, size-16384 activates size-8192 which activates size-4096, etc.

See https://gitlab.com/teskje/microfft-rs/-/blob/master/Cargo.toml?ref_type=heads

@epage
Copy link
Contributor

epage commented Mar 26, 2024

See #10681 for exploring the idea of distinguishing direct from indirect activations

@BartMassey
Copy link
Contributor Author

Ah, that makes sense. Thanks much.

Definitely will thumbs-up #10681

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Command-add S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants