Search code examples
pythonyoctorecipe

Yocto recipe written in python giving me an error when trying to build with Bitbake


It's the first time i have come across a recipe file written in python and it's giving me an error. The error is:

../meta-intel/recipes-rt/images/core-image-rt.bb: Error executing a python function in <code>:

This is a recipe which is coming from the meta-intel branch "[master] intel-vaapi-driver: 2.1.0 -> 2.2.0".

My poky version is" [morty] documentation: Updated manual revision table for 2.2.4 release date.

My BITBAKE version is: "BitBake Build Tool Core version 1.32.0"

The contents of core-image-rt.bb are:

    require recipes-core/images/core-image-minimal.bb

# Skip processing of this recipe if linux-intel-rt is not explicitly specified as the
# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
# to build multiple virtual/kernel providers.
python () {
    if d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-intel-rt":
        raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-intel-rt to enable it")
}

DESCRIPTION = "A small image just capable of allowing a device to boot plus a \
real-time test suite and tools appropriate for real-time use."
DEPENDS += "linux-intel-rt"

IMAGE_INSTALL += "rt-tests hwlatdetect"

LICENSE = "MIT"

If you need any additional information please let me know and i'll try and supply it.

I can normally build images on my ubuntu machine but don't believe have ever had to build an image in which the recipes were written in python


Solution

  • You are using incompatible API of using g.getVar method. In morty release as the last one with old way of using second parameter, there is still need to provide boolean parameter:

    ...
    if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-intel-rt":
    ...
    

    Please take a look at one of the commit, that remove this in next releases.