Currently user cache is customizable via CLJ_CACHE or CLJCONFIG (and XDG..) environment variables,
but inside project dir the path is set by the following code in clojure tools bash script:
`
Determine whether to use user or project cache
if [[ -f deps.edn ]]; then
cache_dir=.cpcache
else
cache_dir="$user_cache_dir"
fi
`
Which effectively makes impossible to run deps.edn project on write protected file system.
Current override is possible via renaming deps.edn and loading it via e.g. "-Sdeps $(cat xdeps.edn)",
with CLJ_CACHE env var, which in turn may create other chained problems, especially in quoting-sensitive environments like systemd.
Proposal: introduce optional environment variable for project cache destination like:
`
Determine whether to use user or project cache
if [[ -f deps.edn ]]; then
if [[ -n "$CLJ_PROJECT_CACHE" ]]; then
cache_dir="$CLJ_PROJECT_CACHE"
elif [[ -n "$XDG_PROJECT_CACHE" ]]; then
cache_dir="$XDG_PROJECT_CACHE"
else
cache_dir=.cpcache
fi
else
cache_dir="$user_cache_dir"
fi
`