Re: Help me understand "fakeroot"

From: Mathieu Arnold <mat_at_freebsd.org>
Date: Fri, 09 May 2025 14:13:51 UTC
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.

-- 
Mathieu Arnold