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

Make workspace member inclusion/exclusion more useful, consistent, and intuitive #11405

Open
4 tasks
weihanglo opened this issue Nov 22, 2022 · 1 comment
Open
4 tasks
Assignees
Labels
A-manifest Area: Cargo.toml issues 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-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@weihanglo
Copy link
Member

weihanglo commented Nov 22, 2022

Problem

As of now, Cargo supports glob syntax for workspace.member to include crates as workspace members. However, for workspace.exclude it is implemented by a plain starts_with comparing with manifest path of certain crates. This confuses people as they need to figure out which rules overrides the other. It is also inconsistent with package.include and package.exclude, as they choose gitignore syntax.

For workspace.member, it proactively checks the existence of Cargo.toml to include a member, and throws an errors if Cargo.toml doesn't exist, which makes globbing **/* often invalid.

Similar issues have been raised from time to time:

Proposed Solution

There are several possible ways to "fix" the situation (to some extent).

There might be other possible solution I am not aware of here.

Notes

I would keep this as the main issue and close some. If this is inappropriate, please say it out load, and we can reopen the original issues.

Footnotes

  1. An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded.
    See https://git-scm.com/docs/gitignore#_pattern_format

@Rustin170506
Copy link
Member

I would like to find a solution to this issue.
@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-manifest Area: Cargo.toml issues 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-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

2 participants