Re: Help me understand "fakeroot"

From: Mathieu Arnold <mat_at_freebsd.org>
Date: Sat, 10 May 2025 07:11:10 UTC
On Fri, May 09, 2025 at 02:22:54PM -0700, Dan Mahoney (Ports) wrote:
> 
> 
> > On May 9, 2025, at 07:13, Mathieu Arnold <mat@freebsd.org> wrote:
> > 
> > On Thu, May 08, 2025 at 04:29:26PM -0700, Dan Mahoney (Ports) wrote:
> >> All,
> >> 
> >> I’m doing some work on Jared Mauch’s efforts to make Mailman2 work under Python3 (because mailman3 is….a problem child that I don’t want to talk to)….
> >> 
> >> And I notice the original port uses something in /usr/ports/Mk/users/fakeroot.
> >> 
> >> Documentation on what this does is a little thin.  Could someone tell me what cases this is required in, and what it does?
> > 
> > All port building is done as an unprivileged user, so fakeroot,
> > basically, is a wrapper that helps run command that expect to be ran as
> > root.
> > 
> > For example, if the install process does, say, `chown root /some/file`,
> > as it is running as nobody, it will fail. Now, if the install process is
> > running through fakeroot, that chown will basically be a noop, but it
> > will not fail, and the install process finishes properly.
> 
> 
> Aah, now I see.  So, this is of benefit to the port building on the build clusters that’s used to eventually build .pkg files — not for people who (I think as mentioned on -questions) are doing their port building by doing the classic cd /usr/ports/category/foo; make install.
> 
> That was the nuance i had missed.

Yes, but it is the other way round, ports have to be able to package as
an unprivileged user, it's for the remaining people who run the
unsupported `make install` on a live system as root of all things that
it's not needed.

-- 
Mathieu Arnold