-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed as not planned
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Description
Problem
Currently when we run cargo new
command inside a workspace, it gives following warnings,
warning: compiling this new package may not work due to invalid workspace configuration
current package believes it's in a workspace when it's not:
current: /path/to/workspace/new_crate/Cargo.toml
workspace: /path/to/workspace/new_crate/Cargo.toml
this may be fixable by adding `new_crate ` to the `workspace.members` array of the manifest located at: /path/to/workspace/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.
Additionally, while running cargo run new_crate
it gives following errors(but no issue with cargo run --bin new_crate)
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
Compiling api v0.1.0 (/path/to/workspace/new_crate)
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
Running `target/debug/api api`
Proposed Solution
- We can add following commands
cargo new -we
andcargo new -wi
cargo new --workspace exclude
andcargo new --workspace include
- The scope of the resolver is bit unclear for me. If we add
cargo workspace
command, we can add more subcommands I think.
Notes
No response
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.