Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jul 2024 20:08:17 +0000
From:      Shawn Webb <shawn.webb@hardenedbsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        arch@freebsd.org
Subject:   Re: Default NO_CLEAN=yes in 15+
Message-ID:  <ia2xwmohoomnica7vp7hotd7sknovyyb3hgkfrx6blekbx6qdn@aax3blyqxcer>
In-Reply-To: <9bbb12ee-d5e0-4e9c-a832-bbfe5eea0ba6@FreeBSD.org>
References:  <9bbb12ee-d5e0-4e9c-a832-bbfe5eea0ba6@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Tue, Jul 23, 2024 at 03:58:13PM -0400, John Baldwin 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 see
> how far back it goes).  To permit incremental builds, this step can be skipped
> via NO_CLEAN=yes.  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 dedicated
> clean targets as well (cleanworld and cleankernel).  For myself, I always
> use NO_CLEAN=yes when building worlds and kernels.  If I need a clean build
> 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=yes.  To preserve
> existing behavior this knob currently defaults to on, but I know Ed's goal
> 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.

It would make sense to me to default MK_CLEAN=no in release branches.
Perhaps stable branches, too. While I don't hold a strong opinion on
the matter, I would prefer MK_CLEAN=yes to remain the default on the
main branch.

I can't give tangible examples, but I remember running into weird
issues occasionally when using `make buildworld WITHOUT_CLEAN=yes` in
main. I probably should do a better job at documenting those
(infrequent) issues when they arise.

> 
> 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=yes if our docs do not do this
> already.

I would not be in favor of removing the clean step. Removing clean
outright seems like a step too far--a potential POLA violation, even.
Please keep clean in.

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50
https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmagDaoACgkQ/y5nonf4
4fpSTw/+I+BcOPG8wEGk66ZKseJegDAW81kIzty1PWr20sWUowpJUe7v6Zsui9nq
H2gToYVsRDm//MSPjwvKg0XdS2R3+vG/ifHm0+640kJ+RF7hMcGLQi2MgRYw57tf
RQ8dfuzO1cA/cQ5dKmuniE+pxgmcMFl+cpzx5ZfvqZcOMJ0SdIDV+AldpPqIx+g5
NK/pPxZ/wPvuteF3EBlKilYnYxjwkKmT2yKS0WzmwDvScgHHNdbLCI4A+P6wyeBQ
DG7BuMuW0KxWwkaG+pciM7DByOMvhkWfM8/kHmEX7DSwuWRdZWXFBrtutyZuk8s/
OapVvvwxiUYUBlDLQElxjgHd3xgQK9aqwVD5+ej+WIsIXzanef0KzgCGiWsoKv2l
1jr8e/piDNanH8uL96qw7NgZXLaCi7uBTcpySRHUUVVuNqXkUL0C9GnXG2L/GzEG
LDJm68cFHkZa1VdnssBOtmTy7nRDE3IpZ/5NmxbewxmsmpE+g7LMSym6ChpRp+D+
FdBSPizOgeskXvXjCg6m2U8kGsOmsYQ5jaZkamWTNtoGPcxjOUOOeeFWUvhgMctc
zNfS/M3G5rDY3vNgOOs+MWEJqrfYFQAUhCGKPZDWkcYemjlGANBngHLmVokb04/s
s4F2BTVZcuK1fggrvDMyU2O4M9SyYQKWI89+2FsMohO7v1jx+b8=
=LfS3
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ia2xwmohoomnica7vp7hotd7sknovyyb3hgkfrx6blekbx6qdn>