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

Option to disable workspace edit feature of cargo new #13432

Closed
bjorn3 opened this issue Feb 12, 2024 · 4 comments
Closed

Option to disable workspace edit feature of cargo new #13432

bjorn3 opened this issue Feb 12, 2024 · 4 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-new S-triage Status: This issue is waiting on initial triage.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Feb 12, 2024

Problem

cargo new will unconditionally add the new crate to a cargo workspace when there is a Cargo.toml in the parent directory, even when that Cargo.toml is not intended as cargo workspace. For example I might create a new crate just to quickly test something or the build system can't handle the parent Cargo.toml being a cargo workspace for whatever reason.

Proposed Solution

Add an option to cargo new to stop it from adding the new crate to any cargo workspace. And maybe disable the auto adding when there isn't yet a cargo workspace.

Notes

No response

@bjorn3 bjorn3 added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Feb 12, 2024
@epage
Copy link
Contributor

epage commented Feb 12, 2024

#13391 stops adding the package to the "workspace" if there isn't already a [workspace].

cargo script will also be helping with these "quick experiment" cases.

For myself, I lean away with making this configurable.

@bjorn3
Copy link
Member Author

bjorn3 commented Feb 12, 2024

#13391 stops adding the package to the "workspace" if there isn't already a [workspace].

Great! My nightly was just a bit too old for that, so I missed it.

@weihanglo
Copy link
Member

With #13391, is this still relevant?

@epage
Copy link
Contributor

epage commented Mar 7, 2024

Without further input, I'm going to close this as resolved. Let us know if there is a reason we should re-evaluate this.

@epage epage closed this as completed Mar 7, 2024
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` Command-new S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

3 participants