svn commit: r321445 - head/share/mk
Bryan Drewery
bdrewery at FreeBSD.org
Tue Jul 25 00:12:49 UTC 2017
Author: bdrewery
Date: Tue Jul 25 00:12:48 2017
New Revision: 321445
URL: https://svnweb.freebsd.org/changeset/base/321445
Log:
cleandir: Fix ESTALE errors from parallel removals.
This fixes 'make cleandir' to use the same ordering as 'make cleanobj'.
Meaning that SUBDIR will be recursed before the current directory is
handled. This avoids an 'rm -rf /usr/obj/usr/src/lib/libc' while
a child 'rm -rf /usr/obj/usr/src/lib/libc/tests' is being ran next,
or even removing the current directory and then recursing into a child
and using the 'missing OBJDIR' logic to remove files rather than the
directory.
The most ideal ordering here would be for 'cleanobj' and 'cleandir' to
simply remove the .OBJDIR and then not recurse at all. This is only
safe if it is guaranteed that all children directories have no orphaned
files in their source checkout and are only using obj directories. This
is usually safe from the top-level build targets and when using
WITH_AUTO_OBJ. Improving the build for those cases is coming.
Reported by: cperciva, scottl
X-MFC-With: r321427
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Modified:
head/share/mk/bsd.obj.mk
Modified: head/share/mk/bsd.obj.mk
==============================================================================
--- head/share/mk/bsd.obj.mk Mon Jul 24 23:57:43 2017 (r321444)
+++ head/share/mk/bsd.obj.mk Tue Jul 25 00:12:48 2017 (r321445)
@@ -183,9 +183,9 @@ clean:
.endif
.ORDER: clean all
-cleandir: cleanobj
-
.include <bsd.subdir.mk>
+
+cleandir: .WAIT cleanobj
.if make(destroy*) && defined(OBJROOT)
# this (rm -rf objdir) is much faster and more reliable than cleaning.
More information about the svn-src-all
mailing list