Yocto构建core-image-weston遇RPROVIDES依赖错误求助
解决Yocto构建树莓派4B Qt6 Widget应用镜像的依赖错误
问题背景
- 目标:为树莓派4B构建可运行Qt6 Widget应用的Yocto镜像,此前的
core-image-minimal因过于精简,无法启动Weston及预编入的Qt应用 - 构建环境:VirtualBox下的Linux Mint(已知未通过Yocto官方测试,考虑更换为Ubuntu)
当前配置
conf/local.conf 配置内容
IMAGE_INSTALL += "qtexample" DISTRO_FEATURES:append = "wayland" IMAGE_INSTALL:append = "qtbase qtwayland" CORE_IMAGE_EXTRA_INSTALL += "wayland weston"
- 已添加层:Qt6层、
meta-openembedded/meta-oe、meta-openembedded/meta-python、树莓派BSP层(均配置在conf/bblayers.conf中) qtexample为自定义Qt6应用配方,用于编入镜像
构建错误日志
第一次构建错误
ERROR: Nothing RPROVIDES 'matchbox-terminalqtexampleqtbase' (but /home/bkeohane/Projekte/yocto/poky/meta/recipes-graphics/images/core-image-weston.bb RDEPENDS on or otherwise requires it) NOTE: Runtime target 'matchbox-terminalqtexampleqtbase' is unbuildable, removing... Missing or unbuildable dependency chain was: ['matchbox-terminalqtexampleqtbase'] ERROR: Required build target 'core-image-weston' has no buildable providers. Missing or unbuildable dependency chain was: ['core-image-weston', 'matchbox-terminalqtexampleqtbase']
尝试修复后的第二次错误
将matchbox-terminal_0.2.bb配方从poky/meta/recipes-sato复制到poky/meta/recipes-graphics后,错误变为:
ERROR: Nothing RPROVIDES 'qtexampleqtbase' (but /home/bkeohane/Projekte/yocto/poky/meta/recipes-graphics/images/core-image-weston.bb RDEPENDS on or otherwise requires it) NOTE: Runtime target 'qtexampleqtbase' is unbuildable, removing... Missing or unbuildable dependency chain was: ['qtexampleqtbase'] ERROR: Required build target 'core-image-weston' has no buildable providers. Missing or unbuildable dependency chain was: ['core-image-weston', 'qtexampleqtbase']
困惑点
查看core-image-weston.bb配方,未找到matchbox-terminalqtexampleqtbase或qtexampleqtbase相关依赖定义:
SUMMARY = "A very basic Wayland image with a terminal" IMAGE_FEATURES += "splash package-management ssh-server-dropbear hwcodecs weston" LICENSE = "MIT" inherit core-image CORE_IMAGE_BASE_INSTALL += "gtk+3-demo" CORE_IMAGE_BASE_INSTALL += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'weston-xwayland matchbox-terminal', '', d)}" QB_MEM = "-m 512"
解决建议
修复配置语法错误
错误日志中出现的matchbox-terminalqtexampleqtbase这类粘连包名,是IMAGE_INSTALL:append的语法错误导致的——append操作符后必须添加空格,否则新内容会直接拼接在原有内容末尾,造成包名混乱。
修正后的conf/local.conf:IMAGE_INSTALL += "qtexample" DISTRO_FEATURES:append = " wayland" # wayland前添加空格 IMAGE_INSTALL:append = " qtbase qtwayland" # 开头添加空格 CORE_IMAGE_EXTRA_INSTALL += "wayland weston"恢复官方配方位置
无需移动matchbox-terminal配方,Yocto会自动扫描已添加层的所有配方目录,随意移动官方文件会破坏层结构。建议将复制的文件移回poky/meta/recipes-sato原位置。验证Qt6层与自定义配方
- 确保使用的Qt6层(如
meta-qt6)与当前Yocto版本分支兼容(例如Yocto Kirkstone对应meta-qt6的Kirkstone分支) - 检查
qtexample配方的正确性:文件名需为qtexample_<版本号>.bb,配方中需正确继承qt6-cmake或对应Qt构建类,确保Yocto能识别并构建该包。可通过bitbake-layers show-recipes qtexample命令验证配方是否被识别。
- 确保使用的Qt6层(如
更换构建环境
Linux Mint未经过Yocto官方测试,建议更换为Ubuntu LTS版本(如22.04),减少环境兼容性问题。检查依赖识别
使用bitbake-layers show-recipes qtbase命令确认qtbase配方是否被正确识别,若输出为空则说明层配置存在问题。
内容的提问来源于stack exchange,提问作者Ironside
相关产品推荐
相关产品推荐

