File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,17 @@ SPEC_FILE="$(basename "${SPEC_PATH}")"
2525
2626TMP_PYTHON=" $( mktemp -d " ${TMPDIR:-/ tmp} /torc-py-check.XXXXXX" ) "
2727TMP_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
3040docker_run () {
3141 case " ${OSTYPE:- } " in
You can’t perform that action at this time.
0 commit comments