Skip to content

Commit 5da1040

Browse files
committed
Fix codegen client parity checker
1 parent 4c36043 commit 5da1040

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

api/check_client_codegen_parity.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@ SPEC_FILE="$(basename "${SPEC_PATH}")"
2525

2626
TMP_PYTHON="$(mktemp -d "${TMPDIR:-/tmp}/torc-py-check.XXXXXX")"
2727
TMP_JULIA="$(mktemp -d "${TMPDIR:-/tmp}/torc-jl-check.XXXXXX")"
28-
trap 'rm -rf "${TMP_PYTHON}" "${TMP_JULIA}"' EXIT
28+
29+
# shellcheck disable=SC2329 # invoked indirectly via trap
30+
cleanup_tmp() {
31+
# Docker may create root-owned files that the CI runner cannot delete directly.
32+
# Use a container to remove them, then clean up the (now-empty) temp dirs.
33+
for d in "${TMP_PYTHON}" "${TMP_JULIA}"; do
34+
"${CONTAINER_EXEC}" run --rm -v "${d}":/tmp_clean alpine rm -rf /tmp_clean/* 2>/dev/null || true
35+
rm -rf "${d}" 2>/dev/null || true
36+
done
37+
}
38+
trap cleanup_tmp EXIT
2939

3040
docker_run() {
3141
case "${OSTYPE:-}" in

0 commit comments

Comments
 (0)