Re: Cross compiling user applications for armv7

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sat, 20 Sep 2025 16:43:11 UTC
On Sep 20, 2025, at 08:39, Michał Kruszewski <mkru@protonmail.com> wrote:

> I believe I have tried all possible combinations of BUILD_AS_NON_ROOT, PORTBUILD_USER, PORTBUILD_GROUP, PORTBUILD_UID, PORTBUILD_GID.

That leads me to the below conclusion . . .

> All of them fail with the same message:
>  pkg-static: . wrong user or group ownership (expected 0/0 versus actual 1001/0)

I'll note that the "actual 1001/0" indicates that the file system
actually has a directory or file with such an ownership. Given the
lack of updates when you change things, it is probably not a
directory or file that is being recreated or having its ownership
changed: just a persistent old ownership staying in place.

Note: The ". wrong" indicates that the specific message
is for a directory.

> The configuration does not even change the error message.
> The actual is always 1001/0.

That is because, the "actual 1001/0" message is about a preexisting
file with the ownership indicated --as far as I can tell.

The ownership of that directory or file needs to be changed. (There
may be others with similar issues.)

Note: The ". wrong" indicates that the specific message
is for a directory.

> Even though, poudriere bulk info differs.
> For example, this is my current poudriere.conf: https://pastebin.com/cE7afZuP
> The poudriere message is:
>  [00:00:01] Will build as nobody:nobody (65534:65534)
> I don't understand why, because BUILD_AS_NON_ROOT is set to NO.
> I guess it should build as root.

BUILD_AS_NON_ROOT does not control the ownerships of the
preexisting files and directories involved.

> Mark, can you send my your poudriere.conf that successfully compiles some packages?

My various poudirere.conf are heavily tailored to supporting
my rare "poudriere bulk -Ca" tests that try to build all
30000+ port packages. And things are split up across multiple
such files that are used together, in order to deal with
handling different jails somewhat differently. The large
.conf is like 32504 bytes long, most of it from a large
TMPFS_BLACKLIST definition.

Plus, given what I report above about the "actual 1001/0"
message, I doubt that my files would make any difference
(before or after you had tailored things not matching your
context).

Your poudriere.conf looks to only define non-default
or explicit values for:

ZPOOL             (explicit zroot)
DISTFILE_CACHE    (non-default /tmp/cache)
BUILD_AS_NON_ROOT (explicit NO [instead of no])

You have some other changes that are commented out
--so everything other than the above 3 are using the
defaults as far as what you posted goes.

I doubt that such is contributing to the specific
"actual 1001/0" message.

I recommend finding the directory(s) and/or file(s)
owned by 1001 (user) and 0 (group) and changing
the ownership to the 0 (user) and 0 (group) that is
being reported as what is expected. I do not
know if permissions might also be at issue. This is
about the directory tree used to hold the poudriere
jail's world.

If you use that outside poduriere as well, you might
well instead want a separate directory tree for the
poudriere jail world that can have its own ownerships
and/or permissions independent of the other activities.


===
Mark Millard
marklmi at yahoo.com