agherzan / meta-raspberrypi

Yocto/OE BSP layer for the Raspberry Pi boards
https://www.yoctoproject.org/
MIT License
532 stars 410 forks source link

Build failed for `perl-5.30.1-r0` #980

Closed t0ny-peng closed 2 years ago

t0ny-peng commented 2 years ago

Description

I'm following the official instruction to build Yocto for RPi 4, however the build failed in perl_5.30.1.bb:do_package_write_rpm

Steps to reproduce the issue:

  1. Clone poky, meta-raspberrypi and meta-openembedded to ~/yocto/sources, then checkout to dunfell tag
  2. cd /yocto/sources && source poky/oe-init-build-env rpi-build
  3. Edit bblayers.conf:
    BBLAYERS ?= " \
     /home/ubuntu/yocto/sources/poky/meta \
     /home/ubuntu/yocto/sources/poky/meta-poky \
     /home/ubuntu/yocto/sources/poky/meta-yocto-bsp \
     /home/ubuntu/yocto/sources/meta-raspberrypi \
     /home/ubuntu/yocto/sources/meta-openembedded/meta-oe \
     /home/ubuntu/yocto/sources/meta-openembedded/meta-multimedia \
     /home/ubuntu/yocto/sources/meta-openembedded/meta-networking \
     /home/ubuntu/yocto/sources/meta-openembedded/meta-python \
     "
  4. Set MACHINE ?= "raspberrypi4-64" in conf/local.conf
  5. `bitbake core-image-base

Describe the results you received:

The compilation failed around 95% with the following message.

ERROR: perl-5.30.1-r0 do_package_write_rpm: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:do_package_rpm(d)
     0003:
File: '/home/ubuntu/yocto/sources/poky/meta/classes/package_rpm.bbclass', lineno: 712, function: do_package_rpm
     0708:
     0709:    # Build the rpm package!
     0710:    d.setVar('BUILDSPEC', cmd + "\n" + cleanupcmd + "\n")
     0711:    d.setVarFlag('BUILDSPEC', 'func', '1')
 *** 0712:    bb.build.exec_func('BUILDSPEC', d)
     0713:
     0714:    if d.getVar('RPM_SIGN_PACKAGES') == '1':
     0715:        bb.build.exec_func("sign_rpm", d)
     0716:}
File: '/home/ubuntu/yocto/sources/poky/bitbake/lib/bb/build.py', lineno: 254, function: exec_func
     0250:    with bb.utils.fileslocked(lockfiles):
     0251:        if ispython:
     0252:            exec_func_python(func, d, runfile, cwd=adir)
     0253:        else:
 *** 0254:            exec_func_shell(func, d, runfile, cwd=adir)
     0255:
     0256:    try:
     0257:        curcwd = os.getcwd()
     0258:    except:
File: '/home/ubuntu/yocto/sources/poky/bitbake/lib/bb/build.py', lineno: 455, function: exec_func_shell
     0451:    with open(fifopath, 'r+b', buffering=0) as fifo:
     0452:        try:
     0453:            bb.debug(2, "Executing shell function %s" % func)
     0454:            with open(os.devnull, 'r+') as stdin, logfile:
 *** 0455:                bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)])
     0456:        finally:
     0457:            os.unlink(fifopath)
     0458:
     0459:    bb.debug(2, "Shell function %s finished" % func)
File: '/home/ubuntu/yocto/sources/poky/bitbake/lib/bb/process.py', lineno: 184, function: run
     0180:
     0181:    if pipe.returncode != 0:
     0182:        if log:
     0183:            # Don't duplicate the output in the exception if logging it
 *** 0184:            raise ExecutionError(cmd, pipe.returncode, None, None)
     0185:        raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
     0186:    return stdout, stderr
Exception: bb.process.ExecutionError: Execution of '/home/ubuntu/yocto/sources/rpi-build/tmp/work/aarch64-poky-linux/perl/5.30.1-r0/temp/run.BUILDSPEC.22$
3133' failed with exit code 1

ERROR: Logfile of failure stored in: /home/ubuntu/yocto/sources/rpi-build/tmp/work/aarch64-poky-linux/perl/5.30.1-r0/temp/log.do_package_write_rpm.2293133
ERROR: Task (/home/ubuntu/yocto/sources/poky/meta/recipes-devtools/perl/perl_5.30.1.bb:do_package_write_rpm) failed with exit code '1'
...
Summary: 1 task failed:
  /home/ubuntu/yocto/sources/poky/meta/recipes-devtools/perl/perl_5.30.1.bb:do_package_write_rpm

Describe the results you expected:

The build should succeed.

Additional information you deem important (e.g. issue happens only occasionally):

Here's the log file containing the error message of perl

log.do_package_write_rpm.2293133.log

Additional details (revisions used, host distro, etc.):

Host: Ubuntu 20.04

t0ny-peng commented 2 years ago

Upon checking the error message, it seems that something dependencies are out dates.

RPM build errors:
    Deprecated external dependency generator is used!

I was able to finish the build with commands coming from this post:

https://stackoverflow.com/questions/69726046/bitbake-build-fails-because-of-a-python-function