aws4embeddedlinux/meta-aws

Question: Why does Corretto rdepend on X11?

MartinLoeper opened this issue · 4 comments

I am currently building greengrass-bin on kirkstone and it complains that distro feature X11 is disabled.
I checked and confirmed we do not need X11 at all for our distro.

I also confirmed that X11 is needed by corretto since 8fd1009. Is there any chance to work around this runtime dependency? It feels like a really heavy dependency for an IoT device...

ERROR: Nothing RPROVIDES 'libxext' (but /build/../work/meta-aws/recipes-devtools/amazon-corretto/corretto-11-bin_11.0.12.7.1.bb RDEPENDS on or otherwise requires it)
libxext was skipped: missing required distro feature 'x11' (not in DISTRO_FEATURES)
NOTE: Runtime target 'libxext' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['libxext']
NOTE: Runtime target 'corretto-11-bin' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['corretto-11-bin', 'libxext']
NOTE: Runtime target 'greengrass-bin' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['greengrass-bin', 'corretto-11-bin', 'libxext']

Hi, did spend some time on investigation, but don't have a full nice solution yet - some of this must also be discussed internally.
The root cause of this problem is that when you build your image with PACKAGE_CLASSES ?= "package_rpm", which is the default, then the dnf tool which is used in the image creation phase will throw an error message.

 Problem: conflicting requests                                                                                                                                                                                     
  - nothing provides libGL.so.1()(64bit) needed by corretto-8-bin-8.332.08.1-r0.core2_64                                                                                                                           
  - nothing provides libX11.so.6()(64bit) needed by corretto-8-bin-8.332.08.1-r0.core2_64                                                                                                                          
  ...

This is because the corretto-*-bin packages contain also binaries, which are linked against those missing libs.
If you use package_ipk there are no such checks.
In this case the recipe could be modified with something like this:
RDEPENDS:${PN} += " \ ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'libasound', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'cairo pango gtk+ libgl libxi libxtst', '', d)} \ "
But what's the correct solution for package_rpm is under investigation - thank you for this report.

I see. Thanks for looking into it and confirming @thomas-roos!

I enabled X11 distro feature and it works now.
However, it almost doubled our rootfs size. This is definitely a workaround :(

good news - I think I found a good solution for now: 2ca105f
please try (make modifications manually, cherry-pick) and give feedback.
Will take some time till it's in kirkstone branch, but knowing it's a working solution it might speed up the process.

I tested it on kirkstone and it seems to work well. Great job!!!! Thanks a lot!
I will report if I observe any issue.