Apparently zig build
by default creates .zig-cache
next to build.zig.
This is not ideal for me, because all my projects are synchronized, and the cache grows really fast, wasting space on all of the other machines. (And keeping syncthing more busy than it needs to be.) I could set up some ignore rules but Ideally I’d just like to have the cache somewhere outside my synced directory.
IIUC, the solution is to set ZIG_LOCAL_CACHE_DIR
, but is it safe?
My thinking is, there must be a reason to have N local caches in the first place, right? (Actually, there’s already a global cache in ~/.cache/zig
, so we end up with1 + N caches.)
So is there a risk from setting ZIG_LOCAL_CACHE_DIR
globally and thus merging all local caches into one directory (perhaps even the same dir being already used by global cache)?