c++: fall back to cache dir in /tmp
rules_go is making calls that do `env - <...>` and are setting neither TMPDIR nor HOME. So we should always fallback somewhere.
This commit is contained in:
parent
aaa50aad6d
commit
db7beefbe4
@ -81,11 +81,14 @@ set -e
|
|||||||
|
|
||||||
if [[ -n "$TMPDIR" ]]; then
|
if [[ -n "$TMPDIR" ]]; then
|
||||||
_cache_prefix=$TMPDIR
|
_cache_prefix=$TMPDIR
|
||||||
else
|
elif [[ -n "$HOME" ]]; then
|
||||||
_cache_prefix="$HOME/.cache"
|
|
||||||
if [[ "$(uname)" = Darwin ]]; then
|
if [[ "$(uname)" = Darwin ]]; then
|
||||||
_cache_prefix="$HOME/Library/Caches"
|
_cache_prefix="$HOME/Library/Caches"
|
||||||
|
else
|
||||||
|
_cache_prefix="$HOME/.cache"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
_cache_prefix=/tmp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export ZIG_LOCAL_CACHE_DIR="$_cache_prefix/bazel-zig-cc"
|
export ZIG_LOCAL_CACHE_DIR="$_cache_prefix/bazel-zig-cc"
|
||||||
|
Loading…
Reference in New Issue
Block a user