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

Automatically add crate to workspace with cargo new #62471

Closed
czipperz opened this issue Jul 7, 2019 · 2 comments
Closed

Automatically add crate to workspace with cargo new #62471

czipperz opened this issue Jul 7, 2019 · 2 comments

Comments

@czipperz
Copy link
Contributor

czipperz commented Jul 7, 2019

I think it would make sense if there was a flag to cargo new such as --workspace that would add the new crate to the workspace. There is already workspace detection:

~/rust-comp master $ cargo new --lib abc
warning: compiling this new crate may not work due to invalid workspace configuration

current package believes it's in a workspace when it's not:
current:   /home/czipperz/rust-comp/abc/Cargo.toml
workspace: /home/czipperz/rust-comp/Cargo.toml

this may be fixable by adding `abc` to the `workspace.members` array of the manifest located at: /home/czipperz/rust-comp/Cargo.toml
Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest.
Created library `abc` package

So it probably wouldn't be too hard to have a way to automate the step of

adding abc to the workspace.members array

@Centril
Copy link
Contributor

Centril commented Jul 7, 2019

This should be filed over at https://github.com/rust-lang/cargo/issues/.

@Centril Centril closed this as completed Jul 7, 2019
@czipperz
Copy link
Contributor Author

czipperz commented Jul 7, 2019

Brilliant it's already in motion over there rust-lang/cargo#6378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants