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

Add --workspace option to cargo new and cargo init #8411

Closed
wants to merge 4 commits into from

Conversation

windy1
Copy link

@windy1 windy1 commented Jun 26, 2020

This pull request minimally adds a --workspace option to both cargo new and cargo init.

Related Issue: #8365

  • Tests passing
  • Code formatted

For example:

$ cargo new --workspace foo

Will produce:

foo
└── Cargo.toml

0 directories, 1 file

With a Cargo.toml with the contents:

[workspace]
members = []

Notes:

  • The --edition option is silently ignored (perhaps this warrants a warning?)
  • The --vsc option is observed because build artifacts can be created in the root workspace directory

Opinion: Wanted to start off small here, but being able to manage workspaces through cargo is a big value-add from my perspective. Not only would it provide QoL enhancements for developers using Cargo CLI, but also provide editors/IDEs a convenient way to manage them as well.

Walker Crouse added 4 commits June 25, 2020 17:07
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 26, 2020
@ehuss
Copy link
Contributor

ehuss commented Jul 3, 2020

Thanks for the PR! Unfortunately, I don't think we'll be able to merge this at this time. The future and design of cargo new is uncertain, and I think this has some overlap with possible directions it may go. In particular, this would probably have some interaction with templates, and may even be possible to completely implement this with templates. There's also some complications with how cargo new doesn't really work correctly inside a workspace (#6378). For now, we'd like to postpone this until there is a better understanding of how cargo new will work.

@windy1
Copy link
Author

windy1 commented Jul 4, 2020

Thank you for the clarification @ehuss. Definitely understandable. I would just like to see workspaces better supported in cargo in general.

@ehuss
Copy link
Contributor

ehuss commented Jul 28, 2020

Closing as postponed. Thanks for giving it a try, though! Hopefully we'll have bandwidth to pursue this more in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants