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

From: Simon J. Gerraty <sjg_at_juniper.net>
Date: Thu, 23 Feb 2023 22:03:56 UTC
Mark Millard <marklmi@yahoo.com> wrote:
> So I was hoping for a "assigned once and
> inherited" status relative to submakes for
> .MAKE.META.IGNORE_PATHS .

No, .MAKE.* are specifically named to ensure they cannot come from the
environment.  So bounding them in a check for level 0 pretty much
ensures they have no effect.
> > In which case the above would not be correct.
> 
> And I've not found any notation that is always correct

I think your fundamental issue is above.
These variables apply only per make instance.
They are not inherited, they are not global.

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.

> but adjusts to what /usr/obj/BUILDs/*/usr/main-src/*.*/
> I happen to be building for. The example that I've
> been showing is main-amd64-nodbg-clang with amd64.amd64
> but there are other *-*-*dbg-* and *.* that I build for.

Sorry I guess I'm not following what you are saying as I cannot see how
any of that is relevant.

> 
> (I have found multiple notations that work for
> -V.MAKE.META.IGNORE_PATHS .)

Sorry not sure what that means.  Note that when you do

make -V BLAH

you are seeing the value of BLAH as level 0 sees it - which in your
setup looks right.  But because of your conditional on level 0
the effect is not what you want once the build gets going.
 
> I'm wondering if I need to invent a new, personal name
> that will not clash with official names and just use
> reference to to my name, adjusting my build scripts
> to provide the definition.

Sorry, a name for what?

> 
> So: I'm still searching for approriate notation, at least
> for the tmp/legacy/usr/ related paths. (The tmp/usr/bin/
> experiment is more questionable it is appropriate overall.)

Again not really following.  If there are paths under tmp/legacy/usr/
that should be ignored by meta.c - why would that not be so for
everyone?

> Until I know a valid notational technique, expect to
> see experiments involved in what I do. Going the other
> way: if I'm to test something for you, let me know the
> context you want used instead of whatever my experiment
> status happens to be.
> 
> >> 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 $*

This is why we introduced variables like SRCTOP and OBJTOP behind which you
can hide all the above.  It should not matter what or how OBJTOP gets its
value it should be useful.

.MAKE.META.IGNORE_PATHS += ${OBJTOP}/tmp/legacy/usr

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