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
F102986032: D39980.diff
Tue, Nov 19, 12:19 PM
Unknown Object (File)
Oct 18 2024, 4:29 AM
Unknown Object (File)
Oct 11 2024, 11:13 AM
Unknown Object (File)
Oct 8 2024, 10:18 AM
Unknown Object (File)
Sep 27 2024, 6:05 PM
Unknown Object (File)
Sep 18 2024, 6:20 PM
Unknown Object (File)
Sep 7 2024, 10:39 PM
Unknown Object (File)
Sep 4 2024, 12:48 PM

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 Skipped
Unit
Tests Skipped
Build Status
Buildable 51347
Build 48238: arc lint + arc unit

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.