-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
excluding a folder should exclude all it's content #3578
Comments
We ran into the same issue in servo/rust-cssparser#169. |
* We need to use `*` or `**` in the excludes, otherwise they don't work. <rust-lang/cargo#3578> is tracking the issue.
And we just fell into this trap too! Here's the status quo: These work:
These DON'T work:
|
https://github.com/rust-lang/cargo/blame/master/src/cargo/sources/path.rs#L113 (CC'ing from blame: @alexcrichton, @mbrubeck, @llogiq) Is the status quo the desired behavior? If so, I can add a note to the docs to prevent people from facing the same issue. If not, I suppose we should replace What do you think? |
Sounds reasonable to me to add support for this! To me seems like the existing behavior is a bug. |
Okay, so I'll give this a shot soon. |
NOTE: This is a major change in pattern matching for `include` and `exclude` fields, and can result in additional inclusion/exclusion for some patterns. Previously, for inclusion/exclusion matters, Cargo only works with paths of files in a package/repository, and glob pattern matching has been applying only to these file paths. The old behavior results in some unexpected behavior. For example, having: ```toml exclude = ["data"] ``` in a manifest next to a `data` directory, it will not exclude the directory. To make it work, a pattern must be provided that matches the *files* under this directory, like: ```toml exclude = ["data/*"] ``` To make Cargo's inclusion/exclusion behavior more intutional, and bring it on par with similar systems, like `gitignore`, we need to also match these patterns with the *directories*. The directories are seen internally as *parents* of the files. Therefore, this diff expands the pattern matching to files and their parent directories. Now, it's easier to exclude all data files: ```toml exclude = ["data"] ``` or include only the `src` directory: ```toml include = ["src"] ``` Fixes <rust-lang#3578>
I believe we can now close this issue in favor of #4268, which is implementing the feature and tracking the migration. |
👍 |
for example here the complete content of the
foo
folder should be excluded ... but it needs to befoo/*
atm ... which means I always shipped a ton of useless stuff ... so please make folders exclude the whole folder + contentThe text was updated successfully, but these errors were encountered: