Topics

Using RDEPENDS in bbappend files to install additional packages?


Robert P. J. Day
 

Another question regarding recipe/coding style (based on actual
examples I run across in existing code bases).

In one vendor's layer, in file "lighttpd_1.4.%.bbappend", I read:

RDEPENDS_${PN} += " \
lighttpd-module-alias \
lighttpd-module-auth \
lighttpd-module-cgi \
lighttpd-module-compress \
lighttpd-module-evasive \
lighttpd-module-evhost \
... sizable snip of many ore modules ...

There's little question that this is being used to incorporate a
number of optional modules into the final image, but I'm assuming
that this is really not the recommended way to do it.

The YP reference manual defines RDEPENDS as identifying "other
packages that must be installed in order for the package to function
correctly," which suggests that it's the base recipe that should
define actual runtime dependencies.

I would have thought that the natural way to do the above would
be to either use IMAGE_INSTALL_append or (my preference) define
a packagegroup that includes all those packages, then simply
include the packagegroup.

In short, am I reasonable in assuming that bbappend files should
not (ab)use RDEPENDS in the above way?

rday


Quentin Schulz
 

Hi Robert,

On Mon, Oct 19, 2020 at 09:06:39AM -0400, Robert P. J. Day wrote:
Another question regarding recipe/coding style (based on actual
examples I run across in existing code bases).

In one vendor's layer, in file "lighttpd_1.4.%.bbappend", I read:

RDEPENDS_${PN} += " \
lighttpd-module-alias \
lighttpd-module-auth \
lighttpd-module-cgi \
lighttpd-module-compress \
lighttpd-module-evasive \
lighttpd-module-evhost \
... sizable snip of many ore modules ...

There's little question that this is being used to incorporate a
number of optional modules into the final image, but I'm assuming
that this is really not the recommended way to do it.

The YP reference manual defines RDEPENDS as identifying "other
packages that must be installed in order for the package to function
correctly," which suggests that it's the base recipe that should
define actual runtime dependencies.

I would have thought that the natural way to do the above would
be to either use IMAGE_INSTALL_append or (my preference) define
a packagegroup that includes all those packages, then simply
include the packagegroup.

In short, am I reasonable in assuming that bbappend files should
not (ab)use RDEPENDS in the above way?
I'd say they either should be added to IMAGE_INSTALL one by one, or
being put into a packagegroup or even use RRECOMMENDS instead of
RDEPENDS. To me, it feels wrong too, if it's really not a need, they
should not be in RDEPENDS.

Quentin


Chuck Wolber
 

Apologies for the marginally related reply, but the provided example triggered a reminder of a best practice we started doing that had some significant maintainability benefits.

Instead of this pattern:

RDEPENDS_${PN} += " \
         lighttpd-module-alias \
         lighttpd-module-auth \
         lighttpd-module-cgi \
         lighttpd-module-compress \
         lighttpd-module-evasive \
         lighttpd-module-evhost \


We found that this pattern made it significantly easier to manage recipes, as well as use common command line tools like grep/sed/awk, without having to deal with the complexities of multi-line processing. It also helped make git commits and patches much more focused and readable.

RDEPENDS_${PN} += " lighttpd-module-alias"
RDEPENDS_${PN} += " lighttpd-module-auth"
RDEPENDS_${PN} += " lighttpd-module-cgi"
RDEPENDS_${PN} += " lighttpd-module-compress"
RDEPENDS_${PN} += " lighttpd-module-evasive"
RDEPENDS_${PN} += " lighttpd-module-evhost"

..Ch:W..


On Mon, Oct 19, 2020 at 6:12 AM Quentin Schulz <quentin.schulz@...> wrote:
Hi Robert,

On Mon, Oct 19, 2020 at 09:06:39AM -0400, Robert P. J. Day wrote:
> Another question regarding recipe/coding style (based on actual
> examples I run across in existing code bases).
>
> In one vendor's layer, in file "lighttpd_1.4.%.bbappend", I read:
>
>   RDEPENDS_${PN} += " \
>         lighttpd-module-alias \
>         lighttpd-module-auth \
>         lighttpd-module-cgi \
>         lighttpd-module-compress \
>         lighttpd-module-evasive \
>         lighttpd-module-evhost \
>         ... sizable snip of many ore modules ...
>
> There's little question that this is being used to incorporate a
> number of optional modules into the final image, but I'm assuming
> that this is really not the recommended way to do it.
>
> The YP reference manual defines RDEPENDS as identifying "other
> packages that must be installed in order for the package to function
> correctly," which suggests that it's the base recipe that should
> define actual runtime dependencies.
>
> I would have thought that the natural way to do the above would
> be to either use IMAGE_INSTALL_append or (my preference) define
> a packagegroup that includes all those packages, then simply
> include the packagegroup.
>
> In short, am I reasonable in assuming that bbappend files should
> not (ab)use RDEPENDS in the above way?
>

I'd say they either should be added to IMAGE_INSTALL one by one, or
being put into a packagegroup or even use RRECOMMENDS instead of
RDEPENDS. To me, it feels wrong too, if it's really not a need, they
should not be in RDEPENDS.

Quentin





--
"Perfection must be reached by degrees; she requires the slow hand of time." - Voltaire