Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")"

# Keep the compiler caches out of ~/.cache/zig and out of the source tree. The path is stable so
# rebuilds stay warm; point PERRY_ZIG_CACHE_DIR elsewhere for a cold build.
tmp_root="${TMPDIR:-/tmp}"
zig_cache="${PERRY_ZIG_CACHE_DIR:-${tmp_root%/}/perry-zig-cache}"
export ZIG_GLOBAL_CACHE_DIR="$zig_cache/global"
export ZIG_LOCAL_CACHE_DIR="$zig_cache/json_pipeline"

mkdir -p zig-out/bin
zig build-exe src/main.zig \
-O ReleaseFast \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
# script against the host target, which has the same version mismatch.
set -euo pipefail
cd "$(dirname "$0")"

# Keep the compiler caches out of ~/.cache/zig and out of the source tree. The path is stable so
# rebuilds stay warm; point PERRY_ZIG_CACHE_DIR elsewhere for a cold build.
tmp_root="${TMPDIR:-/tmp}"
zig_cache="${PERRY_ZIG_CACHE_DIR:-${tmp_root%/}/perry-zig-cache}"
export ZIG_GLOBAL_CACHE_DIR="$zig_cache/global"
export ZIG_LOCAL_CACHE_DIR="$zig_cache/image_conv"

mkdir -p zig-out/bin
zig build-exe src/main.zig \
-O ReleaseFast \
Expand Down
1 change: 1 addition & 0 deletions changelog.d/7160-zig-cache-isolation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed the two Zig benchmark build scripts (`benchmarks/honest_bench/workloads/1_json_pipeline/zig/build.sh` and `.../3_image_convolution/zig/build.sh`) writing into the developer's home directory. `zig build-exe` ran with no cache override, so every build populated Zig's global cache under the user's home directory and dropped a `.zig-cache` directory into the workload source tree. Both scripts now export `ZIG_GLOBAL_CACHE_DIR` and `ZIG_LOCAL_CACHE_DIR` under the OS temp dir, with the two workloads using separate local-cache subdirectories. The path is stable rather than per-run so rebuilds stay warm without re-fetching the compiler-rt closure; `PERRY_ZIG_CACHE_DIR` relocates it for a cold build. Beyond hygiene this is a reproducibility fix: a build that reads and writes a home-directory cache can pass on a warm machine and fail on a cold one.
Loading