Skip to content

Flag to not add a crate to a workspace when calling cargo new #13871

Open
@Makogan

Description

@Makogan

Problem

There should be a flag to instruct cargo new not to edit a workspace's root Cargo.toml by appending the crrate to its workspace members.
This PR partially addresses the issue but not entirely. One should be able to call cargo new without it editing the root's Cago.toml even if it has a workspace declaration.

This the situation I am running into. I use spirv-builder at runtime to compile rust source code into spirv for hot reloading of shaders. I thus often run cargo new to initialize the shader crate. However, I am forced to delete it from the workspace members each time, because this crate won't be compiled under the regular cargo workflow. Having a flag to disable the feature would be useful.

Proposed Solution

Add a flag that prevents cargo new from editing a workspace's Cargo.toml

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-initCommand-newS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions