From owner-svn-src-head@freebsd.org Tue Jul 25 00:12:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C3E2DAC28B; Tue, 25 Jul 2017 00:12:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2909A82492; Tue, 25 Jul 2017 00:12:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6P0CmXJ071728; Tue, 25 Jul 2017 00:12:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6P0Cm9b071727; Tue, 25 Jul 2017 00:12:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707250012.v6P0Cm9b071727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 25 Jul 2017 00:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321445 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jul 2017 00:12:49 -0000 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 + +cleandir: .WAIT cleanobj .if make(destroy*) && defined(OBJROOT) # this (rm -rf objdir) is much faster and more reliable than cleaning.