all commands: use /tmp/bazel-zig-cc (#6)
Different Bazel instances can share the zig cache all right.
This commit is contained in:
parent
f239f467a0
commit
3a204583f3
2
.bazelrc
2
.bazelrc
@ -7,5 +7,3 @@ build --worker_sandboxing
|
|||||||
build --experimental_reuse_sandbox_directories
|
build --experimental_reuse_sandbox_directories
|
||||||
build --incompatible_enable_cc_toolchain_resolution
|
build --incompatible_enable_cc_toolchain_resolution
|
||||||
build --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
|
build --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
|
||||||
|
|
||||||
try-import %workspace%/.custom.ci.bazelrc
|
|
||||||
|
@ -3,15 +3,11 @@
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- label: "Test"
|
- label: "Test"
|
||||||
command: |
|
command: ci/test
|
||||||
. .buildkite/setup-bazelrc.sh
|
|
||||||
ci/test
|
|
||||||
- label: "Lint"
|
- label: "Lint"
|
||||||
command: |
|
command: ci/lint
|
||||||
. .buildkite/setup-bazelrc.sh
|
|
||||||
ci/lint
|
|
||||||
- label: "List Platforms"
|
- label: "List Platforms"
|
||||||
command: "ci/list_toolchains_platforms"
|
command: ci/list_toolchains_platforms
|
||||||
- label: "Test Release and Launcher scripts"
|
- label: "Test Release and Launcher scripts"
|
||||||
command: |
|
command: |
|
||||||
git config --global user.email "buildkite@example.com"
|
git config --global user.email "buildkite@example.com"
|
||||||
@ -31,7 +27,6 @@ steps:
|
|||||||
ci/launcher-wine64
|
ci/launcher-wine64
|
||||||
- label: "mod-tidy and update-repos"
|
- label: "mod-tidy and update-repos"
|
||||||
command: |
|
command: |
|
||||||
. .buildkite/setup-bazelrc.sh
|
|
||||||
bin/mod-tidy
|
bin/mod-tidy
|
||||||
git diff --exit-code
|
git diff --exit-code
|
||||||
agents:
|
agents:
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
# Copyright 2023 Uber Technologies, Inc.
|
|
||||||
# Licensed under the Apache License, Version 2.0
|
|
||||||
|
|
||||||
if [ -z "${BUILDKITE_BUILD_NUMBER:-}" ]; then
|
|
||||||
>&2 echo "error: expected to run in buildkite"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
export BAZEL_ZIG_CC_CACHE_PREFIX="/tmp/bazel-zig-cc${BUILDKITE_BUILD_NUMBER}"
|
|
||||||
mkdir -p "$BAZEL_ZIG_CC_CACHE_PREFIX"
|
|
||||||
|
|
||||||
cat > .custom.ci.bazelrc <<EOF
|
|
||||||
common --repo_env BAZEL_ZIG_CC_CACHE_PREFIX="$BAZEL_ZIG_CC_CACHE_PREFIX"
|
|
||||||
build --sandbox_writable_path "$BAZEL_ZIG_CC_CACHE_PREFIX"
|
|
||||||
EOF
|
|
@ -4,7 +4,7 @@
|
|||||||
# Licensed under the Apache License, Version 2.0
|
# Licensed under the Apache License, Version 2.0
|
||||||
set -xeu
|
set -xeu
|
||||||
|
|
||||||
cd "$(git rev-parse --show-toplevel)/"
|
cd "$(git rev-parse --show-toplevel)"
|
||||||
echo "--- go mod tidy"
|
echo "--- go mod tidy"
|
||||||
tools/bazel run @go_sdk//:bin/go -- mod tidy
|
tools/bazel run @go_sdk//:bin/go -- mod tidy
|
||||||
|
|
||||||
|
1
ci/lint
1
ci/lint
@ -7,7 +7,6 @@ set -euo pipefail
|
|||||||
|
|
||||||
cd "$(git rev-parse --show-toplevel)"
|
cd "$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
|
|
||||||
if command -v shellcheck &> /dev/null; then
|
if command -v shellcheck &> /dev/null; then
|
||||||
mapfile -t files < \
|
mapfile -t files < \
|
||||||
<(git ls-files)
|
<(git ls-files)
|
||||||
|
8
ci/test
8
ci/test
@ -5,22 +5,26 @@
|
|||||||
|
|
||||||
set -xeuo pipefail
|
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
|
# 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
|
# 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
|
# targets, we will need to exclude Go, since go dynamically links to glibc on
|
||||||
# linux.
|
# linux.
|
||||||
|
|
||||||
echo "--- build a single target with very hermetic sandbox"
|
echo "--- build a single target with very hermetic sandbox"
|
||||||
tools/bazel build "$@" \
|
tools/bazel build "$@" \
|
||||||
--experimental_use_hermetic_linux_sandbox \
|
--experimental_use_hermetic_linux_sandbox \
|
||||||
|
--sandbox_writable_path="$cache_prefix" \
|
||||||
--sandbox_add_mount_pair=/proc \
|
--sandbox_add_mount_pair=/proc \
|
||||||
//test/c:which_libc_linux_amd64_gnu.2.19
|
//test/c:which_libc_linux_amd64_gnu.2.19
|
||||||
|
|
||||||
# then test everything else with the standard sandbox
|
# then test everything else with the standard sandbox
|
||||||
echo "--- bazel test $@ ..."
|
echo "--- bazel test $* ..."
|
||||||
tools/bazel test "$@" ...
|
tools/bazel test "$@" ...
|
||||||
|
|
||||||
echo "--- ensure github.com/ziglang/zig/issues/13050 does not regress"
|
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 '{}' \; \
|
-name mutex_destructor.o -execdir file '{}' \; \
|
||||||
| sort \
|
| sort \
|
||||||
| uniq -c \
|
| uniq -c \
|
||||||
|
Loading…
Reference in New Issue
Block a user