Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMach: Add `mach clean-cargo-cache` command #16593
Conversation
highfive
commented
Apr 24, 2017
|
Heads up! This PR modifies the following files:
|
|
Just had a brief look. Will take a closer look tomorrow. |
| if os.path.isfile(path): | ||
| return os.path.getsize(path) / (1024 * 1024.0) | ||
| total_size = 0 | ||
| for dirpath, dirnames, filenames in os.walk(path): |
This comment has been minimized.
This comment has been minimized.
wafflespeanut
Apr 30, 2017
Member
I'm not really comfortable doing a os.walk through the cache, without knowing how long it takes for, say, 50 outdated crates? (which, I guess, is a perfectly normal situation for people who build servo very often).
While displaying crate sizes is a nice feedback, walking through checked out repositories (and crates) is probably a bad idea (what if the repository is huge? I'm sure python will suck on that!). So, we should see how long it takes if we don't walk (i.e., don't display size information). Then, depending on the difference, we should either remove that code, or have a flag for disabling that (since we don't want to see the size information all the time).
Also, the back-ported scandir module is worth looking at for walking and getting file info.
This comment has been minimized.
This comment has been minimized.
UK992
Apr 30, 2017
•
Author
Contributor
scandir on Windows needs Visual C++ Compiler for Python 2.7
update:
In my case (to delete 3776.33 MB):
with os.walk: 27s
with scandir: 16s
This comment has been minimized.
This comment has been minimized.
wafflespeanut
May 2, 2017
Member
That's not much of a difference. I don't think having that dependency is worth it. Let's stick to os.walk then. Also, what if we avoid walking entirely? (i.e., don't display sizes?)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
wafflespeanut
May 8, 2017
•
Member
Yeah, that's expected. So, it's good to have it as an option. Anyway, feel free to r=me once you've amended the fixup :)
| if exist_item not in current_crate: | ||
| crate_count += 1 | ||
| removing_anything = True | ||
| if int(crate_count) >= int(keep) or not current_crate: |
This comment has been minimized.
This comment has been minimized.
wafflespeanut
Apr 30, 2017
Member
I'm curious how tracking the keep count helps in keeping the "N" most recent deps. It may probably work for downloaded crates, but the git repos have their commit hashes instead of versions, which means we're not really doing a great job there, right?
This comment has been minimized.
This comment has been minimized.
UK992
Apr 30, 2017
•
Author
Contributor
for git packages i use the same logic as in find_dep_path_newest, based on modification date.
|
Oh, and I have a nice (but ugly) hack in mind, which is, to make use of (also pinging @aneeshusa for comments) |
|
@UK992 Is this still WIP? Do you have something else in mind? If not, I'll go over it once more and we'll land it. |
|
It's ready for review. |
|
Looks good to me. Can you squash the fixup appropriately? @bors-servo delegate+ |
|
|
|
@bors-servo r=wafflespeanut |
|
|
Mach: Add `mach clean-cargo-cache` command <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16593) <!-- Reviewable:end -->
|
|
Try to re-enable unit tests on travis-ci After #16573 and #16593, issue #15076 _could_ be fixed. Edit: Closes #14723 Closes #15076 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16767) <!-- Reviewable:end -->
…UK992:travis); r=jdm After servo/servo#16573 and servo/servo#16593, issue servo/servo#15076 _could_ be fixed. Edit: Closes #14723 Closes #15076 Source-Repo: https://github.com/servo/servo Source-Revision: 8ff484d3fd0b092d64af8b0a2cfa51b318631b82 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : b2ee28ecf18792f3a1ebf50bcb548ede41fb2e70
…UK992:travis); r=jdm After servo/servo#16573 and servo/servo#16593, issue servo/servo#15076 _could_ be fixed. Edit: Closes #14723 Closes #15076 Source-Repo: https://github.com/servo/servo Source-Revision: 8ff484d3fd0b092d64af8b0a2cfa51b318631b82
…UK992:travis); r=jdm After servo/servo#16573 and servo/servo#16593, issue servo/servo#15076 _could_ be fixed. Edit: Closes #14723 Closes #15076 Source-Repo: https://github.com/servo/servo Source-Revision: 8ff484d3fd0b092d64af8b0a2cfa51b318631b82 UltraBlame original commit: 2445c1a53fe2bf66317fcbb495a528eb68fdabc3
…UK992:travis); r=jdm After servo/servo#16573 and servo/servo#16593, issue servo/servo#15076 _could_ be fixed. Edit: Closes #14723 Closes #15076 Source-Repo: https://github.com/servo/servo Source-Revision: 8ff484d3fd0b092d64af8b0a2cfa51b318631b82 UltraBlame original commit: 2445c1a53fe2bf66317fcbb495a528eb68fdabc3
…UK992:travis); r=jdm After servo/servo#16573 and servo/servo#16593, issue servo/servo#15076 _could_ be fixed. Edit: Closes #14723 Closes #15076 Source-Repo: https://github.com/servo/servo Source-Revision: 8ff484d3fd0b092d64af8b0a2cfa51b318631b82 UltraBlame original commit: 2445c1a53fe2bf66317fcbb495a528eb68fdabc3
UK992 commentedApr 24, 2017
•
edited
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is