Skip to content

Commit

Permalink
Only attempt to find and remove files when directories exist. (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt authored Nov 11, 2024
1 parent e45fa7f commit f29c4b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ if [[ "${BUILDKITE_PLUGIN_JULIA_ISOLATED_DEPOT:-true}" == "true" ]]; then

# Clean out any stale pidfiles that may have come from a cancelled run,
# as it's not possible for another job to be running concurrently.
find "${JULIA_DEPOT_PATH}"/compiled -name '*.pidfile' -delete
if [[ -d "${JULIA_DEPOT_PATH}"/compiled ]]; then
find "${JULIA_DEPOT_PATH}"/compiled -name '*.pidfile' -delete
fi
fi

# Mark the depot as in-use by touching it
Expand Down
9 changes: 6 additions & 3 deletions hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ echo "--- :broom: Performing clean-up"
echo "Removing coverage files"

# Once JuliaLang/julia#26573 has been fixed, this should no longer be necessary.
find "${CACHE_DIR}"/julia_installs -name "*.jl.*.cov" -type f -delete || true
if [[ -d "${CACHE_DIR}"/julia_installs ]]; then
find "${CACHE_DIR}"/julia_installs -name "*.jl.*.cov" -type f -delete
fi

# Some packages check coverage files in, so only remove writable ones
if [[ "${BUILDKITE_PLUGIN_JULIA_ISOLATED_DEPOT:-true}" == "true" ]]; then
find "${JULIA_DEPOT_PATH}"/packages -name "*.jl.*.cov" -type f -perm -200 -delete || true
if [[ "${BUILDKITE_PLUGIN_JULIA_ISOLATED_DEPOT:-true}" == "true" && \
-d "${JULIA_DEPOT_PATH}"/packages ]]; then
find "${JULIA_DEPOT_PATH}"/packages -name "*.jl.*.cov" -type f -perm -200 -delete
fi


Expand Down

0 comments on commit f29c4b0

Please sign in to comment.