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

--features in workspace note not actionable #8770

Closed
pickfire opened this issue Oct 12, 2020 · 6 comments · Fixed by #8773
Closed

--features in workspace note not actionable #8770

pickfire opened this issue Oct 12, 2020 · 6 comments · Fixed by #8773
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@pickfire
Copy link
Contributor

Describe the problem you are trying to solve

I am trying to use --features for one of the package in workspace but the reported error is not actionable.

error: --features is not allowed in the root of a virtual workspace
note: while this was previously accepted, it didn't actually do anything

Describe the solution you'd like

I haven't check how yet but the features, I guess one needs to search through github issue or stackoverflow to figure this.

Notes

Aside, the note text should be bold, rustc does but cargo does not.

@pickfire pickfire added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Oct 12, 2020
@ehuss
Copy link
Contributor

ehuss commented Oct 12, 2020

The --features flag only works in a package directory.

On nightly, you can use the -Z package-features flag to use it in a workspace.

@pickfire
Copy link
Contributor Author

Yeah, but what should an average joe do on stable? Do they need to edit the Cargo.toml in the package?

@ehuss
Copy link
Contributor

ehuss commented Oct 13, 2020

You can cd into the package directory.

@pickfire
Copy link
Contributor Author

Maybe we can add that as a suggestion?

@ehuss
Copy link
Contributor

ehuss commented Oct 13, 2020

Yea, feel free to submit a PR! Better error messages are always welcome.

@Xanewok
Copy link
Member

Xanewok commented Oct 13, 2020

I feel it's also worth mentioning the --manifest-path since it doesn't require changing the current dir, AIUI it also respects the rules around workspaces/parent manifests and such.

bors added a commit that referenced this issue Oct 14, 2020
Add actionable help message for --features

Fix #8770
@bors bors closed this as completed in c882b8e Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants