> Can we say that META is for speeding consecutives builds tracking
> current/stable and META + DIRDEPS for developing/testing specific
> parts of base code  with speed + debug in mind?

The key focus of META_MODE is more reliable incremental builds, ensuring
targets are updated when anything that contributed is updated.
That deep introspection can go too far so there are mechanisms to
exclude certain paths from consideration.

That allows for some optimizations, eg. you don't need to make
targets out-of-date just because any makefile changed for example.
META_MODE helps ensure what needs to be re-built is, and can avoid
rebuilding things that do not need to be.

DIRDEPS_BUILD is a different beast - its goal is to avoid tree walks,
to greatly simplify the build in general - a top-level build works
exactly the same as a build started from any random location in the
tree, and in each case only the directories needed to satisfy that
initial target will be visited, in the correct order allowing full
advantage of large numbers of cpus.

We can leverage META_MODE to automatically update the tree DIRDEPS (kept
in Makefile.depend files) that make the DIRDEPS_BUILD work.

If the pkg-base work had resulted in a src directory per package, it
would be trivial to convert the build to using DIRDEPS_BUILD.
Absent that, it is not really possible.

When we build FreeBSD for our internal projects we build a number of
packages each with its own directory and hence Makefile.depend
and thus we can use DIRDEPS_BUILD to optimize our builds.

--sjg


> Simon J. Gerraty <s...@juniper.net> escreveu (domingo, 28/01/2024 à(s) 01:43):
> >
> > > I use meta-mode in /etc/src-env.conf so that if (for example) a small
> > > change in the kernel config is made, the machine doesn't take hours
> > > recompiling.
> >
> > > But, from time to time, one might be required to make
> > > cleanworld && make cleandir (to be sure) && make clean (to be *really* 
> > > sure)
> >
> > Almost never (as Warner said).
> > I have trees that go for years without ever being cleaned.
> > Unless I'm collecting timing data for clean tree builds.
> >
> > If you use DIRDEPS_BUILD as well as META_MODE, there can be cases where
> > you need the stage tree cleaned (staging is like auto-install to
> > DESTDIR).  The most common case is when a library has switched from
> > staging its headers from $STAGE_ROOT/$MACHINE/usr/include to
> > $STAGE_ROOT/common/usr/include (so they only get staged once), if you
> > don't clean out $STAGE_ROOT/$MACHINE/usr/include, builds will continue to
> > find headers there that should be found in
> > $STAGE_ROOT/common/usr/include and thus revert Makefile.depend changes.
> > We added a mechanism to allow triggering auto-clean of stage tree when such
> > changes are made.
> >
> > --sjg
> >
> 
> 
> --
> Nuno Teixeira
> FreeBSD Committer (ports)

Reply via email to