Date: Tue, 26 Jan 2021 16:00:05 -0800 From: Mark Millard <marklmi@yahoo.com> To: Bryan Drewery <bdrewery@FreeBSD.org>, Current FreeBSD <freebsd-current@freebsd.org> Subject: Re: FYI: Why META_MODE rebuilds so much for building again after installworld (no source changes) Message-ID: <DB0C7B41-2101-4C5C-BFC8-3C95CC0B9F6F@yahoo.com> In-Reply-To: <3345EBA5-A09C-4E3F-B94D-39F57F56BDBB@yahoo.com> References: <B74790D9-FBC2-4818-BEAF-34E5B705C460@yahoo.com> <3345EBA5-A09C-4E3F-B94D-39F57F56BDBB@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2021-Jan-23, at 21:37, Mark Millard <marklmi at yahoo.com> wrote: > On 2021-Jan-22, at 01:45, Mark Millard <marklmi at yahoo.com> wrote: >=20 >> Given an already built, installed and booted system version, I've >> noted a big difference for META_MODE in 2 rebuild contexts (no >> source updates involved): >>=20 >> *) Prior buildworld buildkernel, installkernel, installworld, boot >> presumed before (A) and before (B) below. >>=20 >> A) make . . . buildworld buildkernel >> make . . . buildworld buildkernel >> (the 2nd buildworld buildkernel in (A) builds far less than the = first) >> (that means that the first built more than I would have guessed) >>=20 >> vs. >>=20 >> B) make . . . buildworld buildkernel >> make . . . installworld >> make . . . buildworld buildkernel >> (the 2nd buildworld buildkernel in (B) builds far more than it did = in (A)) >> (so, more like the 1st buildworld buildkernel in (A) and (B), given >> the specified prior context) >>=20 >> So I used make -dM for the commented buildworld buildkernel lines, = logging >> the build output and later diff'ing them. >>=20 >> Result that I noticed? Lots of lines uniquely from (B)'s case, ending = with >> one of: >>=20 >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/awk' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/cap_mkdb' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/cat' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/cp' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/crunchgen' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/crunchide' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/dd' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/egrep' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/env' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/file2c' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/gencat' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/grep' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/gzip' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/jot' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/lex' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/ln' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/m4' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/mv' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/patch' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/rm' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/sed' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/sh' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/touch' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/truncate' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/uudecode' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/uuencode' is newer than the target... >> file = '/usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/u= sr/sbin/xargs' is newer than the target... >>=20 >> The lines with these lead to more files being updated and so causing = more >> indirect rebuild activity (that cascades). >>=20 >> Many/most/all(?) of these seem to me to be unlikely to actually need = to >> contribute to what needs to be rebuilt (just based on being newer). = So >> the option to ignore (some of?) them could be useful in making = META_MODE >> builds quicker. >=20 > The following from one of the .meta files makes the point that rm use > in the example is unlikely to be important to needing to rebuild, > despite it actually causing a file rebuild. Nor is the specific echo > command listed relevant. Only the "ar" command is: >=20 > # Meta data file = /usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/lib/libc++/li= bc++.a.meta > CMD @echo building static c++ library > CMD @rm -f libc++.a > CMD ar -crsD libc++.a algorithm.o any.o atomic.o barrier.o bind.o = charconv.o chrono.o condition_variable.o condition_variable_destructor.o = debug.o exception.o filesystem/directory_iterator.o filesyste > m/int128_builtins.o filesystem/operations.o functional.o future.o = hash.o ios.o iostream.o locale.o memory.o mutex.o mutex_destructor.o = new.o optional.o random.o random_shuffle.o regex.o shared_mutex.o > stdexcept.o string.o strstream.o system_error.o thread.o typeinfo.o = utility.o valarray.o variant.o vector.o cxxrt_auxhelper.o = cxxrt_dynamic_cast.o cxxrt_exception.o cxxrt_guard.o = cxxrt_libelftc_dem_g > nu3.o cxxrt_memory.o cxxrt_stdexcept.o cxxrt_terminate.o = cxxrt_typeinfo.o > CWD = /usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/lib/libc++ > TARGET libc++.a > -- command output -- > building static c++ library >=20 > -- filemon acquired metadata -- > # filemon version 5 > # Target pid 22471 > # Start 1611359217.214996 > V 5 > E 22961 /bin/sh > R 22961 /etc/libmap.conf > R 22961 /var/run/ld-elf.so.hints > R 22961 /lib/libedit.so.7 > R 22961 /lib/libc.so.7 > R 22961 /lib/libncursesw.so.9 > R 22961 /usr/share/locale/C.UTF-8/LC_CTYPE > F 22961 22962 > E 22962 = /usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/us= r/sbin/rm > R 22962 /etc/libmap.conf > R 22962 /var/run/ld-elf.so.hints > R 22962 /lib/libc.so.7 > R 22962 /usr/share/locale/C.UTF-8/LC_CTYPE > D 22962 libc++.a > X 22962 0 0 > . . . >=20 > The timestamp on . . ./tmp/legacy/usr/sbin/rm is not > actually relevant to if libc++.a needs to be rebuilt. >=20 > Of course, the structure also point out the judgment > is specific to understanding the sequence of CMD's > listed above. Only a hack of ignoring, not recording, > or commenting out the filemon lines ending in > /tmp/legacy/usr/sbin/rm would seem to avoid the @rm > handling issue. Such might well have its own risks. >=20 > Some other /tmp/legacy/usr/sbin/* filemon line endings > likely would have a similar status of being a reference > to a file that could(/should?) have its timestamp > relationship not checked. Just for reference for more about the sequencing involved: Looks like in my example various . . ./tmp/legacy/. . ./*bin/ actually are links to files in: = /usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/bi= n/ and the later after-install buildworld "Rebuilding the temporary build tree" step leads to the updated dates for files in that area, updated via the code that reports: Linking host tools into = /usr/obj/amd64_clang/amd64.amd64/usr/fbsd/mm-src/amd64.amd64/tmp/legacy/bi= n So the prior installworld leaves updated dates and the linking to those installed files makes . . ./tmp/legacy/. . ./*bin/* have the newer dates show up for the legacy paths as well. In turn the dependency tracking via META_MODE uses the new dates on . . ./tmp/legacy/. . ./*bin/* files to cause rebuilds of more materials than if installworld had not been done. It is not obvious if Bryan D. would find the effort to avoid this worthwhile for the contexts that drive FreeBSD's build environment choices. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DB0C7B41-2101-4C5C-BFC8-3C95CC0B9F6F>