diff mbox series

dev-manual: correct which package variables support which backends

Message ID 063e2bf1-5f48-3ea6-f18a-3d422af03a2f@crashcourse.ca
State New
Headers show
Series dev-manual: correct which package variables support which backends | expand

Commit Message

Robert P. J. Day June 12, 2026, 11:33 a.m. UTC
Update the section "Excluding packages from an image" to explain that
all packaging backends support all three package exclusion variables,
with the single exception that Debian packaging does not support
BAD_RECOMMENDATIONS.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>

---

  i tested with adding "minicom" to an image, then trying to exclude
its recommendation of "lrzsz".

Comments

Quentin Schulz June 12, 2026, 11:38 a.m. UTC | #1
Hi Robert,

On 6/12/26 1:33 PM, Robert P. J. Day via lists.yoctoproject.org wrote:
> 
> Update the section "Excluding packages from an image" to explain that
> all packaging backends support all three package exclusion variables,
> with the single exception that Debian packaging does not support
> BAD_RECOMMENDATIONS.
> 
> Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
> 
> ---
> 
>    i tested with adding "minicom" to an image, then trying to exclude
> its recommendation of "lrzsz".
> 
> diff --git a/documentation/dev-manual/packages.rst b/documentation/dev-manual/packages.rst
> index 500639565..80bcac0ba 100644
> --- a/documentation/dev-manual/packages.rst
> +++ b/documentation/dev-manual/packages.rst
> @@ -30,13 +30,10 @@ installed into an image. If so, you can use several variables to direct
>   the build system to essentially ignore installing recommended packages
>   or to not install a package at all.
> 
> -The following list introduces variables you can use to prevent packages
> -from being installed into your image. Each of these variables only works
> -with IPK and RPM package types, not for Debian packages.
> -Also, you can use these variables from your ``local.conf`` file
> -or attach them to a specific image recipe by using a recipe name
> -override. For more detail on the variables, see the descriptions in the
> -Yocto Project Reference Manual's glossary chapter.
> +There are three variables you can use to avoid installing particular
> +packages into the final image -- you can either set these variables
> +appropriately in your ``local.conf`` file, or attach them to a specific
> +image recipe by using a recipe name override.
> 

What do you mean by "recipe name override"?

Please do not say how many variables will be listed, we'll forget to 
update it if we add or remove some in the list below.

>   -  :term:`BAD_RECOMMENDATIONS`:
>      Use this variable to specify "recommended-only" packages that you do
> @@ -53,6 +50,19 @@ Yocto Project Reference Manual's glossary chapter.
>      prevent the installation of a package whose presence is required by
>      an installed package.
> 
> +.. warning::
> +
> +   All three of these package exclusion variables work with all three

Ditto.

> +   packaging backends (DEB, RPM and IPK) with one exception:

Don't think we need to list the package backends if it applies to them all.

> +   Debian packaging does not support the ``BAD_RECOMMENDATIONS`` setting.

Please always use :term`<var>` for variables that are present in the 
glossary. Here, :term:`BAD_RECOMMENDATIONS`.

> +   If you try that combination, you will get a warning similar to::
> +
> +      WARNING: core-image-minimal-1.0-r0 do_rootfs:
> +        Debian package install does not support BAD_RECOMMENDATIONS
> +
> +   All of the other combinations of packaging backend and exclusion
> +   variable are supported.
> +

You already said that above in other words: "All [...] work [...] with 
one exception", so necessarily the rest works and we don't need to 
repeat ourselves.

Cheers,
Quentin
Robert P. J. Day June 12, 2026, 11:44 a.m. UTC | #2
On Fri, 12 Jun 2026, Quentin Schulz via lists.yoctoproject.org wrote:

