1
Fork 0

update zig cache dir

nix
Motiejus Jakštys 2021-06-10 09:10:48 +03:00 committed by Motiejus Jakštys
parent 357c19df10
commit 921a8fd994
1 changed files with 10 additions and 1 deletions

View File

@ -101,7 +101,16 @@ def register_all_toolchains():
ZIG_TOOL_PATH = "tools/{zig_tool}"
ZIG_TOOL_WRAPPER = """#!/bin/bash
export HOME=${TMPDIR:-/tmp}
if [[ -n "$TMPDIR" ]]; then
cache_prefix=$TMPDIR
else
cache_prefix="$HOME/.cache"
if [[ "$(uname)" = Darwin ]]; then
cache_prefix="$HOME/Library/Caches"
fi
fi
export ZIG_LOCAL_CACHE_DIR="$cache_prefix/bazel-zig-cc"
export ZIG_GLOBAL_CACHE_DIR=$ZIG_LOCAL_CACHE_DIR
exec "{zig}" "{zig_tool}" "$@"
"""