Fixes #3090 using CACHE_DIR instead of /tmp