Re: reproducible builds: what is make[5]: warning: /lib/geom: Permission denied

From: Jessica Clarke <jrtc27_at_freebsd.org>
Date: Tue, 20 Jan 2026 16:38:26 UTC
On 20 Jan 2026, at 16:28, Minsoo Choo <minsoochoo0122@proton.me> wrote:
> 
> On Tuesday, January 20th, 2026 at 11:18 AM, Warner Losh <imp@bsdimp.com> wrote:
>> 
>> 
>> On Tue, Jan 20, 2026 at 9:16 AM Ed Maste <emaste@freebsd.org> wrote:
>> On Tue, 20 Jan 2026 at 11:11, Minsoo Choo <minsoochoo0122@proton.me> wrote:
>> > On Tuesday, January 20th, 2026 at 9:44 AM, Bjoern A. Zeeb <bzeeb-lists@lists.zabbadoz.net> wrote:
>> > > during buildworld (sorry only make -s) as user I see:
>> > >
>> > > make[5]: warning: /lib/geom: Permission denied
>> > >
>> > > Anyone wants to investigate?
>> > >
>> > Ed says this has been happening for a month. I suspect that make forgets append /usr/obj on build. (could be env issue)
>> 
>> Many months, not one month. In fact I see a report on -current from
>> bz@ from 2021 about this same sort of issue. In that thread there's a
>> message from Warner that https://reviews.freebsd.org/D30990 might be a
>> fix -- I see it's still not committed.
>> 
>> Oh! Has it been that long... I like it, simon had an issue, but it doesn't like like Jess' follow up went anywhere....
>> 
>> Warner
> 
> I just tested on main and it solves the issue. I'll CC and ping her on phab.

sjg@ and I went deep down the rabbit hole on this one a while after
that review. He committed an alternative attempt at a fix but that
broke something so I had to revert it. At this point I don’t recall if
there was something that my original patch you’ve linked also broke.
The short answer for where this comes from is bmake does various
access(2) calls to figure out where to use for MAKEOBJDIR, and in the
cases where the path in the tree, prefixed with /, exists on disk and
you’re running as non-root those will fail with EPERM, but we then go
and override it in src.sys.obj.mk so whatever it picked was irrelevant.
Ideally we’d be able to encode what we want MAKEOBJDIR in such a way
that bmake can pick it correctly for us, but we have quite complex
logic around that, in part to handle WITH(OUT)_UNIFIED_OBJDIR.

Jessica