git: ba373fca78a1 - main - Do not clean (in buildworld/buildkernel) by default

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 29 Jul 2024 17:17:37 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=ba373fca78a114768244d6a8c27983da870c1169

commit ba373fca78a114768244d6a8c27983da870c1169
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-07-29 00:00:00 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-07-29 17:16:52 +0000

    Do not clean (in buildworld/buildkernel) by default
    
    As discussed on the freebsd-arch mailing list[1].  For historical
    reasons FreeBSD's buildworld and buildkernel targets started by cleaning
    the object tree, for traditional (non-metamode) builds.
    
    Cleaning is not necessary when dependencies are properly tracked, and we
    have a somewhat kludgey script[2] to handle some known cases where deps
    were mishandled by traditional builds.  Be consistent with the vast
    majority of open source build systems by default, and do not clean at
    the beginning of buildworld or buildkernel.
    
    Users may set WITH_CLEAN in src.conf(5) to restore the previous
    behaviour, or run `make cleanworld` and/or `make cleankernel` before
    starting a build.
    
    [1] https://lists.freebsd.org/archives/freebsd-arch/2024-July/000727.html
    [2] tools/build/depend-cleanup.sh
    
    Reviewed by:    jhb, imp
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D46172
---
 UPDATING                       | 10 ++++++++++
 share/man/man5/src.conf.5      |  6 +++---
 share/mk/src.opts.mk           |  2 +-
 tools/build/options/WITH_CLEAN |  1 +
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/UPDATING b/UPDATING
index fc3abb285039..cffafdb5d247 100644
--- a/UPDATING
+++ b/UPDATING
@@ -27,6 +27,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW:
 	world, or to merely disable the most expensive debugging functionality
 	at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20240729:
+	The build now defaults to WITHOUT_CLEAN - i.e., no automatic clean
+	is performed at the beginning of buildworld or buildkernel.  The
+	WITH_CLEAN src.conf(5) knob can be used to restore the previous
+	behaviour.
+
+	If you encounter incremental build issues, please report them to the
+	freebsd-current mailing list so that a special-case dependency can be
+	added, if necessary.
+
 20240712:
 	Support for armv6 has been disconnected and is being removed.
 
diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index 1d35823fc9c4..a12a2a8cb9f4 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,5 +1,5 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
-.Dd May 22, 2024
+.Dd July 29, 2024
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -383,8 +383,8 @@ Build clang-format.
 .It Va WITHOUT_CLANG_FULL
 Avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of
 the Clang C/C++ compiler.
-.It Va WITHOUT_CLEAN
-Do not clean before building world and/or kernel.
+.It Va WITH_CLEAN
+Clean before building world and/or kernel.
 .It Va WITHOUT_CPP
 Do not build
 .Xr cpp 1 .
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index 501df88cd776..d7e246d10396 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -80,7 +80,6 @@ __DEFAULT_YES_OPTIONS = \
     CDDL \
     CLANG \
     CLANG_BOOTSTRAP \
-    CLEAN \
     CPP \
     CROSS_COMPILER \
     CRYPT \
@@ -195,6 +194,7 @@ __DEFAULT_NO_OPTIONS = \
     BHYVE_SNAPSHOT \
     CLANG_EXTRAS \
     CLANG_FORMAT \
+    CLEAN \
     DIALOG \
     DETECT_TZ_CHANGES \
     DISK_IMAGE_TOOLS_BOOTSTRAP \
diff --git a/tools/build/options/WITH_CLEAN b/tools/build/options/WITH_CLEAN
new file mode 100644
index 000000000000..d5962258bcc0
--- /dev/null
+++ b/tools/build/options/WITH_CLEAN
@@ -0,0 +1 @@
+Clean before building world and/or kernel.