WITH_META_MODE: Avoid host tool timestamps causing a rebuild.

Using buildworld, installworld, buildworld.  It is expected that nothing
should rebuild.  However any host tool used could have its timestamp
updated.  Any library used by dynamic tools could have its timestamp
updated.  The filemon(4) data in the .meta files captures all reads to
these files.  This causes the 2nd buildworld to rebuild everything since
host tools and files have been updated.

Because the build is self-reliant and bootstraps itself, it should be
safe to ignore mtime changes on host files used during the build.  Host
files should only impact the build of legacy, build-tools, bootstrap-tools,
cross-tools, but those are already intended to be reproducible from its
own bootstrapping.  It is possible in a rare case that a bug in a host
file does produce a broken build tool.  If that happens it will just
have to be communicated properly.

An alternative solution would be to update the mtime of all files in the
object directory after installworld so that the host files are not newer
than the object files.  That also requires special care for read-only
obj directories and special care to not mess with any intended timestamps in
the build, such as done for reproducibility.

Reported by:	many
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Bryan Drewery 2016-06-05 23:05:01 +00:00
parent 3681768c3f
commit 7f17cd1c8d

View File

@ -68,6 +68,26 @@ META_MODE+= missing-filemon=yes
META_MODE?= normal
.export META_MODE
.MAKE.MODE?= ${META_MODE}
.if !empty(.MAKE.MODE:Mmeta) && !defined(NO_META_IGNORE_HOST)
# Ignore host file changes that will otherwise cause
# buildworld -> installworld -> buildworld to rebuild everything.
# Since the build is self-reliant and bootstraps everything it needs,
# this should not be a real problem for incremental builds.
# Note that these are prefix matching, so /lib matches /libexec.
.MAKE.META.IGNORE_PATHS+= \
${__MAKE_SHELL} \
/bin \
/lib \
/rescue \
/sbin \
/usr/bin \
/usr/include \
/usr/lib \
/usr/sbin \
/usr/share \
.endif
.if ${MK_AUTO_OBJ} == "yes"
# This needs to be done early - before .PATH is computed