Skip to content

Commit b2a3ce5

Browse files
committed
Clean $WORK_DIR/TMP on aliBuild clean (#305)
$WORK_DIR/TMP is simply a temporary place where we unpack things before atomically moving them in place. It should always be empty at the end of a job unless unpacking fails so it's safe to always delete it when we invoke aliBuild clean.
1 parent d2c13d0 commit b2a3ce5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

aliBuild

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,11 @@ def doMain():
480480
# Schedule a directory for deletion if it does not have a symlink
481481
# Delete scheduled directories
482482
symlinksBuild = [readlink(x) for x in glob("%s/BUILD/*-latest*" % args.workDir)]
483-
toDelete = [x for x in glob("%s/BUILD/*" % args.workDir)
484-
if not islink(x) and not basename(x) in symlinksBuild]
483+
# $WORK_DIR/TMP should always be cleaned up. This does not happen only
484+
# in the case we run out of space while unpacking.
485+
toDelete = ["%s/TMP" % args.workDir]
486+
toDelete += [x for x in glob("%s/BUILD/*" % args.workDir)
487+
if not islink(x) and not basename(x) in symlinksBuild]
485488
installGlob ="%s/%s/*/" % (args.workDir, args.architecture)
486489
symlinksInstall = [readlink(x) for x in glob(installGlob + "latest*")]
487490
toDelete += [x for x in glob(installGlob+ "*")

0 commit comments

Comments
 (0)