Zulip Chat Archive
Stream: general
Topic: How to save .cache folder in some other directory?
Robert Joseph (May 06 2025 at 23:05):
Hey I was just wondering when you compile a lean project and it stores say the mathlib data in .cache, is there any way to force it to save it in some other directory? Reason is that when I am working on these clusters, on my home directory the cache takes a huge amount of space and would like to move it to pscratch or raid where there's like way more space!
Eric Wieser (May 06 2025 at 23:21):
You could symlink .cache/mathlib to where you actually want it to go
Robert Joseph (May 07 2025 at 00:13):
Oh I see, is there any other way? like exporting or setting up a path to store it somewhere else. Same for elan! https://github.com/leanprover/elan like it tells me that I can choose which path to install, but when I have to modify the path variable during installation, it only lets me do a y/n answer and not specify the path? so how can I also ensure I don't install elan on my home but rather in the raid directory
image.png
Julian Berman (May 07 2025 at 00:20):
MATHLIB_CACHE_DIR is the envvar you're looking for
Julian Berman (May 07 2025 at 00:22):
E.g. https://github.com/Julian/dotfiles/blob/main/.config/zsh/.zshenv#L81
Julian Berman (May 07 2025 at 00:22):
ELAN_HOME for elan
Robert Joseph (May 07 2025 at 00:27):
omg thank you so much! this has been a lifesaver
Last updated: Dec 20 2025 at 21:32 UTC