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

Can't use unstable feature in ~/.cargo/config without enabling it in Cargo.toml #9926

Closed
Nemo157 opened this issue Sep 20, 2021 · 2 comments · Fixed by #11562
Closed

Can't use unstable feature in ~/.cargo/config without enabling it in Cargo.toml #9926

Nemo157 opened this issue Sep 20, 2021 · 2 comments · Fixed by #11562
Labels
A-unstable Area: nightly unstable support C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@Nemo157
Copy link
Member

Nemo157 commented Sep 20, 2021

Problem
Trying to use an unstable feature in my global config requires enabling that feature in every Cargo.toml I interact with.

Steps

# ~/.cargo/config
cargo-features = ["named-profiles"]
[profile.release-lto]
lto = true
> cargo build --profile release-lto -Z unstable-options
error: config profile `release-lto` is not valid (defined in `/home/nemo157/.cargo/config`)

Caused by:
  feature `named-profiles` is required

  consider adding `cargo-features = ["named-profiles"]` to the manifest

Possible Solution(s)
Allow the config to enable unstable features too (preferably only applying to features used within it, not features used in Cargo.toml).

Notes

Output of cargo version: cargo 1.55.0-nightly (3ebb5f15a 2021-07-02) (and tested on cargo 1.57.0-nightly (9a28ac83c 2021-09-18) which fails in the same way with a slightly different message).

@Nemo157 Nemo157 added the C-bug Category: bug label Sep 20, 2021
@ehuss ehuss added the A-unstable Area: nightly unstable support label Sep 20, 2021
@weihanglo
Copy link
Member

IMHO this is convenient for developers to enable features globally. Since we are already baking patch-in-config, hope that the config-merge rules and other implementations wouldn't be too hard.

BTW, labeling this as C-feature-request may be better 😆

@Eh2406 Eh2406 added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` and removed C-bug Category: bug labels Oct 13, 2021
@weihanglo
Copy link
Member

Close in favor of #11552, as features mentioned there are still unstable, which makes the intent a bit more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-unstable Area: nightly unstable support C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants