Bug 13949 - "libdir" QA test bombs out when adding a symlink into another package
Summary: "libdir" QA test bombs out when adding a symlink into another package
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: oe-core other (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 5.1
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-06-17 05:53 UTC by Yann Dirson
Modified: 2024-10-10 11:48 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yann Dirson 2020-06-17 05:53:56 UTC
In dunfell, building for an x86_64 target without multilib, one externally-built binary missed /lib64/ld-linux-x86-64.so.2, so I'm adding a symlink in a separate package using:

do_install_append_x86-64() {
    mkdir ${D}/lib64
    ln -s /lib/ld-linux-x86-64.so.2 ${D}/lib64/
}
FILES_${PN} += "/lib64/ld-linux-x86-64.so.2"


This explodes with the following:

ERROR: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:do_package_qa(d)
     0003:
File: '/home/yann/yocto/meta-blade/meta-shadow-os/poky/meta/classes/insane.bbclass', lineno: 1044, function: do_package_qa
     1040:    warn_checks, error_checks = parse_test_matrix("QARECIPETEST")
     1041:    package_qa_recipe(warn_checks, error_checks, pn, d)
     1042:
     1043:    if 'libdir' in d.getVar("ALL_QA").split():
 *** 1044:        package_qa_check_libdir(d)
     1045:
     1046:    qa_sane = d.getVar("QA_SANE")
     1047:    if not qa_sane:
     1048:        bb.fatal("QA run found fatal errors. Please consider fixing them.")
File: '/home/yann/yocto/meta-blade/meta-shadow-os/poky/meta/classes/insane.bbclass', lineno: 275, function: package_qa_check_libdir
     0271:                    if base_libdir not in rel_path:
     0272:                        # make sure it's an actual ELF file
     0273:                        elf = oe.qa.ELFFile(full_path)
     0274:                        try:
 *** 0275:                            elf.open()
     0276:                            messages.append("%s: found library in wrong location: %s" % (package, rel_path))
     0277:                        except (oe.qa.NotELFFileError):
     0278:                            pass
     0279:                if exec_re.match(rel_path):
File: '/home/yann/yocto/meta-blade/meta-shadow-os/poky/meta/lib/oe/qa.py', lineno: 55, function: open
     0051:        if self.data:
     0052:            self.data.close()
     0053:
     0054:    def open(self):
 *** 0055:        with open(self.name, "rb") as f:
     0056:            try:
     0057:                self.data = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
     0058:            except ValueError:
     0059:                # This means the file is empty


RDEPENDS_${PN} += "glibc" will not help.

Looks like I have to avoid this with INSANE_SKIP_${PN} += "libdir"
Comment 1 Randy MacLeod 2020-06-18 07:54:09 UTC
Don't check symlinks?
Comment 2 Randy MacLeod 2023-04-21 18:45:46 UTC
Moved en masse from 4.2 to 4.3 by Randy.
Comment 3 Ross Burton 2024-04-30 13:24:34 UTC
Reproducer:

do_install:append:class-target() {
    install -d ${D}${prefix}/lib ${D}${prefix}/lib64
    ln -s /something ${D}${prefix}/lib/libfoo.so.1
    ln -s /something ${D}${prefix}/lib64/libfoo.so.1
}
FILES:${PN} += "${prefix}/lib*"

File: '/home/rosbur01/Yocto/poky/meta/lib/oe/qa.py', lineno: 60, function: open
     0056:        if self.data:
     0057:            self.data.close()
     0058:
     0059:    def open(self):
 *** 0060:        with open(self.name, "rb") as f:
     0061:            try:
     0062:                self.data = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
     0063:            except ValueError:
     0064:                # This means the file is empty
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/work/ross/build/tmp/work/cortexa57-poky-linux/m4/1.4.19/packages-split/m4/usr/lib64/libfoo.so.1'
Comment 4 Ross Burton 2024-04-30 13:57:36 UTC
Posted 'insane: handle dangling symlinks in the libdir QA check' to the list.
Comment 5 Ross Burton 2024-10-10 11:48:39 UTC
Fixed in oe-core f044290f98ea66f2cecfbffd7d392dbc3d986da9.