Bug 282096 - Makefile.inc1 never sets MK_CLEAN to "yes"
Summary: Makefile.inc1 never sets MK_CLEAN to "yes"
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-15 03:00 UTC by Don Lewis
Modified: 2024-10-17 02:57 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Don Lewis freebsd_committer freebsd_triage 2024-10-15 03:00:26 UTC
Makefile.inc1 sets MK_CLEAN to "no" under certain conditions when the clean step should be skipped, but it never sets MK_CLEAN to "yes".  This causes the clean step to be skipped when it really should be executed.

This seems to have been broken for >4 years, since git:75766799863334570acf7a65510361f470ce3b3e.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2024-10-16 00:39:47 UTC
MK_CLEAN is set by share/mk/src.opts.mk and src.conf(5), and recently switched to avoid doing clean builds by default. See the 20240729 entry in UPDATING:

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.
Comment 2 Don Lewis freebsd_committer freebsd_triage 2024-10-16 04:25:28 UTC
OK, the make magic is why grepping the source tree didn't find MK_CLEAN getting set.  Caution, contents under pressure, no user serviceable parts inside.

The command line options section in Makefile.inc1 needs to be updated for the behavior change.

I'm still puzzled why make -V doesn't show MK_CLEAN getting set:

# pwd
/usr/src
# make -V MK_CLEAN

# make -D WITH_CLEAN -V MK_CLEAN buildworld

# make -D CLEAN -V MK_CLEAN buildworld

#
Comment 3 Don Lewis freebsd_committer freebsd_triage 2024-10-16 09:44:58 UTC
I think -V isn't working because it isn't getting passed down into the sub-make that handles Makefile.inc1.  In that case, I don't see how KERNCONF=blah on the command line gets passed down, either.
Comment 4 Ed Maste freebsd_committer freebsd_triage 2024-10-16 12:52:36 UTC
(In reply to Don Lewis from comment #3)
I don't recall the exact details, but -V not working is indeed due to that kind of issue. You can use `make showconfig` to show all of the MK_* settings though, and looking at that target ought to provide some insight on the -V issue.