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

From: Mark Millard <marklmi_at_yahoo.com>
Date: Thu, 23 Feb 2023 07:10:49 UTC
On Feb 22, 2023, at 22:43, Simon J. Gerraty <sjg@juniper.net> wrote:

> Mark Millard <marklmi@yahoo.com> wrote:
>> It appears that for symbolic links being the target, META_MODE does
>> not respect .MAKE.META.IGNORE_PATHS .
> 
> The handling of links is rather complicated ;-)
> Among other things, the src needs to be treated as for a Read and the
> target as for Write 
> 
> Note that .MAKE.META.IGNORE_PATHS is only applied to absolute paths
> .MAKE.META.IGNORE_PATTERNS and .MAKE.META.IGNORE_FILTER can be used to
> apply more generally.

All paths that I'm adding are absolute paths.

For reference (my additions are after the normal
ones, I use -dV here to show what is based on
other substitutions vs. not):

# ~/sys-build-scripts.amd64-host/make-main-amd64-nodbg-clang.amd64-host.sh -dV -V.MAKE.META.IGNORE_PATHS buildworld buildkernel
Script started, output file is /usr/obj/BUILDs/main-amd64-nodbg-clang/sys-typescripts/typescript-make-amd64-nodbg-clang-amd64-host-2023-02-22:23:06:28
${__MAKE_SHELL}  /bin  /lib  /rescue  /sbin  /usr/bin  /usr/lib  /usr/sbin  /usr/share /usr/include /usr/local/etc/libmap.d /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/awk /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/cap_mkdb /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/cat /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/cp /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/crunchgen /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/crunchide /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/dd /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/egrep /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/env /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/file2c /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/gencat /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/grep /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/gzip /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/jot /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/lex /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/lb /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/ln /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/m4 /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/mkcsmapper /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/mktemp /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/mv /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/patch /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/realpath /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/rm /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/sed /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/sh /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/touch /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/truncate /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/uudecode /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/uuencode /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/legacy/usr/sbin/xargs /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/bin/ctfconvert /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/bin/objcopy /usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/bin/nm

Script done, output file is /usr/obj/BUILDs/main-amd64-nodbg-clang/sys-typescripts/typescript-make-amd64-nodbg-clang-amd64-host-2023-02-22:23:06:28

The contribution to the list is currently generated via
use of:

.if ${.MAKE.LEVEL} == 0
.for ignore_legacy_tool in awk cap_mkdb cat cp crunchgen crunchide dd egrep env file2c gencat grep gzip jot lex lb ln m4 mkcsmapper mktemp mv patch realpath rm sed sh touch truncate uudecode uuencode xargs
.MAKE.META.IGNORE_PATHS+= ${MAKEOBJDIR}/tmp/legacy/usr/sbin/${ignore_legacy_tool}
.endfor
.for ignore_other_tool in ctfconvert objcopy nm
.MAKE.META.IGNORE_PATHS+= ${MAKEOBJDIR}/tmp/usr/bin/${ignore_other_tool}
.endfor
.MAKE.META.IGNORE_PATHS:= ${.MAKE.META.IGNORE_PATHS}
.endif

The := use is how I avoided needing to worry about late binding
substitutions for my additions (independent of the internals of
make's specific .MAKE.META.IGNORE_PATHS handling).

For reference:

# more ~/sys-build-scripts.amd64-host/make-main-amd64-nodbg-clang.amd64-host.sh
kldload -n filemon && \
cd /usr/main-src/ && \
mkdir -p /usr/obj/BUILDs/main-amd64-nodbg-clang/sys-typescripts/ && \
script /usr/obj/BUILDs/main-amd64-nodbg-clang/sys-typescripts/typescript-make-amd64-nodbg-clang-amd64-host-$(date +%Y-%m-%d:%H:%M:%S) \
env __MAKE_CONF="/usr/home/root/src.configs/make.conf" SRCCONF="/dev/null" SRC_ENV_CONF="/usr/home/root/src.configs/src.conf.amd64-nodbg-clang.amd64-host" \
WITH_META_MODE=yes \
MAKEOBJDIRPREFIX="/usr/obj/BUILDs/main-amd64-nodbg-clang" \
make $*


===
Mark Millard
marklmi at yahoo.com