-
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
Respect Cargo.toml [package.exclude]
even not in a git repo.
#9186
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Thanks for the PR! Unfortunately it's been basically forever since I last looked at any of this and at this point I don't really remember much about what's going on here. I tried to read this for awhile and piece together what's going on, but I wasn't really able to get very far unfortunately. You say that this may solve #9054, but does it? The body of this looks like it's basically just reverting #7680, which I'm not sure why that works or the interactions it has with other parts of the systems. I'm surprised that at a high-level vendor/package are different since in theory they should both be using the same code paths now that they're both bundled in Cargo. |
If I got it correctly,
We can see that #9054 is under the second scenario (unpacked sources in As far as I can think of, the only exception that would be affected by this change is a cargo project using version control tools other than git. Considering this is somewhat a breaking change, maybe we can disable skipping dotfiles functionality for |
I wonder if this could apply a similar change but basically try to fix just the use case mentioned? For example the default "exclude" builder could, even if not mentioned in the manifest, have a rule that says |
@alexcrichton Updated. Please help review at your pace 😁 Note that it is still impossible to negate (include) a file inside a dot directory. This is the limitation of gitignore rule.
|
Ok sorry for the delay in getting to this, but I'm looking at this again. Would you be up for writing a summary of the change that this is now updated to doing? I think I have it in my head but I want to make sure I'm right. After that I'll get a sign-off from the rest of the team that this behavior is ok to change. |
@alexcrichton Thank for you review! |
Ok thanks! @rfcbot fcp merge |
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Thanks! @bors r=alexcrichton |
📌 Commit 153146e has been approved by |
☀️ Test successful - checks-actions |
Update cargo 7 commits in f3e13226d6d17a2bc5f325303494b43a45f53b7f..e51522ab3db23b0d8f1de54eb1f0113924896331 2021-04-30 21:50:27 +0000 to 2021-05-07 21:29:52 +0000 - Add CARGO_TARGET_TMPDIR env var for integration tests & benches (rust-lang/cargo#9375) - Bump to 0.55.0, update changelog (rust-lang/cargo#9464) - Some updates to the unstable documentation (rust-lang/cargo#9457) - Add CARGO_PROFILE_<name>_SPLIT_DEBUGINFO to env docs. (rust-lang/cargo#9456) - Add `report` subcommand. (rust-lang/cargo#9438) - Respect Cargo.toml `[package.exclude]` even not in a git repo. (rust-lang/cargo#9186) - Document the other crates in the codebase in the contrib guide. (rust-lang/cargo#9439)
May resolves #9054
This bug (or feature?) has been lingering for a while. #7680 fixed the
cargo package
part butcargo vendor
is still affected by the heuristic rule of ignoring dotfiles.I propose to drop the rule and include dotfiles by default even if the package is not under git-controlled. See below.Updated: Changes Summary
cargo vendor
vendors dependencies without git-controlled butcargo package
often runs under a VCS like git. These lines are where they diverges:fn list_files_walk_except_dot_files_and_dirs
builds its own ignore instance, which cannot merge with other filter rules from[package.exclude]
. This causes some patterns to not work as expected, such as re-including file after ignoring dotfiles[.*, !negated_file]
.To make re-include (negate) rule works, this patch adds the excluding dotfiles rule directly into the
package.exclude
ignore instance if no include option nor git repo exists. Other old behaviors should not change in this patch.