====== Metamode ====== ===== Introduction ===== Metamode is an incremental build system for %%FreeBSD%%, which uses bmake's //meta mode// and filemon(4) to create metadata files, substantially decreasing build times by only building what has changed since the last build. Note: Enabling ''%%META_MODE%%'' also implies (enables) ''%%NO_CLEAN%%'' in the buildworld process ===== Setup ===== - Add ''%%WITH_META_MODE=YES%%'' to ''%%/etc/src-env.conf%%'' - Run ''%%# kldload filemon%%'' - Run ''%%# make cleanworld%%'' once. If objects don't have ''%%.meta%%'' files then ''%%META_MODE%%'' won't do the right thing on an incremental build. (([[https://lists.freebsd.org/pipermail/freebsd-current/2016-May/061552.html|[CFT WITH_META_MODE: Working incremental build]])) - [[https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld|FreeBSD buildworld]] will now create meta files to improve the performance of future builds. ===== Caveats ===== * Don't mix ''%%WITH_META_MODE%%'' with ''%%ccache(1)%%'' as mentioned in [[https://forums.freebsd.org/threads/61548/#post-354470|this thread]] . * For all versions from 12.0-RELEASE and going forward, both technologies work as expected. * ''%%WITH_META_MODE%%'' is not the same thing as ''%%WITH_DIRDEPS_BUILD%%'', which is an alternative, experimental build system. * [[http://www.crufty.net/sjg/docs/freebsd-meta-mode.htm|Building FreeBSD in meta mode]] * [[https://www.bsdcan.org/2016/schedule/attachments/354_Improving_the_FreeBSD_build_bdrewery_2016.pdf|Improving the FreeBSD Build (BSDCan 2016)]] * [[http://www.crufty.net/help/sjg/bmake-meta-mode.htm|Description of meta mode in bmake(1)]] * [[https://github.com/xmj/xmj.github.io/blob/master/articles/sysadmin/builds_ccache_memcached.md#dirdeps|Speeding up builds on FreeBSD]] ===== References ===== * ''%%src.conf(5)%%'' * ''%%build(7)%%'' ---- {{tag>HowTo}}