Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jul 2024 14:03:52 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        "freebsd-arch@freebsd.org" <arch@freebsd.org>
Subject:   Re: Default NO_CLEAN=yes in 15+
Message-ID:  <CANCZdfpip0q8ngfJDRaO0fcoM3%2BKQQMLY=CkYvwVVAY=6Lw9UA@mail.gmail.com>
In-Reply-To: <9bbb12ee-d5e0-4e9c-a832-bbfe5eea0ba6@FreeBSD.org>
References:  <9bbb12ee-d5e0-4e9c-a832-bbfe5eea0ba6@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000ddd003061defa9a1
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 23, 2024, 1:58=E2=80=AFPM John Baldwin <jhb@freebsd.org> wrote:

> The buildworld and buildkernel targets include a "clean" step before
> building
> objects dating back before my time to 'make world' (I haven't looked to s=
ee
> how far back it goes).  To permit incremental builds, this step can be
> skipped
> via NO_CLEAN=3Dyes.  This step is a bit unusual in build systems however.
> Most
> build systems have separate commands for building vs cleaning (e.g. 'make
> all'
> vs 'make clean') and over time FreeBSD's build system has gained dedicate=
d
> clean targets as well (cleanworld and cleankernel).  For myself, I always
> use NO_CLEAN=3Dyes when building worlds and kernels.  If I need a clean b=
uild
> I use the dedicated clean targets (e.g. cleanworld) first.  In particular=
,
> cleanworld/cleankernel are far more efficient since they use a single
> recursive 'rm' whereas the "clean" step involves a full tree walk with
> nested make invocations of the 'cleandir' target.
>
> A few years ago, Ed Maste added a MK_CLEAN option to src.opts.mk to as a
> WITH/WITHOUT knob for the "clean" step similar to NO_CLEAN=3Dyes.  To
> preserve
> existing behavior this knob currently defaults to on, but I know Ed's goa=
l
> was to eventually flip the default so that NO_CLEAN builds would be the
> default.  I would like us to do that starting in 15.
>
> Further off, I would suggest that we remove the "clean" step outright,
> perhaps in 16.x.  Regardless, we will need to update documentation to
> prefer the clean targets over WITH_CLEAN=3Dyes if our docs do not do this
> already.
>

+1

On the one condition that NO_CLEAN will be silently ignored after...

Warner

> --
> John Baldwin
>
>

--000000000000ddd003061defa9a1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Tue, Jul 23, 2024, 1:58=E2=80=AFPM John Baldwin &lt=
;<a href=3D"mailto:jhb@freebsd.org">jhb@freebsd.org</a>&gt; wrote:<br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex">The buildworld and buildkernel targets incl=
ude a &quot;clean&quot; step before building<br>
objects dating back before my time to &#39;make world&#39; (I haven&#39;t l=
ooked to see<br>
how far back it goes).=C2=A0 To permit incremental builds, this step can be=
 skipped<br>
via NO_CLEAN=3Dyes.=C2=A0 This step is a bit unusual in build systems howev=
er.=C2=A0 Most<br>
build systems have separate commands for building vs cleaning (e.g. &#39;ma=
ke all&#39;<br>
vs &#39;make clean&#39;) and over time FreeBSD&#39;s build system has gaine=
d dedicated<br>
clean targets as well (cleanworld and cleankernel).=C2=A0 For myself, I alw=
ays<br>
use NO_CLEAN=3Dyes when building worlds and kernels.=C2=A0 If I need a clea=
n build<br>
I use the dedicated clean targets (e.g. cleanworld) first.=C2=A0 In particu=
lar,<br>
cleanworld/cleankernel are far more efficient since they use a single<br>
recursive &#39;rm&#39; whereas the &quot;clean&quot; step involves a full t=
ree walk with<br>
nested make invocations of the &#39;cleandir&#39; target.<br>
<br>
A few years ago, Ed Maste added a MK_CLEAN option to <a href=3D"http://src.=
opts.mk" rel=3D"noreferrer noreferrer" target=3D"_blank">src.opts.mk</a> to=
 as a<br>
WITH/WITHOUT knob for the &quot;clean&quot; step similar to NO_CLEAN=3Dyes.=
=C2=A0 To preserve<br>
existing behavior this knob currently defaults to on, but I know Ed&#39;s g=
oal<br>
was to eventually flip the default so that NO_CLEAN builds would be the<br>
default.=C2=A0 I would like us to do that starting in 15.<br>
<br>
Further off, I would suggest that we remove the &quot;clean&quot; step outr=
ight,<br>
perhaps in 16.x.=C2=A0 Regardless, we will need to update documentation to<=
br>
prefer the clean targets over WITH_CLEAN=3Dyes if our docs do not do this<b=
r>
already.<br></blockquote></div></div><div dir=3D"auto"><br></div><div dir=
=3D"auto">+1</div><div dir=3D"auto"><br></div><div dir=3D"auto">On the one =
condition that NO_CLEAN will be silently ignored after...</div><div dir=3D"=
auto"><br></div><div dir=3D"auto">Warner</div><div dir=3D"auto"><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex">
-- <br>
John Baldwin<br>
<br>
</blockquote></div></div></div>

--000000000000ddd003061defa9a1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpip0q8ngfJDRaO0fcoM3%2BKQQMLY=CkYvwVVAY=6Lw9UA>