-
-
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
Automatically evict zig-cache to stop it growing too large #15358
Comments
I have the same problem. |
I have the same problem with it reaching ~60GiB as I tend to run |
It seems like any limit would necessarily be arbitrary and not satisfy everyone. Maybe a |
Then you have to remember to run |
I like the idea of |
The overhead is minimal, and it can even be done on a separate thread since it shouldn't affect the rest of the build process. There's no real need to check modified times - probably better to keep a "journal" file that keeps track of when/how often cache entries are used, especially since modified times aren't hugely reliable to begin with. |
this is a complexity that does not feel like it would be worth the maintenance burden when Zig can instead communicate the policy that its okay to |
@nektro this is an issue caused by zig where |
Note that zig's caching system is designed explicitly so that garbage collection could happen in one process simultaneously while the cache is being used by another process. |
Hi guys! I have the same problem. I use raylib in one project and zig-cache folder size = 97G 😱 |
That's too big, delete it! |
There seems to be a new subfolder created under |
I'd love to see this. I'm primarily using zig build as the low level compilation in another language called Acton. An Acton project is compiled by the acton compiler into C source code which is then compiled by the zig build system. Any Acton project can thus also be seen as a Zig project. We currently just use a single global (well, per user) cache at |
I note that this is not only the |
Yeah, I'm also excited about the possibility of automatic cleanup. I just ran WizTree to find out why my disk was full, and the zig cache for one project alone was like 140 GB. And I have more than one zig project. |
I was recently freeing up some space on my laptop and came across a
zig-cache
18GiB in size. This is far larger than reasonable, and it was caused by having ~45 cached copies of a large C library (Binaryen, in this case) each about 340MiB.Zig could stop this happening by automatically removing old cache entries, either keeping cached data for the most recent
n
builds, or trying to keep the cache under a certain size. This being configurable per-project would be nice.The text was updated successfully, but these errors were encountered: