Page MenuHomeFreeBSD

mk: fix unnecessary library relinking with incremental builds
ClosedPublic

Authored by val_packett.cool on May 5 2023, 8:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 8, 10:41 PM
Unknown Object (File)
Sun, Mar 3, 12:36 AM
Unknown Object (File)
Sat, Mar 2, 8:36 PM
Unknown Object (File)
Feb 27 2024, 2:06 AM
Unknown Object (File)
Feb 10 2024, 1:13 AM
Unknown Object (File)
Jan 16 2024, 5:30 PM
Unknown Object (File)
Jan 6 2024, 9:46 PM
Unknown Object (File)
Dec 20 2023, 7:32 AM

Details

Summary

Initial libs such as csu are always built (.PHONY), and their installation
to WORLDTMP was causing all the subsequent libraries to be considered out-of-date
even when in reality they were not. Use install -C more consistently everywhere
to avoid unnecessarily updating the mtimes in WORLDTMP, fixing this problem.

This cut down my no-change buildworld time from 30 to 15 seconds.

Fixes: https://lists.freebsd.org/pipermail/freebsd-current/2016-May/061481.html TODO.1
Sponsored by: https://www.patreon.com/valpackett

Test Plan

I… don't think install -C could ever cause problems? But please do test various build configurations with this.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.May 5 2023, 10:00 PM

@sjg Friendly ping, might be nice to get this in before 14-CURRENT branching?

I don't think this is specific to WITH_META_MODE?

Well, you wouldn't really save any time on a non-incremental build as all the libraries would be rebuilt anyway. The *problem* this solves is specific to META_MODE :)

Well, you wouldn't really save any time on a non-incremental build as all the libraries would be rebuilt anyway. The *problem* this solves is specific to META_MODE :)

WITHOUT_META_MODE builds can be incremental. That's what WITHOUT_CLEAN is for, which people widely use so as to not waste time.

WITHOUT_CLEAN builds should benefit as well then.. (Not sure why people still use it when META_MODE exists but okay :D)

I guess the commit title should just mention "incremental builds".

val_packett.cool retitled this revision from mk: fix unnecessary library relinking WITH_META_MODE to mk: fix unnecessary library relinking with incremental builds.Jul 27 2023, 7:24 PM

WITHOUT_CLEAN builds should benefit as well then.. (Not sure why people still use it when META_MODE exists but okay :D)

for one, because you don't need to load a special module for it to work.

this has the added advantage of it working in cross build situations.