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

Print a note when cargo new is editing workspace.members #13403

Closed
weihanglo opened this issue Feb 6, 2024 · 3 comments · Fixed by #13411
Closed

Print a note when cargo new is editing workspace.members #13403

weihanglo opened this issue Feb 6, 2024 · 3 comments · Fixed by #13411
Assignees
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-new E-easy Experience: Easy S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review

Comments

@weihanglo
Copy link
Member

weihanglo commented Feb 6, 2024

Problem

Starting from #12779, cargo new automatically adds the new package to workspace.members when invoked inside from a directory of a workspace. This is a great feature, however sometimes a bit less noticeable.

Proposed Solution

Print a notice when a workspace is found and cargo new are editing workspace.members of it. For example,

      Creating binary (application) `foo` package
+ note: adding `foo` as a workspace member of workspace `bar` at `/home/projects/bar`
  note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Notes

version

cargo 1.77.0-beta.1 (7bb7b5395 2024-01-20)
release: 1.77.0-beta.1
commit-hash: 7bb7b539558dc88bea44cee4168b6269bf8177b0
commit-date: 2024-01-20
@weihanglo weihanglo added E-easy Experience: Easy A-diagnostics Area: Error and warning messages generated by Cargo itself. Command-new A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review labels Feb 6, 2024
@weihanglo
Copy link
Member Author

cc @linyihai

This may have conflicted with #13391, or you can take this after #13391 merges :)

@linyihai
Copy link
Contributor

linyihai commented Feb 6, 2024

@rustbot claim

Thank you for ping me. I'd like to addressed this after #13391

@epage
Copy link
Contributor

epage commented Feb 6, 2024

I wonder if this could work as a status

Adding foo as member of workspace at /path

Unsure if we should use path diff for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-new E-easy Experience: Easy S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants