Bug 3782

Summary: mklibs fails when building optimized image
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Andre Schramm <andre.schramm>
Component: devtools / tool chainAssignee: Leonardo Sandoval Gonzalez <leonardo.sandoval.gonzalez>
Status: VERIFIED FIXED QA Contact: Bogdan Alexandru Voiculescu <bogdanx.a.voiculescu>
Severity: normal    
Priority: Medium CC: bogdanx.a.voiculescu, meta.mr.watcher, meta.watcher, richard.purdie, sgw
Version: 1.3   
Target Milestone: 1.9 M2   
Hardware: x86   
OS: x86_64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Andre Schramm 2013-01-23 14:41:45 UTC
Baking core-image-minimal with IMAGE_FEATURES += "splash x11", tuned for core2_64 and local.conf with:

USER_CLASSES ?= "buildstats image-mklibs image-prelink"
MKLIBS_OPTIMIZED_IMAGES ?= "all"


Python dies in build/tmp/sysroots/x86_64-linux/usr/bin/mklibs:343:

    default_lib_path = multiarch(["/lib/", "/usr/lib/", "/usr/X11R6/lib/"])

with

    "OSError: [Errno 2] No such file or directory"

Problem is mklibs:265:

    dpkg_architecture = subprocess.Popen(
        ['dpkg-architecture', '-qDEB_HOST_MULTIARCH'],
        stdout=subprocess.PIPE, stderr=devnull)

as it does not check for dpkg-architecture being present first.

Installing dpkg-devel manually fixes this (CentOS 6), but this is not listed in the docs as prerequisite. This dependency seems to be added/fixed in mklibs 1.35. [1]
use-host.patch for apt recipe completely discards dpkg-architecture and uses a workaround.

I default-tuned for generic x64 before core2_64 and the problem did not show up there.


The next problem is:

    cp: target `build/ipc/tmp/work/ipc-poky-linux/core-image-minimal-1.0-r0/rootfs/usr/lib64/libX11.so.6' is not a directory


I added some debug output to mklibs, but can't figure what's wrong here and/or where "cp" is called.


[1] http://bazaar.launchpad.net/~ubuntu-installer/mklibs/master/revision/97
Comment 1 Mark Hatle 2014-04-01 14:49:45 UTC
Investigate if mklibs is still required when we do 1.7 planning.  This may remove the necessity of this bug.
Comment 2 Stephen K Jolley 2014-11-06 16:09:37 UTC
Mark, Is this bug still required.
Comment 3 Mark Hatle 2014-12-08 19:55:53 UTC
mklibs is broken in some configurations.  I have not researched this in a while.  It's unclear to me how many people are using functionality to generate very small systems.
Comment 4 Mark Hatle 2015-04-28 18:10:37 UTC
To set a properly 1.9 milestone (or close this out) we need to understand if mklibs is still being used in any configurations.

If it's not, I'd suggest removing it due to lack of proper maintainer.
Comment 5 Stephen K Jolley 2015-04-28 20:42:46 UTC
Mark Hatle also noted that we should check w/ the Tiny Linux / Micro Linux initiative.
Comment 6 Richard Purdie 2015-04-30 14:39:47 UTC
I think we will have need for mklibs so we can't remove it just yet. I believe someone in GDC has some debian knowledge which may help in looking into how we can remove the dpkg-architecture call.
Comment 7 Leonardo Sandoval Gonzalez 2015-06-09 20:54:56 UTC
(In reply to comment #0)
> Baking core-image-minimal with IMAGE_FEATURES += "splash x11", tuned for
> core2_64 and local.conf with:
> 
> USER_CLASSES ?= "buildstats image-mklibs image-prelink"
> MKLIBS_OPTIMIZED_IMAGES ?= "all"
> 
Andre, can you send me your full local.conf or any general configuration I need to take into account? The point is that I have not seen the problems you are describing below.

> 
> Python dies in build/tmp/sysroots/x86_64-linux/usr/bin/mklibs:343:
> 
>     default_lib_path = multiarch(["/lib/", "/usr/lib/", "/usr/X11R6/lib/"])
> 
> with
> 
>     "OSError: [Errno 2] No such file or directory"
> 
> Problem is mklibs:265:
> 
>     dpkg_architecture = subprocess.Popen(
>         ['dpkg-architecture', '-qDEB_HOST_MULTIARCH'],
>         stdout=subprocess.PIPE, stderr=devnull)
> 
> as it does not check for dpkg-architecture being present first.
> 
> Installing dpkg-devel manually fixes this (CentOS 6), but this is not listed
> in the docs as prerequisite. This dependency seems to be added/fixed in
> mklibs 1.35. [1]
> use-host.patch for apt recipe completely discards dpkg-architecture and uses
> a workaround.
> 
> I default-tuned for generic x64 before core2_64 and the problem did not show
> up there.
> 
> 
> The next problem is:
> 
>     cp: target
> `build/ipc/tmp/work/ipc-poky-linux/core-image-minimal-1.0-r0/rootfs/usr/
> lib64/libX11.so.6' is not a directory
> 
> 
> I added some debug output to mklibs, but can't figure what's wrong here
> and/or where "cp" is called.
> 
> 
> [1] http://bazaar.launchpad.net/~ubuntu-installer/mklibs/master/revision/97
Comment 8 Leonardo Sandoval Gonzalez 2015-08-10 15:07:40 UTC
Fixed with OE-Core 00a706e69c8cb9daf8458ee76aa4aedd8699f5a4
Comment 9 Bogdan Alexandru Voiculescu 2015-09-11 14:20:48 UTC
verified on master: d4585fa23d56a58c583ee33db067a23177a936b1