Ubuntu 22.04.2 LTS下如何禁用Bitbake的sanity checker?
系统环境为Ubuntu 22.04.2 LTS,通过Jenkins任务执行bitbake <image>命令时构建失败,错误信息如下:
ERROR: OE-core's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
Following is the list of potential problems / advisories:
Your Python 3 is not a full install. Please install the module distutils.sysconfig (see the Getting Started guide for further information).
尝试安装distutils模块但遇到无法解决的依赖问题,因此希望通过修改sanity.conf禁用sanity checker。当前sanity.conf内容如下:
# Sanity checks for common user misconfigurations # # See sanity.bbclass # # Expert users can confirm their sanity with "touch conf/sanity.conf" BB_MIN_VERSION = "1.46.0" SANITY_ABIFILE = "${TMPDIR}/abi_version" SANITY_VERSION ?= "1" LOCALCONF_VERSION ?= "1" LAYER_CONF_VERSION ?= "7" SITE_CONF_VERSION ?= "1" INHERIT += "sanity"
要禁用sanity checker,只需修改sanity.conf中的继承配置:
- 打开
sanity.conf文件 - 找到最后一行
INHERIT += "sanity" - 将其替换为:
INHERIT -= "sanity"
也可以直接删除INHERIT += "sanity"这一行,效果相同。但使用-=的方式更直观,明确表示移除sanity检查的继承。
⚠️ 注意:官方提示禁用sanity checker需自行承担风险,这些检查是为了提前排查环境配置问题,避免后续出现更复杂的构建故障。
内容的提问来源于stack exchange,提问作者JaSON

