1

resolve ZIG_LIB_DIR before passing it to zig

That way the zig's cache keys will be the same for all sandboxes.

Also see https://github.com/ziglang/zig/issues/13050#issuecomment-1268074032
This commit is contained in:
Motiejus Jakštys 2022-10-05 14:24:19 +03:00
parent c5e3c25015
commit 3a8c2eecfe

View File

@ -127,7 +127,7 @@ set -e
if [ -d external/zig_sdk/lib ]; then if [ -d external/zig_sdk/lib ]; then
ZIG_LIB_DIR=external/zig_sdk/lib ZIG_LIB_DIR=external/zig_sdk/lib
else else
ZIG_LIB_DIR="$(dirname "$0")/../../lib" ZIG_LIB_DIR="$(realpath "$(dirname "$0")/../../lib")"
fi fi
export ZIG_LIB_DIR export ZIG_LIB_DIR
export ZIG_LOCAL_CACHE_DIR="{cache_prefix}/bazel-zig-cc" export ZIG_LOCAL_CACHE_DIR="{cache_prefix}/bazel-zig-cc"
@ -141,7 +141,7 @@ set -e
if [ -d external/zig_sdk/lib ]; then if [ -d external/zig_sdk/lib ]; then
ZIG_LIB_DIR=external/zig_sdk/lib ZIG_LIB_DIR=external/zig_sdk/lib
else else
ZIG_LIB_DIR="$(dirname "$0")/../../lib" ZIG_LIB_DIR="$(realpath "$(dirname "$0")/../../lib")"
fi fi
if [ -n "$TMPDIR" ]; then if [ -n "$TMPDIR" ]; then
_cache_prefix=$TMPDIR _cache_prefix=$TMPDIR