Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Feb 2023 12:22:58 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        Peter <pmc@citylink.dinoex.sub.org>
Cc:        FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: 13.2 BETA2: how do debug META_MODE?
Message-ID:  <D8CB3D15-52C6-4134-A563-BB1F50E4520E@yahoo.com>
In-Reply-To: <B2FF73C8-3CC4-4311-B3F9-46606B5A2125@yahoo.com>
References:  <41B536B0-DA66-449E-96BB-E11A8750471A.ref@yahoo.com> <41B536B0-DA66-449E-96BB-E11A8750471A@yahoo.com> <Y/S/RfZaWXXYPx2w@disp.intra.daemon.contact> <ED41CCB8-7A32-4924-A756-099D8E819C4D@yahoo.com> <Y/V5ozYzwL67qDOP@disp.intra.daemon.contact> <F9AE0FD8-5E94-484A-A67A-8D4FAB967F59@yahoo.com> <Y/WH9icO%2BgWPBybo@disp.intra.daemon.contact> <A6A8EA3C-7D14-4467-B00E-388685C4A7F4@yahoo.com> <F68956DB-38B8-45D7-ACF9-1D76644BFED7@yahoo.com> <45A1D65C-22F2-44B2-8B3D-5B6FECA76D0A@yahoo.com> <68EA9ADD-9269-4C60-B4CB-AD3AB0955772@yahoo.com> <B2FF73C8-3CC4-4311-B3F9-46606B5A2125@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Simon J. Gerraty figured out what to do to allow
avoiding . . ./tmp/legacy/usr/sbin/<PROGRAM> leading
to "is newer than" and, so, causing various things
to rebuild. It required an addition to the
infrastructure ( share/mk/src.sys.obj.mk ) so that
the proper paths could be systematically formed for
the purpose.

The below is based on using that and some content in
a just-for-buildworld-buildkernel make.conf file that
I use (via env __MAKE_CONF=3D use). (The make.conf is not
the one in /etc/ .)

After installworld installkernel then a separate
-dM buildworld buildkernel , looking at the log from
the buildworld buildkernel :

# cat =
/usr/obj/BUILDs/main-amd64-nodbg-clang/sys-typescripts/typescript-make-amd=
64-nodbg-clang-amd64-host-2023-02-24:11:13:18 | grep "is newer than the =
target" | sed -
e "s@^.*: file '@file '@" | sort | uniq -c | sort -rn | less
1467 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/Scrt1.o' is newer than the target...
 515 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/crti.o' is newer than the target...
 236 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/crti.o' is newer than the target...
  70 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/libgcc_s.so' is newer than the target...
  69 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/libgcc_s.so' is newer than the target...
  68 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/crt1.o' is newer than the target...
   3 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/i=
nclude/aio.h' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/libssl.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/libcxxrt.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/libctf.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/libcrypto.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/libc.so.7' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/Scrt1.o' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/libssl.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/libcxxrt.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/libctf.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/libcrypto.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/lib/l=
ibc.so.7' is newer than the target...

Then, after doing another -dM buildworld buildkernel , looking
at that new log:

# cat =
/usr/obj/BUILDs/main-amd64-nodbg-clang/sys-typescripts/typescript-make-amd=
64-nodbg-clang-amd64-host-2023-02-24:11:20:54 | grep "is newer than the =
target" | sed -
e "s@^.*: file '@file '@" | sort | uniq -c | sort -rn | less
1467 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/Scrt1.o' is newer than the target...
 515 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/crti.o' is newer than the target...
 236 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/crti.o' is newer than the target...
  73 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/libgcc_s.so' is newer than the target...
  71 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/libgcc_s.so' is newer than the target...
  68 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/crt1.o' is newer than the target...
   3 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/i=
nclude/aio.h' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/libssl.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/libcxxrt.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/libcrypto.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/libc.so.7' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib32/Scrt1.o' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/libssl.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/libcxxrt.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/libctf.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/usr/l=
ib/libcrypto.so' is newer than the target...
   1 file =
'/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/tmp/lib/l=
ibc.so.7' is newer than the target...

So the two end up very similar for what activity happens.

I've only tried this on the amd64 context that I have access
to. I'll set up the aarch64 context as well and see how it
goes over time. (That context builds for aarch64 and for
armv7 .) Similarly, I've only tried main but will be adding
the changes to my releng/13.0 , releng/13.1 , and stable/13
contexts and seeing how it goes. (Not that I'm likely to
rebuild releng/13.0 at this point.)

For now, I've no plans for investigations related to any of
the *.o , *.h , *.so* "is newer than" activity listed above.

For reference:

# git -C /usr/main-src/ diff share/mk/src.sys.obj.mk
diff --git a/share/mk/src.sys.obj.mk b/share/mk/src.sys.obj.mk
index 3b48fc3c5514..3c7e570dbdbd 100644
--- a/share/mk/src.sys.obj.mk
+++ b/share/mk/src.sys.obj.mk
@@ -67,6 +67,9 @@ SB_OBJROOT?=3D  ${SB}/obj/
 OBJROOT?=3D      ${SB_OBJROOT}
 .endif
 OBJROOT?=3D      ${_default_makeobjdirprefix}${SRCTOP}/
+# save the value before we mess with it
+_OBJROOT:=3D ${OBJROOT:tA}
+.export _OBJROOT
 .if ${OBJROOT:M*/} !=3D ""
 OBJROOT:=3D      ${OBJROOT:H:tA}/
 .else

(The change is not specific to main .)

The content for the special make.conf has the
following block of lines for having META MODE
avoid specific . . ./tmp/legacy/usr/sbin/*
programs (and 3 tmp/usr/bin/* ones) from
causing rebuild activity based on the dates
on the programs:

# _OBJROOT is an addition to share/mk/src.sys.obj.mk
# provided by Simon J. Gerraty for my experimentation
# with this avoidance of some unnecessary build
# activity in META MODE:
#
#  OBJROOT?=3D      ${_default_makeobjdirprefix}${SRCTOP}/
# +# save the value before we mess with it
# +_OBJROOT:=3D ${OBJROOT:tA}
# +.export _OBJROOT
#
# TARGET.TARGET_ARCH   for amd64 stays as  amd64.amd64 for obj-lib32 =
(correct for the purpose)
# MACHINE.MACHINE_ARCH for amd64 turns into i386.i386  for obj-lib32 =
(wrong   for the purpose)
#
IGNORELEGACY_NOSYMLINKPREFIX=3D =
${_OBJROOT}/${TARGET}.${TARGET_ARCH}/tmp/legacy/usr
IGNOREOTHER_NOSYMLINKPREFIX=3D  =
${_OBJROOT}/${TARGET}.${TARGET_ARCH}/tmp/usr/bin
#
.for ignore_legacy_tool in awk basename cap_mkdb cat chmod cmp cp =
crunchgen crunchide cut date dd dirname echo egrep env expr fgrep file2c =
find gencat grep gzip head hostname jot lex lb ln ls m4 make mkcsmapper =
mkdir mktemp mtree mv nawk patch realpath rm sed sh sort touch tr =
truncate uudecode uuencode wc xargs
.MAKE.META.IGNORE_PATHS+=3D =
${IGNORELEGACY_NOSYMLINKPREFIX}/sbin/${ignore_legacy_tool}
.endfor
#
.for ignore_other_tool in ctfconvert objcopy nm
.MAKE.META.IGNORE_PATHS+=3D =
${IGNOREOTHER_NOSYMLINKPREFIX}/${ignore_other_tool}
.endfor
#
.MAKE.META.IGNORE_PATHS:=3D ${.MAKE.META.IGNORE_PATHS}


The . . ./tmp/usr/bin/* ones ( ctfconvert objcopy nm )
may be more questionable than the
. . ./tmp/legacy/usr/sbin/* ones.

This likely will not prevent the likes of a system with
clang14 -> system with clang15 transition having clang15
rebuild itself once the clang15 system is running and
another buildworld is started.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D8CB3D15-52C6-4134-A563-BB1F50E4520E>