Upgrading to Yocto Honister

The Yocto 3.4 release (fall 2021), also codenamed “Honister” introduces a couple of breaking changes, mostly related to the syntax. You can take a look at the official migration guide.

The following errors and fixes have appeared while attempting to update a meta-layer to the current release.


Incorrect LAYERSERIES_COMPAT

Error message:

ERROR: Layer meta-amateurradio is not compatible with the core layer which only supports these series: honister (layer is compatible with hardknott dunfell)

Explanation: Each layer must declare the list of releases it is compatible with, to safeguard against mismatched configurations. See the upstream documentation about LAYERSERIES_COMPAT. Because we’re working with new Yocto versions, we’ll have to manually change the list of the compatible releases of the layer, inside the layer.conf file.

Fix:

vim poky/meta-amateurradio/conf/layer.conf
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -12,7 +12,7 @@ BBFILE_PRIORITY_meta-amateurradio = "6"
 LAYERDEPENDS_meta-amateurradio = "core"
 LAYERDEPENDS_meta-amateurradio += "openembedded-layer"
 
-LAYERSERIES_COMPAT_meta-amateurradio = "dunfell hardknott"
+LAYERSERIES_COMPAT_meta-amateurradio = "honister"
 
 BBFILES_DYNAMIC += " \
   qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/*/*/*.bb \

Incorrect syntax in conf/layer.conf

Error message:

ERROR: Variable DISTRO_FEATURES_append contains an operation using the old override syntax. Please convert this layer/metadata before attempting to use with a newer bitbake.
ERROR: Variable IMAGE_INSTALL_append contains an operation using the old override syntax. Please convert this layer/metadata before attempting to use with a newer bitbake.

Explanation: If the error text does not contain a specific filename where the error ocurred, probably it’s from the conf/layer.conf file, which was copied from another, previous version of yocto. The file must be changed, to be in line with the new syntax, as documented in the official migration guide.

Fix:

vim conf/local.conf
 EXTRA_IMAGE_FEATURES = "debug-tweaks ssh-server-dropbear package-management"
-DISTRO_FEATURES_append = " polkit wifi"
+DISTRO_FEATURES:append = " polkit wifi"
-FORTRAN_forcevariable = ",fortran"
+FORTRAN:forcevariable = ",fortran"
-IMAGE_INSTALL_append = " fldigi wsjtx js8call qsstv packagegroup-self-hosted gpredict csdr kalibrate-rtl"
+IMAGE_INSTALL:append = " fldigi wsjtx js8call qsstv packagegroup-self-hosted gpredict csdr kalibrate-rtl"
 BB_NUMBER_THREADS = "6"

Using the image-mklibs class

Error message:

ERROR: ParseError in configuration INHERITs: Could not inherit file classes/image-mklibs.bbclass

Explanation: The error can appear if you’re reusing conf/local.conf files from previous versions. In the Honister release, the image-mklibs class was removed. For reference, this commit explains the change. To correct it, just remove the image-mklibs from the list of used classes, in the conf/local.conf file.

Fix:

vim conf/local.conf
 SDKMACHINE = "x86_64"
-USER_CLASSES = "buildstats image-mklibs image-prelink"
+USER_CLASSES = "buildstats image-prelink"
 PATCHRESOLVE = "noop"

Not having all the build-tools installed

Error message:

ERROR: The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:
  lz4c pzstd zstd

Explanation: The list of build-host prerequisites has changed, so you must install the missing packages, prefferably using the distribution’s package manager. In my case, I’m using Ubuntu.

Fix:

sudo apt-get install zstd liblz4-tool # for Ubuntu Bionic or older
sudo apt-get install zstd lz4 # for Ubuntu Focal or newer

Not having the correct CONF_VERSION

Error message:

ERROR: 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:oecore_update_localconf(d)
     0003:
File: '.../poky/meta/classes/sanity.bbclass', lineno: 56, function: oecore_update_localconf
     0052:
     0053:is a good way to visualise the changes."""
     0054:    failmsg = d.expand(failmsg)
     0055:
 *** 0056:    raise NotImplementedError(failmsg)
     0057:}
     0058:
     0059:SANITY_SITECONF_SAMPLE ?= "${COREBASE}/meta*/conf/site.conf.sample"
     0060:python oecore_update_siteconf() {
Exception: NotImplementedError: Your version of local.conf was generated from an older/newer version of
local.conf.sample and there have been updates made to this file. Please compare the two
files and merge any changes before continuing.

Matching the version numbers will remove this message.

"meld conf/local.conf .../poky/meta*/conf/local.conf.sample"

is a good way to visualise the changes.

Explanation: Because of the syntax changes, the expected value of CONF_VERSION from the conf/local.conf file has been changed to 2. If you’ve reusing conf/local.conf files from previous releases, you must also increase this value.

Fix:

vim conf/local.conf
-CONF_VERSION = "1"
+CONF_VERSION = "2"
 PACKAGE_CLASSES = "package_rpm"
 SDKMACHINE = "x86_64"

Recipes using the deprecated syntax

Error message:

ERROR: .../poky/meta-amateurradio/recipes-ham/direwolf/direwolf_1.6.bb: Variable do_install_append contains an operation using the old override syntax. Please convert this layer/metadata before attempting to use with a newer bitbake.
ERROR: Failed to parse recipe: .../poky/meta-amateurradio/recipes-ham/direwolf/direwolf_1.6.bb

Explanation: This is caused by using the old syntax in recipes. The new syntax is presented in the official migration guide. Fortunately, the error message contains the offending layer, and the Yocto Project has published a script for upgrading entire layers at once. The script is placed in scripts/contrib/convert-overrides.py and receives as parameter the path of the layer that must be updated to the new syntax.

Fix:

cd poky
scripts/contrib/convert-overrides.py meta-amateurradio 

Recipes failing the “configure-unsafe” check

Error message:

ERROR: erlang-24.0.2-r0 do_configure: QA Issue: This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
Rerun configure task after fixing this. [configure-unsafe]
ERROR: erlang-24.0.2-r0 do_configure: Fatal QA errors found, failing task.

Explanation: The honister release added a new check that scans the logs and notifies the user if unexpected host-side paths have been referenced during the build process. It is a good idea to investigate the root cause, but you can also suppress the error message by adding the failing check to the INSANE_SKIP variable from the recipe.

Fix:

vim meta-erlang/recipes-devtools/erlang/erlang_24.0.2.bb
+INSANE_SKIP += "configure-unsafe"