Page MenuHomeFreeBSD

build: Emit a warning for build targets run as root
ClosedPublic

Authored by emaste on May 14 2025, 3:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 9, 9:40 PM
Unknown Object (File)
Fri, Oct 9, 4:54 PM
Unknown Object (File)
Fri, Oct 9, 4:53 PM
Unknown Object (File)
Fri, Oct 9, 4:53 PM
Unknown Object (File)
Wed, Oct 7, 7:18 AM
Unknown Object (File)
Tue, Sep 29, 11:32 PM
Unknown Object (File)
Tue, Sep 29, 11:54 AM
Unknown Object (File)
Sep 10 2026, 10:26 PM
Subscribers

Diff Detail

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

Event Timeline

emaste created this revision.
brooks added a subscriber: brooks.

We should really make it an error with an annoyingly long override.

This revision is now accepted and ready to land.Fri, Oct 9, 2:44 PM

We do this as root at work, so this will just add noise (since nanobsd doesn't have privsep)

ngie added inline comments.
Makefile.inc1
378–379

Is this really the best spot to do this? This will emit a bunch more noise for each top-level argument executed and does a bunch more forks than necessary.
I would think the top-level Makefile would be a lot better.

380

The Warning: prefix is superfluous:

% cat f.mk 
.warning "Warning: foo"
% bmake -f f.mk
bmake: /usr/src/tests/sys/fs/fusefs/f.mk:1: warning: "Warning: foo"
bmake: no target to make.

bmake: stopped in /usr/src/tests/sys/fs/fusefs
Makefile.inc1
378–379

I'll take a look.

Note that this is in the section for build targets so won't be run unconditionally.

380

Yes the extra "Warning" needs to be removed. I'll leave it for now while we decide between reverting, demoting to .info, moving, etc.