tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: RFC: adding .-include <local.*.mk> to share/mk



Thanks for the followup.

> > These provide a hook for customizing build behavior.
> > For example as described in
> > https://www.crufty.net/sjg/docs/netbsd-meta-mode.htm
>
>It would be a lot easier to evaluate this proposal if you provided a
>summary of what exactly you're proposing to do, what effects it would
>have, and the problem it's supposed to solve.

The TL;DR; summary is

Apart from anything else, META MODE provides make a means of doing a
much better job of doing update builds.

The fact that a meta file records the expanded command line from the
previous build means it can be compared with the commands to be run this
time.  If anything is different - the target is out-of-date.

That alone eliminates the need for the common hack of making targets
depend on every makefile - just in case they might influence the result.

Even if the command line is the same as last time, the syscall trace
recorded allows for much deeper inspection of the tools/files used to
build a target - if any are newer - the target is out-of-date.

Also if the target produced a file which is now missing, that can also
cause it to be out-of-date.

Obviously, deep inspection can go too far, so there are several
mechanisms to allow control of that.

That's just the start, the DIRDEPS BUILD takes it to another level -
though the two can be used independently.  By tracking each directories
dependencies (recorded as DIRDEPS in Makefile.depend files), it is
possible to orchestrate the build from any origin - not just top-level,
building everything (and only what) the current origin needs.

We've been building Junos this way since 2010 I think, and we have been
building FreeBSD the same way since 2012.  The functionality has all been
upstreamed to FreeBSD, and many devs use META MODE for all their builds.

Until a recent change to how they build packages for their base system,
there was no hook to enable DIRDEPS BUILD in upstream.  That's now on my
todo list.

>Furthermore, I think nobody besides you still really understands what
>meta mode is or does. I may be being too pessimistic about this; but
>from what I can see there's at least still no explanation in the man
>page.

True. The man page describes make's functionality, not what it makes
possible.

>Nor does the link really explain anything; there's masses of
>details but no overview. (Also, FWIW, the link seems to be more of a
>blog post than documentation.)

That one certainly is, since I've repeated this exercise for NetBSD a
few times now since 2015
It contains links to earlier docs - but unless you are into build
orchestration, they may not help.

Does the above info help?

--sjg


Home | Main Index | Thread Index | Old Index