Yocto 3.1.10通过bbappend打补丁构建python3-wsgiref依赖报错问题
问题核心原因
poky中的python3配方是在bitbake配方加载阶段读取python3-manifest.json文件内容,自动生成各个python3子包(如python3-core、python3-xml等)的配置(包括包名、依赖、包含文件等)。
- 直接修改poky源码里的
python3-manifest.json,相当于在bitbake加载python3配方之前就修改了源文件,加载阶段可以读到新增的wsgiref配置,正常生成python3-wsgiref子包。 - 通过补丁修改的方式,补丁是在python3的构建阶段do_patch任务才会被应用到工作目录的manifest文件上,此时bitbake早就完成了配方加载、子包列表生成的流程,根本不知道有wsgiref这个子包的存在,所以不会生成
python3-wsgiref包,最终rootfs阶段就会提示找不到该依赖。
解决办法
推荐使用更简单的手动定义子包方案,不需要补丁,直接修改你的python3_3.8.11.bbappend文件,内容替换为以下:
# 手动定义python3-wsgiref子包 PACKAGES += "python3-wsgiref" SUMMARY_python3-wsgiref = "Web Server Gateway Interface Reference Implementation" RDEPENDS_python3-wsgiref = "\ python3-core \ python3-crypt \ python3-datetime \ python3-email \ python3-html \ python3-io \ python3-math \ python3-mime \ python3-netclient \ python3-netserver \ python3-stringold \ " FILES_python3-wsgiref = "\ ${libdir}/python${PYTHON_MAJMIN}/wsgiref/handlers.py \ ${libdir}/python${PYTHON_MAJMIN}/wsgiref/headers.py \ ${libdir}/python${PYTHON_MAJMIN}/wsgiref/simple_server.py \ ${libdir}/python${PYTHON_MAJMIN}/wsgiref/util.py \ ${libdir}/python${PYTHON_MAJMIN}/wsgiref/validate.py \ ${libdir}/python${PYTHON_MAJMIN}/wsgiref/__pycache__ \ ${libdir}/python${PYTHON_MAJMIN}/wsgiref/__pycache__/handlers.*.pyc \ ${libdir}/python${PYTHON_MAJMIN}/wsgiref/__pycache__/headers.*.pyc \ ${libdir}/python${PYTHON_MAJMIN}/wsgiref/__pycache__/simple_server.*.pyc \ ${libdir}/python${PYTHON_MAJMIN}/wsgiref/__pycache__/util.*.pyc \ ${libdir}/python${PYTHON_MAJMIN}/wsgiref/__pycache__/validate.*.pyc \ "
修改完成后,先清理python3的历史构建缓存:
bitbake python3 -c cleansstate
再重新构建你的镜像即可正常解决依赖问题。
内容的提问来源于stack exchange,提问作者Imanoid
相关产品推荐
相关产品推荐

