Skip to contentSkip to conversation

Build libpwquality without distutils3

DISCUSSION Joseph Reynolds 2 participants 2 messages Feb 9, 2021

lore
Share & tools
lore
#0 lore raw

Dear openembedded-core members,

How can I avoid bringing Python into my image via libpwquality?  I need to keep my image size small.  My bbappend uses EXTRA_OECONF += "--enable-python-bindings=no" to take advantage of the source project's configuration option [1], but because libpwquality_1.4.4.bb [2] imports distutil3-base, my image gets Python.  I built a working proof of concept that libpwquality does not need Python here: [3].

I tried enhancing libpwquality_1.4.4.bb with PACKAGECONFIG "python-bindings" (so my bbappend can use PACKAGECONFIG_remove="python-bindings") but can't find a way to get the final value of PACKAGECONFIG to conditionally inherit distutils3-base.  So I am asking for help.

How can I avoid bringing in Python via libpwquality?

I am also curious if anyone else is interested in changing the default install location for libpwquality.so to /lib/security/ (where Yocto/Poky defaults to /usr/lib/security).

- Joseph

[1]: https://github.com/libpwquality/libpwquality/blob/master/configure.ac#L119
[2]: https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-extended/libpwquality/libpwquality_1.4.4.bb
[3]: https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/40102/4..5/meta-openembedded/meta-oe/recipes-extended/libpwquality/libpwquality_1.4.4.bb#21

#1 lore raw
Quoted 9 lines · Joseph Reynolds

Dear openembedded-core members,

How can I avoid bringing Python into my image via libpwquality?  I need to keep my image size small.  My bbappend uses EXTRA_OECONF += "--enable-python-bindings=no" to take advantage of the source project's configuration option [1], but because libpwquality_1.4.4.bb [2] imports distutil3-base, my image gets Python.  I built a working proof of concept that libpwquality does not need Python here: [3].

Quoted 7 lines

I tried enhancing libpwquality_1.4.4.bb with PACKAGECONFIG "python-bindings" (so my bbappend can use PACKAGECONFIG_remove="python-bindings") but can't find a way to get the final value of PACKAGECONFIG to conditionally inherit distutils3-base.  So I am asking for help.

How can I avoid bringing in Python via libpwquality?

distutils3-base looks rather simple. Offhand, you could:

a) remove python3-core from RDEPENDS when the appropriate PACKAGECONFIG is set using the remove operator

b) replace the distutils3-base with the other inherits directly and rewrite the RDEPENDS code to be conditions

c) propose a patch to allow the RDEPENDS to be indirected via another variable?

Some of these work from bbappends, some are more neater but take a bit more work to sort out.

Cheers,

Richard