Re: [docs] [PATCH] ref-manual: clarify use of "PACKAGE_ARCH" in a packagegroup
"Robert P. J. Day" <[email protected]>
| Newsgroups | org.yoctoproject.lists.docs |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 19 Jun 2026, Quentin Schulz wrote: > Hi Robert, > > On 6/16/26 6:46 PM, Robert P. J. Day via lists.yoctoproject.org wrote: > > > > Warn the developer that if they need to set "PACKAGE_ARCH" in a > > custom packagegroup file, that setting must precede the "inherit > > packagegroup" line in the packagegroup recipe file. > > > > Signed-off-by: Robert P. J. Day <[email protected]> > > > > --- > > > > diff --git a/documentation/ref-manual/classes.rst > > b/documentation/ref-manual/classes.rst > > index 95e07f85a..839a89d4b 100644 > > --- a/documentation/ref-manual/classes.rst > > +++ b/documentation/ref-manual/classes.rst > > @@ -2130,6 +2130,18 @@ section in the Yocto Project Development Tasks > > Manual. > > > > Previously, this class was called the ``task`` class. > > > > +.. note:: > > + > > + If you're defining a packagegroup and need to set:: > > + > > + PACKAGE_ARCH = ${MACHINE_ARCH} > > + > > OK so reading this I was like "but who would need to do this? packagegroups > are only supposed to include other packages and not compile anything! > > Then I looked in OE-Core, and there are as many packagegroups with > PACKAGE_ARCH set than without. It seems that the need comes from using > MACHINE_FEATURES or other knobs that depend on some configuration variable. > > I think it'd be nice to document this (if not already, but since you're > scouring the docs now maybe you'd come across something like that?). > > I'm thinking this is a big enough footgun that we may want to document the > order in the variable glossary as well. amusingly, the current packagegroup-core-base-utils.bb opens with the duplication: PACKAGE_ARCH = "${MACHINE_ARCH}" inherit packagegroup VIRTUAL-RUNTIME_vim ?= "vim-tiny" PACKAGE_ARCH = "${MACHINE_ARCH}" <==== ???? "git blame" shows that second line added 2019-07-23: packagegroup-core-base-utils: Make it machine specific Recipe makes use of the variable MACHINE_FEATURES, which is machine specific: ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "kbd", "", d)} then two days later, from the same person, the first line being added with the same commit message. i'm guessing that second assignment to PACKAGE_ARCH is unnecessary. rday