-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[package] include
Cargo directive does not override .gitignore
#4135
Comments
(in case its not clear, when I remove the line |
FWIW I believe this code is all located here and I think that we basically just apply gitignore filters before checking include/exclude, whereas we should do the opposite! |
@alexcrichton is there any reason why we could/should not change the code so that instead of
In english: under this scheme we always apply the The main objections I could imagine to this are:
(But personally I would find using an additive Update: (plus, one could recreate the current semantics under this scheme by just putting in an exclude filter of |
(my previous suggestion can probably be filed in a followup bug; it seems like it should be easy to fix this one while retaining the documented semantics for |
Nah yeah that makes sense to me! It's sort of what I would have expected to happen before anyway. Traversing |
…e filelist via git
Issue 4135: include = [...] should override git file list Fix #4135: if theres `include = [...]`, then do not prepopulate file list via git.
I have a crate. It uses
tango
to keep a set of.md
and.rs
files in sync, but only the.md
file is meant to be checked in, so the generated.rs
are listed via a regexp in the.gitignore
.I was observing a problem: Edits to a generated
.rs
were failing to cause the crate's build script to be re-run, while edits to the.md
were correctly causing the build script to be re-run. (The basic premise of tango is that touching either the.rs
or.md
file should cause the build script to be re-run.)After some interactive debugging with @alexcrichton we determined that the issue appeared to be the fact that I had the generated
.rs
files listed in the.gitignore
(as mentioned in the first sentence), as explained here: According to http://doc.crates.io/manifest.html#the-exclude-and-include-fields-optional :So, okay: From what I can tell, that meant that updates to the
.rs
file was causing my build script to not run.But also according to that same document:
So apparently I should be able to list the files that my crate depends on explicitly in the
include
? Yet when I tried to do this by making a directive:the crate nonetheless continued to fail to rebuild in response to modifications to the generated
.rs
files.I have made a small branch to reproduce the problem without relying on subcrates like
tango
:https://github.com/pnkfelix/mon-artist/tree/reduction-build-issue
The idea with this reduction of the bug is that this build script is a no-op, so you need to run
cargo --verbose
to observe the problem. The crucial issue is that after building the crate, doing the following should cause the build script to be re-run, but does not:The text was updated successfully, but these errors were encountered: