Re: Cross compiling user applications for armv7

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sat, 20 Sep 2025 12:57:12 UTC
On Sep 20, 2025, at 00:57, Michał Kruszewski <mkru@protonmail.com> wrote:

> I tried with BUILD_AS_NON_ROOT set to YES and NO.
> Still the same error.
> 
> I also started experimenting with PORTBUILD_USER and PORTBUILD_GROUP.
> What is interesting, when I set:
>  PORTBUILD_USER=mkru
>  PORTBUILD_GROUP=wheel
> poudriere bulk reports:
>  [00:00:01] Will build as mkru:wheel (65532:0)
> Which is weird, because id of mkru is 1001.

BUILD_AS_NON_ROOT=yes ? BUILD_AS_NON_ROOT=no ?
Which was the context with 65532 ?

I previously wrote text referencing the 65532,
which is the default value for PORTBUILD_UID
and PORTBUILD_GID . All 4 names are definable,
independent of the live system's definitions,
as one might be targeting something not matching
the live system's configuration. (It is an
independent jail instance for each builder.) At
least that is how I read the documentation.

That 65532 showed up for the user id, indicates
that you had the default for PORTBUILD_UID
show up for how you had things at that time.

It interesting that the group id still ended
up being 0 .

QUOTE
I'll note that "man 8 poudriere" says:

QUOTE
. . .
  Create optional poudriere.conf
    You can also specify an optional poudriere.conf that is pulled in
    depending on the build.  Any of the following are allowed and will all be
    used in the order shown:

          /usr/local/etc/poudriere.d/poudriere.conf
          /usr/local/etc/poudriere.d/<setname>-poudriere.conf
          /usr/local/etc/poudriere.d/<tree>-poudriere.conf
          /usr/local/etc/poudriere.d/<jailname>-poudriere.conf
          /usr/local/etc/poudriere.d/<tree>-<setname>-poudriere.conf
          /usr/local/etc/poudriere.d/<jailname>-<tree>-poudriere.conf
          /usr/local/etc/poudriere.d/<jailname>-<setname>-poudriere.conf
          /usr/local/etc/poudriere.d/<jailname>-<tree>-<setname>-poudriere.conf
. . .
FILES
    POUDRIERE_ETC/poudriere.conf              See self-documented
                                              /usr/local/etc/poudriere.conf.sample
                                              for example.
    POUDRIERE_ETC/poudriere.d/poudriere.conf  The configuration can be stored
                                              in the poudriere.d directory as
                                              well.
    POUDRIERE_ETC/poudriere.d                 This directory contains various
                                              configuration files for the
                                              different jails.
. . .
END QUOTE

What do you have for the content of:

/usr/local/etc/poudriere.conf

(or the like)?

/usr/local/etc/poudriere.conf.sample exists for
reference. Some of that is:

# Define to yes to build and stage as a regular user
# Default: yes, unless CCACHE_DIR is set and CCACHE_DIR_NON_ROOT_SAFE is not
# set.  Note that to use ccache with BUILD_AS_NON_ROOT you will need to
# use a non-shared CCACHE_DIR that is only built by PORTBUILD_USER and chowned
# to that user.  Then set CCACHE_DIR_NON_ROOT_SAFE to yes.
#BUILD_AS_NON_ROOT=no

# Define to the username and groupname to build as when BUILD_AS_NON_ROOT is yes.
# Default: nobody (uid PORTBUILD_UID)
#PORTBUILD_USER=nobody
#PORTBUILD_GROUP=nobody

# Define to the uid and gid to use for PORTBUILD_USER if the user does not
# already exist in the jail.
# Default: 65532
#PORTBUILD_UID=65534
#PORTBUILD_GID=65534

Are you happy with the documented defaults?

(Fair warning, I've always used
BUILD_AS_NON_ROOT=no so I've no experience.)
END QUOTE

Looks to me like if you had explicitly used
PORTBUILD_UID=0 you would have ended up with
the message:

Will build as mkru:wheel (0:0)

Looks like PORTBUILD_GID=0 could also be
assigned. These are likely for with
BUILD_AS_NON_ROOT=yes .

I'm less sure how much the PORTBUILD_USER and
PORTBUILD_GROUP names matter --or how they
might matter. There could be ports that
depend on the name text, I suppose.

> What is even more weird, the error message still says:
>  pkg-static: . wrong user or group ownership (expected 0/0 versus actual 1001/0)

Well then, the above may well still not be sufficient
for whatever is going on. Drat.

I'll still leave the above notes in place.


===
Mark Millard
marklmi at yahoo.com