Skip to content

Commit

Permalink
Update env.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Aug 14, 2024
1 parent bf945f6 commit 3ea71a9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .buildkite/scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,17 @@ function export_environment() {
export USE_DEBUG_JSC="OFF"
fi
if { [ "$BUILDKITE_CLEAN_CHECKOUT" == "true" ] || [ "$BUILDKITE_BRANCH" == "main" ]; }; then
# Attempt to delete the old directory
rm -rf "$CCACHE_DIR" "$SCCACHE_DIR" "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" "$BUN_DEPS_CACHE_DIR"
tempdir_to_use=$(mktemp -d 2>/dev/null || mktemp -d -t 'new')
CCACHE_DIR="$(tempdir_to_use)/ccache"
SCCACHE_DIR="$(tempdir_to_use)/sccache"
ZIG_LOCAL_CACHE_DIR="$(tempdir_to_use)/zig-local"
ZIG_GLOBAL_CACHE_DIR="$(tempdir_to_use)/zig-global"
BUN_DEPS_CACHE_DIR="$(tempdir_to_use)/bun-deps"
# Make sure to use a new temporary directory
local tempdir_to_use=$(mktemp -d 2>/dev/null || mktemp -d -t 'new')

CCACHE_DIR="$tempdir_to_use/ccache"
SCCACHE_DIR="$tempdir_to_use/sccache"
ZIG_LOCAL_CACHE_DIR="$tempdir_to_use/zig-local"
ZIG_GLOBAL_CACHE_DIR="$tempdir_to_use/zig-global"
BUN_DEPS_CACHE_DIR="$tempdir_to_use/bun-deps"

mkdir -p "$BUN_DEPS_CACHE_DIR $CCACHE_DIR $SCCACHE_DIR $ZIG_LOCAL_CACHE_DIR $ZIG_GLOBAL_CACHE_DIR"
export CCACHE_RECACHE="1"
fi
Expand Down

0 comments on commit 3ea71a9

Please sign in to comment.