> Hi Robert,
>
> On 6/12/26 1:33 PM, Robert P. J. Day via lists.yoctoproject.org wrote:
> >
> > Update the section "Excluding packages from an image" to explain that
> > all packaging backends support all three package exclusion variables,
> > with the single exception that Debian packaging does not support
> > BAD_RECOMMENDATIONS.
> >
> > Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
> >
> > ---
> >
> >    i tested with adding "minicom" to an image, then trying to exclude
> > its recommendation of "lrzsz".
> >
> > diff --git a/documentation/dev-manual/packages.rst
> > b/documentation/dev-manual/packages.rst
> > index 500639565..80bcac0ba 100644
> > --- a/documentation/dev-manual/packages.rst
> > +++ b/documentation/dev-manual/packages.rst
> > @@ -30,13 +30,10 @@ installed into an image. If so, you can use several
> > variables to direct
> >   the build system to essentially ignore installing recommended packages
> >   or to not install a package at all.
> >
> > -The following list introduces variables you can use to prevent packages
> > -from being installed into your image. Each of these variables only works
> > -with IPK and RPM package types, not for Debian packages.
> > -Also, you can use these variables from your ``local.conf`` file
> > -or attach them to a specific image recipe by using a recipe name
> > -override. For more detail on the variables, see the descriptions in the
> > -Yocto Project Reference Manual's glossary chapter.
> > +There are three variables you can use to avoid installing particular
> > +packages into the final image -- you can either set these variables
> > +appropriately in your ``local.conf`` file, or attach them to a specific
> > +image recipe by using a recipe name override.
> >
>
> What do you mean by "recipe name override"?
>
> Please do not say how many variables will be listed, we'll forget to update it
> if we add or remove some in the list below.
>
> >   -  :term:`BAD_RECOMMENDATIONS`:
> >      Use this variable to specify "recommended-only" packages that you do
> > @@ -53,6 +50,19 @@ Yocto Project Reference Manual's glossary chapter.
> >      prevent the installation of a package whose presence is required by
> >      an installed package.
> >
> > +.. warning::
> > +
> > +   All three of these package exclusion variables work with all three
>
> Ditto.
>
> > +   packaging backends (DEB, RPM and IPK) with one exception:
>
> Don't think we need to list the package backends if it applies to them all.
>
> > +   Debian packaging does not support the ``BAD_RECOMMENDATIONS`` setting.
>
> Please always use :term`<var>` for variables that are present in the glossary.
> Here, :term:`BAD_RECOMMENDATIONS`.
>
> > +   If you try that combination, you will get a warning similar to::
> > +
> > +      WARNING: core-image-minimal-1.0-r0 do_rootfs:
> > +        Debian package install does not support BAD_RECOMMENDATIONS
> > +
> > +   All of the other combinations of packaging backend and exclusion
> > +   variable are supported.
> > +
>
> You already said that above in other words: "All [...] work [...] with one
> exception", so necessarily the rest works and we don't need to repeat
> ourselves.

  some of what you're referring to above was stolen verbatim from the
*existing* explanation, but i will process your suggestions. patch v2
coming shortly.

rday
Robert P. J. Day June 12, 2026, 11:57 a.m. UTC | #3
On Fri, 12 Jun 2026, Quentin Schulz wrote:

> Hi Robert,
>
> On 6/12/26 1:33 PM, Robert P. J. Day via lists.yoctoproject.org wrote:
> >
> > -The following list introduces variables you can use to prevent packages
> > -from being installed into your image. Each of these variables only works
> > -with IPK and RPM package types, not for Debian packages.
> > -Also, you can use these variables from your ``local.conf`` file
> > -or attach them to a specific image recipe by using a recipe name
> > -override. For more detail on the variables, see the descriptions in the
> > -Yocto Project Reference Manual's glossary chapter.
> > +There are three variables you can use to avoid installing particular
> > +packages into the final image -- you can either set these variables
> > +appropriately in your ``local.conf`` file, or attach them to a specific
> > +image recipe by using a recipe name override.
> >
>
> What do you mean by "recipe name override"?

  that phrasing was in the original explanation -- one can set, say,
PACKAGE_EXCLUDE either globally in local.conf:

  PACKAGE_EXCLUDE = "minicom"

or attach the exclusion to a specific image by using what the variable
glossary describes as a "recipe name override":

https://docs.yoctoproject.org/ref-manual/variables.html#term-PACKAGE_EXCLUDE

  PACKAGE_EXCLUDE:pn-<target image> = "minicom"

so the phrase "recipe name override" comes from the glossary ...
should it be called something else?

rday
Quentin Schulz June 12, 2026, 12:04 p.m. UTC | #4
Hi Robert,

On 6/12/26 1:57 PM, Robert P. J. Day wrote:
> On Fri, 12 Jun 2026, Quentin Schulz wrote:
> 
>> Hi Robert,
>>
>> On 6/12/26 1:33 PM, Robert P. J. Day via lists.yoctoproject.org wrote:
>>>
>>> -The following list introduces variables you can use to prevent packages
>>> -from being installed into your image. Each of these variables only works
>>> -with IPK and RPM package types, not for Debian packages.
>>> -Also, you can use these variables from your ``local.conf`` file
>>> -or attach them to a specific image recipe by using a recipe name
>>> -override. For more detail on the variables, see the descriptions in the
>>> -Yocto Project Reference Manual's glossary chapter.
>>> +There are three variables you can use to avoid installing particular
>>> +packages into the final image -- you can either set these variables
>>> +appropriately in your ``local.conf`` file, or attach them to a specific
>>> +image recipe by using a recipe name override.
>>>
>>
>> What do you mean by "recipe name override"?
> 
>    that phrasing was in the original explanation -- one can set, say,

Not verbatim, and it matters here.

> PACKAGE_EXCLUDE either globally in local.conf:
> 
>    PACKAGE_EXCLUDE = "minicom"
> 
> or attach the exclusion to a specific image by using what the variable

^^^^ here it says "to a specific image" and this patch here says "to a 
specific image recipe".

If you have a recipe name override in an image recipe, it either doesn't 
work or is useless:

my-image.bb:

BAD_RECOMMENDATIONS:pn-my-image = "test"

is unnecessary complexity for what is simply achieved the same with 
BAD_RECOMMENDATIONS = "test".

The phrasing could hint at:

my-image.bb:

BAD_RECOMMENDATIONS:pn-some-package-recipe = "test"

But this doesn't work, because a recipe (including an image recipe) 
variable scope is specific to the recipe and cannot impact another 
recipe, thus this is a no-op.

> glossary describes as a "recipe name override":
> 
> https://docs.yoctoproject.org/ref-manual/variables.html#term-PACKAGE_EXCLUDE
> 
>    PACKAGE_EXCLUDE:pn-<target image> = "minicom"
> 
> so the phrase "recipe name override" comes from the glossary ...
> should it be called something else?
> 

That's ok, it's just combined with the earlier part of the sentence 
which is confusing or misleading (so the other part of the sentence 
needs to be fixed).

Cheers,
Quentin
Robert P. J. Day June 12, 2026, 12:26 p.m. UTC | #5
On Fri, 12 Jun 2026, Quentin Schulz wrote:

