-
Notifications
You must be signed in to change notification settings - Fork 2.6k
cargo: use git gc --auto #4656
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
cargo: use git gc --auto #4656
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I removed the testcase because whether git gc will run or not will now depend on git configs such as
|
Thanks! I'm sort of wary removing the tests for this, though, because then there's no way of knowing whether this works over time. Can we force the auto gc to run in tests? |
I'd suggest that the auto preference in git can probably be checked and the test not run if it's set (that is, test passes). Alternatively, we might be able to configure git per-directory or something so it always runs for the test.... |
01b9b8a
to
b8dfbf5
Compare
I found out we can simply disable the gc.auto setting for that test :) |
b8dfbf5
to
d4a8f72
Compare
Nice! I'm realizing now though that the gc unconditionally happens and this can sometimes slow down fetches from the network because spawning a |
You mean, first check if cargo pack size limit is exceeded and if so, run git gc --auto? |
Indeed yeah! |
d4a8f72
to
570d58c
Compare
Looks like the test is failing on windows:
Unfortunately I am not sure what to do here, I don't have a windows machine and I cannot reproduce the failure on linux. :( |
570d58c
to
3c44d51
Compare
I'm not really sure what's happening on Windows, but it looks like the gc isn't running? |
This will allow git to decide when to run gc by itself and will honor userside settings. Implements rust-lang#4495
3c44d51
to
3e68f72
Compare
Is this good to go? |
I would personally prefer to not land this unless we're still exercising the code paths on various platforms (especially Windows as it can be tricky for situations like this). As-is I believe it just disables the test on Windows? |
Yes, this is correct. I have no way of testing/debugging this on windows natively myself. #[test]
// it looks like these tests passes on some windows machines but not others,
// notably not on AppVeyor's machines. Sounds like another bug for another day.
#[cfg_attr(windows, ignore)] and I assume this triggers here as well. If this is a blocker on the PR feel free to reject it. |
Sorry yeah for now these implementations are tricky enough (especially across platforms) I'd like to keep the tests running across all platforms. We can always reopen though with tests that work across all platforms! |
This will allow git to decide when to run gc by itself and will honor userside settings.
Implements #4495