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.

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
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6982
Build 7166: arc lint + arc unit

Event Timeline

peterj updated this revision to Diff 24353.Jan 23 2017, 6:51 PM
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.
lidl added a subscriber: lidl.Jan 23 2017, 6:56 PM

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

lidl added inline comments.Jan 23 2017, 7:11 PM
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 updated this revision to Diff 24378.Jan 24 2017, 9:39 AM
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 accepted this revision.Jan 24 2017, 5:20 PM
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 a subscriber: wblock.Jan 27 2017, 2:57 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 .