> Hi Robert,
>
> On 6/12/26 1:57 PM, Robert P. J. Day wrote:
> > On Fri, 12 Jun 2026, Quentin Schulz wrote:
> >
> > > Hi Robert,
> > >
> > > On 6/12/26 1:33 PM, Robert P. J. Day via lists.yoctoproject.org wrote:
> > > >
> > > > -The following list introduces variables you can use to prevent packages
> > > > -from being installed into your image. Each of these variables only
> > > > works
> > > > -with IPK and RPM package types, not for Debian packages.
> > > > -Also, you can use these variables from your ``local.conf`` file
> > > > -or attach them to a specific image recipe by using a recipe name
> > > > -override. For more detail on the variables, see the descriptions in the
> > > > -Yocto Project Reference Manual's glossary chapter.
> > > > +There are three variables you can use to avoid installing particular
> > > > +packages into the final image -- you can either set these variables
> > > > +appropriately in your ``local.conf`` file, or attach them to a specific
> > > > +image recipe by using a recipe name override.
> > > >
> > >
> > > What do you mean by "recipe name override"?
> >
> >    that phrasing was in the original explanation -- one can set, say,
>
> Not verbatim, and it matters here.
>
> > PACKAGE_EXCLUDE either globally in local.conf:
> >
> >    PACKAGE_EXCLUDE = "minicom"
> >
> > or attach the exclusion to a specific image by using what the variable
>
> ^^^^ here it says "to a specific image" and this patch here says "to a
> specific image recipe".
>
> If you have a recipe name override in an image recipe, it either doesn't work
> or is useless:
>
> my-image.bb:
>
> BAD_RECOMMENDATIONS:pn-my-image = "test"
>
> is unnecessary complexity for what is simply achieved the same with
> BAD_RECOMMENDATIONS = "test".
>
> The phrasing could hint at:
>
> my-image.bb:
>
> BAD_RECOMMENDATIONS:pn-some-package-recipe = "test"
>
> But this doesn't work, because a recipe (including an image recipe) variable
> scope is specific to the recipe and cannot impact another recipe, thus this is
> a no-op.
>
> > glossary describes as a "recipe name override":
> >
> > https://docs.yoctoproject.org/ref-manual/variables.html#term-PACKAGE_EXCLUDE
> >
> >    PACKAGE_EXCLUDE:pn-<target image> = "minicom"
> >
> > so the phrase "recipe name override" comes from the glossary ...
> > should it be called something else?
> >
>
> That's ok, it's just combined with the earlier part of the sentence which is
> confusing or misleading (so the other part of the sentence needs to be fixed).

  i think that entire section needs to be reworked to explain all of
that *properly*, such as you might find those exclusion variables used
in your local.conf, or an image file, or a class file, and so on.

  i will ponder ... for now, i'll just send in a patch that corrects
the claims in the variable glossary, just so *that* stuff is correct.

rday
diff mbox series

Patch

diff --git a/documentation/dev-manual/packages.rst b/documentation/dev-manual/packages.rst
index 500639565..80bcac0ba 100644
--- a/documentation/dev-manual/packages.rst
+++ b/documentation/dev-manual/packages.rst
@@ -30,13 +30,10 @@  installed into an image. If so, you can use several variables to direct
 the build system to essentially ignore installing recommended packages
 or to not install a package at all.

-The following list introduces variables you can use to prevent packages
-from being installed into your image. Each of these variables only works
-with IPK and RPM package types, not for Debian packages.
-Also, you can use these variables from your ``local.conf`` file
-or attach them to a specific image recipe by using a recipe name
-override. For more detail on the variables, see the descriptions in the
-Yocto Project Reference Manual's glossary chapter.
+There are three variables you can use to avoid installing particular
+packages into the final image -- you can either set these variables
+appropriately in your ``local.conf`` file, or attach them to a specific
+image recipe by using a recipe name override.

 -  :term:`BAD_RECOMMENDATIONS`:
    Use this variable to specify "recommended-only" packages that you do
@@ -53,6 +50,19 @@  Yocto Project Reference Manual's glossary chapter.
    prevent the installation of a package whose presence is required by
    an installed package.

+.. warning::
+
+   All three of these package exclusion variables work with all three
+   packaging backends (DEB, RPM and IPK) with one exception:
+   Debian packaging does not support the ``BAD_RECOMMENDATIONS`` setting.
+   If you try that combination, you will get a warning similar to::
+
+      WARNING: core-image-minimal-1.0-r0 do_rootfs:
+        Debian package install does not support BAD_RECOMMENDATIONS
+
+   All of the other combinations of packaging backend and exclusion
+   variable are supported.
+
 Incrementing a Package Version
 ==============================