Page MenuHomeFreeBSD

Add LOGDIR option to redirect "make universe" output to a different directory.
AcceptedPublic

Authored by peterj on Jan 23 2017, 6:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 7 2024, 8:17 AM
Unknown Object (File)
Oct 2 2024, 8:15 AM
Unknown Object (File)
Oct 2 2024, 6:02 AM
Unknown Object (File)
Oct 1 2024, 3:18 PM
Unknown Object (File)
Oct 1 2024, 2:43 PM
Unknown Object (File)
Oct 1 2024, 9:15 AM
Unknown Object (File)
Oct 1 2024, 5:48 AM
Unknown Object (File)
Sep 24 2024, 9:22 AM

Details

Reviewers
jhb
bdrewery
lidl
Group Reviewers
manpages
Summary

By default, "make universe" generates a series of logs (one for each
machine, architecture, target tuple) in /usr/src (or whereever the
src tree is located). The LOGDIR option redirects these logs to an
alternative location, allowing "make universe" to be run with a
read-only /usr/src.

MFC after: 1 week

Test Plan

Run "make universe" with a read-only /usr/src to demonstrate failure
without this patch. Run "make LOGDIR=/tmp universe" with this patch.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6982
Build 7166: arc lint + arc unit

Event Timeline

peterj retitled this revision from to Add LOGDIR option to redirect "make universe" output to a different directory..
peterj updated this object.
peterj edited the test plan for this revision. (Show Details)
peterj added reviewers: bdrewery, jhb.

Is there any particular reason not to just put them in the build output directory?

Makefile
449

Please use a name other than the uber-generic "LOGDIR" for this.

In FreeBSD 9.x I was bitten by a similar problem: The unadorned usage of "LOGFILE" in usr.sbin/etc/etcupdate.sh - the build logs for nightly builds where being truncated when this script was run.

Even more annoying the usage of the environmental variable isn't documented in the manpage for that command, while only "EDITOR"
is mentioned.

I'd suggest something like "ULOGDIR", which is far, far, less likely to conflict with an existing code.

peterj edited edge metadata.

Change "LOGDIR" to "UNIVERSE_LOGDIR" to reduce risk of clashes.

Is there any particular reason not to just put them in the build output directory?

I wanted to leave the default as-is in case people were relying on it. I agree a case could be made for putting the build logs with the build output but I believe we should also be

Makefile
449

Based on a similar comment by grog@, I've changed to UNIVERSE_LOGDIR - which in extremely unlikely to clash.

lidl added a reviewer: lidl.

Thanks for updating. Looks good to me.

This revision is now accepted and ready to land.Jan 24 2017, 5:20 PM
wblock added inline comments.
share/man/man7/build.7
643

Maybe a little simpler:

Specify an alternate directory for the logfiles for each target.
By default, they are saved at the root of the src tree, usually
.Pa /usr/src .