1

all commands: use /tmp/bazel-zig-cc (#6)

Different Bazel instances can share the zig cache all right.
This commit is contained in:
Motiejus Jakštys
2023-03-08 17:33:59 +02:00
committed by GitHub
parent f239f467a0
commit 3a204583f3
6 changed files with 10 additions and 29 deletions

View File

@@ -7,7 +7,6 @@ set -euo pipefail
cd "$(git rev-parse --show-toplevel)"
if command -v shellcheck &> /dev/null; then
mapfile -t files < \
<(git ls-files)

View File

@@ -5,22 +5,26 @@
set -xeuo pipefail
cache_prefix="${BAZEL_ZIG_CC_CACHE_PREFIX:-/tmp/bazel-zig-cc}"
# check a very hermetic setup with a single target. Re-building all of
# them takes a long time, so using only one. If we ever decide to build all
# targets, we will need to exclude Go, since go dynamically links to glibc on
# linux.
echo "--- build a single target with very hermetic sandbox"
tools/bazel build "$@" \
--experimental_use_hermetic_linux_sandbox \
--sandbox_writable_path="$cache_prefix" \
--sandbox_add_mount_pair=/proc \
//test/c:which_libc_linux_amd64_gnu.2.19
# then test everything else with the standard sandbox
echo "--- bazel test $@ ..."
echo "--- bazel test $* ..."
tools/bazel test "$@" ...
echo "--- ensure github.com/ziglang/zig/issues/13050 does not regress"
find "${BAZEL_ZIG_CC_CACHE_PREFIX:-/tmp/bazel-zig-cc}" \
find "$cache_prefix" \
-name mutex_destructor.o -execdir file '{}' \; \
| sort \
| uniq -c \