Created attachment 5061 [details] Patch to break hard runtime dependency on perl Hello, I build an image with Postgresql in it via the meta-openembedded recipe: https://github.com/openembedded/meta-openembedded/blob/scarthgap/meta-oe/recipes-dbs/postgresql/postgresql.inc#L40 said recipe inherits cpan-base. cpan-base.bbclass (https://git.yoctoproject.org/poky/tree/meta/classes-recipe/cpan-base.bbclass?h=scarthgap#n14) adds an RDEPEND for perl to the non-native package. This results in perl being installed in my rootfs, which is not desired for CVEs, image size, etc. I have 'PACKAGECONFIG:remove = "perl"' in my local.conf and I've verified that postgresql itself is actually configuring with the flag --without-perl, but postgresql.do_prepare_recipe_sysroot adds a dependency on perl. I've created an attached patch (0001-cpan-base-Only-RDEPEND-on-perl-if-using-perl.patch) that limits the perl runtime dependency based on the PACKAGECONFIG of the package that inherits cpan-base, but I'm not certain such action is wise. Is there a better way to have postgresql in my image and not have perl? Thanks!
The patch is a good start, Ross is going to comment on how to proceed. This isn't a oe-core recipe so since the changes are likely only to the recipe, we're going to reject the bug for now.
You can't check a PACKAGECONFIG in a base class unless its a well known and defined PACKAGECONFIG, which 'perl' is not. The cpan class is designed for recipes that fetch perl modules from cpan, so that class depending on perl makes sense. I can't see why the postgresql recipe actually pulls that class in at all. Would you be able to test a build of postgresql with perl enabled, but change the cpan-base inherit to perl-version?
I'd suggest removing cpan-base from: https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-dbs/postgresql/postgresql.inc#n40 And add a line where the inherit conditionally happens if the perl PACKAGECONFIG is set. And please send patches to the mailing list: https://git.openembedded.org/meta-openembedded/tree/meta-oe/README.md
(In reply to Ross Burton from comment #2) > You can't check a PACKAGECONFIG in a base class unless its a well known and > defined PACKAGECONFIG, which 'perl' is not. Thanks for the explanation. I figured patch was sketchy. > The cpan class is designed for recipes that fetch perl modules from cpan, so > that class depending on perl makes sense. > > I can't see why the postgresql recipe actually pulls that class in at all. > Would you be able to test a build of postgresql with perl enabled, but > change the cpan-base inherit to perl-version? Swapping cpan-base to perl-version in the inherit leads to: Traceback (most recent call last): File "Var <PERLCONFIGTARGET>", line 1, in <module> bb.data_smart.ExpansionError: Failure expanding variable PERLCONFIGTARGET, expression was ${@is_target(d)} which triggered exception NameError: name 'is_target' is not defined The variable dependency chain for the failure is: PERLCONFIGTARGET Since they call that is_target function on https://github.com/openembedded/meta-openembedded/blob/scarthgap/meta-oe/recipes-dbs/postgresql/postgresql.inc#L126
Just for administrative housekeeping; I submitted a patch to meta-openembedded: https://github.com/openembedded/meta-openembedded/commit/f311f1f01c19924d8cced61fa915f1387f92455b Thanks!