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

cargo-feature named-profiles ignored in Cargo.toml parsing #9074

Closed
wlmwlmwlm opened this issue Jan 14, 2021 · 3 comments · Fixed by #9092
Closed

cargo-feature named-profiles ignored in Cargo.toml parsing #9074

wlmwlmwlm opened this issue Jan 14, 2021 · 3 comments · Fixed by #9092
Labels
C-bug Category: bug

Comments

@wlmwlmwlm
Copy link

Problem
cargo-feature named-profiles is ignored and makes cargo barf on me, in:

cargo 1.51.0-nightly (329895f5b 2021-01-06)

... on a reasonably sane Linux installation.

Tracking issue for the named-profiles feature: #6988

Steps

Cargo.toml:

package]
name = "test"
version = "0.1.0"
authors = ["wlmwlmwlm <wlmwlmwlm@gmail.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

cargo-features = ["named-profiles"]

[profile.notworking]
inherits = "debug"
lto = true

[dependencies]

Source: (default main.rs)

Invocations:

$ cargo +nightly build
error: failed to parse manifest at `/home/wlmwlmwlm/named-profiles-reproduction/Cargo.toml`

Caused by:
  feature `named-profiles` is required

  consider adding `cargo-features = ["named-profiles"]` to the manifest
$ cargo +nightly build --profile notworking -Z unstable-options
error: failed to parse manifest at `/home/wlmwlmwlm/named-profiles-reproduction/Cargo.toml`

Caused by:
  feature `named-profiles` is required

  consider adding `cargo-features = ["named-profiles"]` to the manifest
@wlmwlmwlm wlmwlmwlm added the C-bug Category: bug label Jan 14, 2021
@ehuss
Copy link
Contributor

ehuss commented Jan 14, 2021

The line cargo-features needs to go at the top of Cargo.toml (above the [package] table), otherwise it is part of [package] table which is the wrong location.

We should probably add a special-case for this to give a better error message, and the docs should also be a little clearer about where it needs to go.

@wlmwlmwlm
Copy link
Author

wlmwlmwlm commented Jan 14, 2021 via email

@bors bors closed this as completed in ba3311e Jan 21, 2021
@wlmwlmwlm
Copy link
Author

wlmwlmwlm commented Jan 23, 2021 via email

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

Successfully merging a pull request may close this issue.

2 participants