Skip to content

Automatically register workspace members in workspace.dependencies in cargo new #15180

Open
@epage

Description

@epage

Problem

In using a workspace, I'd like it to be easy to setup workspace members to be used with workspace = true which includes reducing the number of places I need to update paths as I move packages in the workspace.

Proposed Solution

If you have the following workspace

[workspace]

and you run

$ cargo new foo

You should get

[workspace]
members = ["foo"]

[workspace.dependencies]
foo = { path = "foo", version = "0.1.0" }

Notes

RFC 2906 requested we implicitly add version when we see path which was rejected during stabilization.

#13453 requests we implicitly make workspace members available for workspace = true but this comes at many costs.

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-newS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions