Re: FYI: Why META_MODE rebuilds so much for building again after installworld (no source changes)

From: Mark Millard <marklmi_at_yahoo.com>
Date: Fri, 24 Feb 2023 00:41:34 UTC
On Feb 23, 2023, at 14:03, Simon J. Gerraty <sjg@juniper.net> wrote:

Simplifying context . . .
. . .
> As I mentioned previously, there is no variablity of OBJTOP within the
> context of a single make instance - at least not once it starts running
> targets.
> 
>> . . .
> 
> .MAKE.META.IGNORE_PATHS += ${OBJTOP}/tmp/legacy/usr

I'll use that definition line for the below.

> should result in nothing under ${OBJTOP}/tmp/legacy/usr causing a target
> to be out of date - just because it is newer.

I'll ignore there that that is skipping too much
and just show what happens for the 2nd buildkernel
of 2 in a row when I use that exact line for both
make runs.

First counts of the "is newer than" lines, counting
separate program names separately:

# cat /usr/obj/BUILDs/main-amd64-nodbg-clang/sys-typescripts/typescript-make-amd64-nodbg-clang-amd64-host-2023-02-23:16:15:18 | grep "is newer than the target" | sed -
e "s@^.*: file '@file '@" | sort | uniq -c | sort -rn | more
2553 file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/realpath' is newer than the target...
1001 file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/ln' is newer than the target...

Thousands of rebuilt things based on:

. . ./tmp/legacy/usr/sbin/realpath
. . ./tmp/legacy/usr/sbin/ln

It appears that buildkernel does not use an OBJTOP definition
that references:

/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64

in my context.

For reference of Build lines paired with a few of those "is newer
than" lines:

First realpath:

# grep -A1 "tmp/legacy/usr/sbin/realpath\>" /usr/obj/BUILDs/main-amd64-nodbg-clang/sys-typescripts/typescript-make-amd64-nodbg-clang-amd64-host-2023-02-23:16:15:18 | more
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/machine.meta: 23: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/realpath' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/machine
--
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/x86.meta: 23: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/realpath' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/x86
--
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/i386.meta: 23: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/realpath' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/i386
--
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aacraid/machine.meta: 23: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/realpath' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aacraid/machine
--
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aacraid/x86.meta: 23: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/realpath' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aacraid/x86
--
. . .

Then for ln:

# grep -A1 "tmp/legacy/usr/sbin/ln\>" /usr/obj/BUILDs/main-amd64-nodbg-clang/sys-typescripts/typescript-make-amd64-nodbg-clang-amd64-host-2023-02-23:16:15:18 | more
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/opt_scsi.h.meta: 12: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/ln' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/opt_scsi.h
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/opt_cam.h.meta: 12: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/ln' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/opt_cam.h
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/opt_aac.h.meta: 12: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/ln' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aac/opt_aac.h
--
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aacraid/opt_scsi.h.meta: 12: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/ln' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aacraid/opt_scsi.h
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aacraid/opt_cam.h.meta: 12: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/ln' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aacraid/opt_cam.h
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aacraid/opt_aacraid.h.meta: 12: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/ln' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/aacraid/opt_aacraid.h
--
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/acpi/acpi_asus/opt_acpi.h.meta: 12: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/ln' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/acpi/acpi_asus/opt_acpi.h
/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/acpi/acpi_asus/opt_ddb.h.meta: 12: file '/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/ln' is newer than the target...
Building /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG/modules/usr/main-src/sys/modules/acpi/acpi_asus/opt_ddb.h
--
. . .

I've still no clue of a notation that avoids this for
my choice to use personal MAKEOBJDIRPREFIX paths:

amd64 context:

# grep MAKEOBJDIRPREFIX make-*.sh
make-13S-amd64-dbg-clang.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13S-amd64-dbg-clang" \
make-13S-amd64-dbg-gccxtc.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13S-amd64-dbg-gccxtc" \
make-13S-amd64-nodbg-clang.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13S-amd64-nodbg-clang" \
make-13S-amd64-nodbg-gccxtc.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13S-amd64-nodbg-gccxtc" \
make-13_0R-amd64-dbg-clang.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_0R-amd64-dbg-clang" \
make-13_0R-amd64-nodbg-clang.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_0R-amd64-nodbg-clang" \
make-13_1R-amd64-dbg-clang.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_1R-amd64-dbg-clang" \
make-13_1R-amd64-dbg-gccxtc.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_1R-amd64-dbg-gccxtc" \
make-13_1R-amd64-nodbg-clang.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_1R-amd64-nodbg-clang" \
make-13_1R-amd64-nodbg-gccxtc.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_1R-amd64-nodbg-gccxtc" \
make-alt-main-amd64-nodbg-clang-alt.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-amd64-nodbg-clang-alt" \
make-main-amd64-dbg-clang.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-amd64-dbg-clang" \
make-main-amd64-dbg-gccxtc.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-amd64-dbg-gccxtc" \
make-main-amd64-nodbg-clang-alt.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-amd64-nodbg-clang-alt" \
make-main-amd64-nodbg-clang.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-amd64-nodbg-clang" \
make-main-amd64-nodbg-gccxtc.amd64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-amd64-nodbg-gccxtc" \

aarch64 context (and armv7):

# grep MAKEOBJDIRPREFIX make-*.sh
make-13S-CA53-dbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13S-CA53-dbg-clang" \
make-13S-CA53-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13S-CA53-nodbg-clang" \
make-13S-CA7-dbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13S-CA7-dbg-clang" \
make-13S-CA7-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13S-CA7-nodbg-clang" \
make-13S-CA72-dbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13S-CA72-dbg-clang" \
make-13S-CA72-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13S-CA72-nodbg-clang" \
make-13_0R-CA53-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_0R-CA53-nodbg-clang" \
make-13_0R-CA7-nodbg-clang-alt.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_0R-CA7-nodbg-clang-alt" \
make-13_0R-CA7-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_0R-CA7-nodbg-clang" \
make-13_0R-CA72-dbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_0R-CA72-dbg-clang" \
make-13_0R-CA72-nodbg-clang-alt.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_0R-CA72-nodbg-clang-alt" \
make-13_0R-CA72-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_0R-CA72-nodbg-clang" \
make-13_1R-CA53-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_1R-CA53-nodbg-clang" \
make-13_1R-CA7-nodbg-clang-alt.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_1R-CA7-nodbg-clang-alt" \
make-13_1R-CA7-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_1R-CA7-nodbg-clang" \
make-13_1R-CA72-dbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_1R-CA72-dbg-clang" \
make-13_1R-CA72-nodbg-clang-alt.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_1R-CA72-nodbg-clang-alt" \
make-13_1R-CA72-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/13_1R-CA72-nodbg-clang" \
make-alt-main-CA7-nodbg-clang-alt.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA7-nodbg-clang-alt" \
make-main-CA53-dbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA53-dbg-clang" \
make-main-CA53-nodbg-clang-alt.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA53-nodbg-clang-alt" \
make-main-CA53-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA53-nodbg-clang" \
make-main-CA7-dbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA7-dbg-clang" \
make-main-CA7-nodbg-clang-alt.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA7-nodbg-clang-alt" \
make-main-CA7-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA7-nodbg-clang" \
make-main-CA72-dbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA72-dbg-clang" \
make-main-CA72-dbg-gccxtc.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA72-dbg-gccxtc" \
make-main-CA72-nodbg-clang-alt.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA72-nodbg-clang-alt" \
make-main-CA72-nodbg-clang.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA72-nodbg-clang" \
make-main-CA72-nodbg-gccxtc.aarch64-host.sh:MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-CA72-nodbg-gccxtc" \


===
Mark Millard
marklmi at yahoo.com