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

PathSource::list_files doesn't look at .gitignore if there's no package in the git root #1729

Closed
alexcrichton opened this issue Jun 17, 2015 · 1 comment · Fixed by #8095
Closed
Labels
A-git Area: anything dealing with git C-bug Category: bug

Comments

@alexcrichton
Copy link
Member

Currently PathSource::list_files looks for packages where Repository::open will succeed, but this will never succeed if there is never a package at the root of a git repository. This means that filters such as pruning everything in .gitignore from the file listings will not work because no git repository is detected.

To replicate this behavior:

  • Create a git repository and change directories into it
  • cargo new a
  • cargo new b
  • Edit b to depend on a (as a path dependency)
  • Edit a to have a build script which creates the file a/foo in the git repository
  • Add a/foo to the repo's .gitignore

On re-running cargo build in the directory for b it will spuriously rebuild a too frequently as it doesn't know that it should ignore a/foo.

@alexcrichton
Copy link
Member Author

Also note that there is a comment to this effect, it just turned out to be correct!

metajack added a commit to metajack/servo that referenced this issue Jun 17, 2015
This is necessary to ensure Cargo knows when to rebuild. Normally
.gitignore would be enough to exclude these from Cargo's freshness
calculation, but rust-lang/cargo#1729 prevents
this currently. This is the new, correct way to do these thigns, just
like the style crate does.
metajack added a commit to metajack/servo that referenced this issue Jun 17, 2015
This is necessary to ensure Cargo knows when to rebuild. Normally
.gitignore would be enough to exclude these from Cargo's freshness
calculation, but rust-lang/cargo#1729 prevents
this currently. This is the new, correct way to do these thigns, just
like the style crate does.
bors-servo pushed a commit to servo/servo that referenced this issue Jun 17, 2015
Generate code into OUT_DIR.

This is necessary to ensure Cargo knows when to rebuild. Normally
.gitignore would be enough to exclude these from Cargo's freshness
calculation, but rust-lang/cargo#1729 prevents
this currently. This is the new, correct way to do these thigns, just
like the style crate does.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6408)
<!-- Reviewable:end -->
@carols10cents carols10cents added the C-bug Category: bug label May 10, 2017
jrmuizel pushed a commit to jrmuizel/gecko-cinnabar that referenced this issue Jun 12, 2017
…-outdir); r=SimonSapin

This is necessary to ensure Cargo knows when to rebuild. Normally
.gitignore would be enough to exclude these from Cargo's freshness
calculation, but rust-lang/cargo#1729 prevents
this currently. This is the new, correct way to do these thigns, just
like the style crate does.

Source-Repo: https://github.com/servo/servo
Source-Revision: ff59e1b8de67f1988522d6b6e6c4adda957fad5b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Sep 30, 2019
…-outdir); r=SimonSapin

This is necessary to ensure Cargo knows when to rebuild. Normally
.gitignore would be enough to exclude these from Cargo's freshness
calculation, but rust-lang/cargo#1729 prevents
this currently. This is the new, correct way to do these thigns, just
like the style crate does.

Source-Repo: https://github.com/servo/servo
Source-Revision: ff59e1b8de67f1988522d6b6e6c4adda957fad5b

UltraBlame original commit: b4e57a840c0b24a7bbc5db12f6d91b40300761f2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 1, 2019
…-outdir); r=SimonSapin

This is necessary to ensure Cargo knows when to rebuild. Normally
.gitignore would be enough to exclude these from Cargo's freshness
calculation, but rust-lang/cargo#1729 prevents
this currently. This is the new, correct way to do these thigns, just
like the style crate does.

Source-Repo: https://github.com/servo/servo
Source-Revision: ff59e1b8de67f1988522d6b6e6c4adda957fad5b

UltraBlame original commit: b4e57a840c0b24a7bbc5db12f6d91b40300761f2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 1, 2019
…-outdir); r=SimonSapin

This is necessary to ensure Cargo knows when to rebuild. Normally
.gitignore would be enough to exclude these from Cargo's freshness
calculation, but rust-lang/cargo#1729 prevents
this currently. This is the new, correct way to do these thigns, just
like the style crate does.

Source-Repo: https://github.com/servo/servo
Source-Revision: ff59e1b8de67f1988522d6b6e6c4adda957fad5b

UltraBlame original commit: b4e57a840c0b24a7bbc5db12f6d91b40300761f2
@ehuss ehuss added the A-git Area: anything dealing with git label Apr 6, 2020
@bors bors closed this as completed in ef3cbfc Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-git Area: anything dealing with git C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants