Page MenuHomeFreeBSD

Fix share/zoneinfo for DIRDEPS_BUILD
ClosedPublic

Authored by sjg on Nov 15 2023, 10:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 16, 4:16 AM
Unknown Object (File)
Tue, Apr 16, 4:16 AM
Unknown Object (File)
Sun, Apr 14, 5:34 PM
Unknown Object (File)
Thu, Apr 11, 6:40 PM
Unknown Object (File)
Thu, Apr 11, 6:40 PM
Unknown Object (File)
Tue, Apr 9, 7:27 PM
Unknown Object (File)
Mon, Apr 8, 2:08 PM
Unknown Object (File)
Mon, Apr 8, 2:23 AM
Subscribers
None

Details

Summary

The tranditional build makes multiple passes through the tree.
The DIRDEPS_BUILD visits each directory only once per architecture,
thus makefiles should be able to everything they need in a single pass.

The use of TZS!= when doing make(*install*)
only works if the directory has previously been visited to do zoneinfo
since before the zoneinfo target is run TZS will be empty.

To fix this, have the zoneinfo target capture the list of files to
zoneinfo, and install-zoneinfo use that list.

This is more efficient - we only gather the list of zones when it is
likely to have changed, and allows the makefile to do everything in a
single pass.

Diff Detail

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

Event Timeline

sjg requested review of this revision.Nov 15 2023, 10:59 PM
sjg created this revision.
share/zoneinfo/Makefile
102

Can we use a more appropriate name than zoneinfo for the file?

105

Building during install is not something we like to do, at least for the traditional build

Rename zoneinfo target to zonefiles.

sjg marked an inline comment as done.Nov 16 2023, 1:16 AM
share/zoneinfo/Makefile
105

This still applies. We do not normally mark installworld targets as having a dependency on the corresponding buildworld targets, and generally treat it as an error to be trying to build during installworld; bsd.sys.mk even goes and puts ERROR-tried-to-rebuild-during-make-install in CFLAGS to catch that.

sjg marked an inline comment as done and an inline comment as not done.

Put install-zoneinfo: zonefiles dependency within check for DIRDEPS_BUILD

sjg marked 2 inline comments as done.Nov 16 2023, 2:01 AM
sjg added inline comments.
share/zoneinfo/Makefile
105

Sorry marked wrong commend done earlier.
Moved the dependency to within block for DIRDEPS_BUILD

LGTM subject to one query

share/zoneinfo/Makefile
83

Is it still a meta target if it's creating a real file? (If so, I guess because it's doing things other than just creating the file?)

share/zoneinfo/Makefile
83

That's a good question. To the extent I can tell what META_TARGETS is trying to do, I don't think it should make any difference.

This revision is now accepted and ready to land.Nov 20 2023, 7:41 PM
share/zoneinfo/Makefile
83

Isn't META_TARGETS just for meta mode cookie handling? It's not a "meta" target in a sense similar to phony targets.

share/zoneinfo/Makefile
83

It appears to be for targets that Bryan wanted to add extra deps to in META_MODE but that's as much as I can deduce from the logs I've seen.
None of that makes any difference though to the fundamental handling of targets in META_MODE - at worst it is unnecessary.

This revision was automatically updated to reflect the committed changes.