Skip to content

cargo new: Confusing error message about adding to a workspace #13985

Closed
@ehuss

Description

Problem

cargo add seems to generate a confusing message about adding a package to a workspace when there is no workspace, and it isn't actually added to the workspace.

Steps

  1. cargo new foo
  2. cd foo
  3. cargo new bar
    This prints: Adding bar as member of workspace at /Temp/foo
  4. cargo metadata | jq .workspace_members
    Notice that bar was not added as a workspace member. Also notice that foo's Cargo.toml was not modified.

Possible Solution(s)

Should not print a message about adding bar to a workspace when it isn't actually added.

Notes

No response

Version

cargo 1.80.0-nightly (431db31d0 2024-05-28)
release: 1.80.0-nightly
commit-hash: 431db31d0dbeda320caf8ef8535ea48eb3093407
commit-date: 2024-05-28
host: aarch64-apple-darwin
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0 (sys:0.4.72+curl-8.6.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Mac OS 14.5.0 [64-bit]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-workspacesArea: workspacesC-bugCategory: bugCommand-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