首页 > 解决方案 > bitbake 缺少来自外部源的“安装”目标构建

问题描述

我正在尝试学习一些关于 yocto 项目的知识,但是当我在工作区目录中的一个简单代码上运行 bitbake 时出现错误。

总结一下我所做的:

我已经克隆了 poky 存储库并成功地为 qemux86-64 机器构建了一个 core-image-minimal。

我还用 cmake 准备了一个简单的 helloworld c++ 代码,可以成功编译。这里的文件夹结构和代码:

https://github.com/robimperio/hellocmake

使用 devtool 我已将此代码添加到公共构建目录的工作区文件夹中。这以正确的方式创建了一个继承 cmake 的基本配方hello_git.bb,并且它克隆了build/workspace/sources/hello/中的源代码

与 devtool add 一起使用的命令类似于默认命令:

devtool add hello https://github.com/robimperio/hellocmake.git

配方hello_git.bb是:

# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully functional.
# (Feel free to remove these comments when editing.)

# Unable to find any files that looked like license statements. Check the accompanying
# documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly.
#
# NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if
# this is not accurate with respect to the licensing of the software being built (it
# will not be in most cases) you must specify the correct value before using this
# recipe for anything other than initial testing/development!
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""

SRC_URI = "git://github.com/robimperio/hellocmake.git;protocol=https"

# Modify these as desired
PV = "1.0+git${SRCPV}"
SRCREV = "008d549f796cd7cef537fb26a72ed16f56ad7c8b"

S = "${WORKDIR}/git"

inherit cmake

# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMAKE = ""

在第一个测试/学习阶段,我想将配方保留为自动生成的,因为如果我使用 cmake(或 autotools)检查 yocto 文档,我不需要其他任务(如 do_compile 或 do_install)。

如果我尝试构建

bitbake hello 

它正确地检查了外部源:

compiling from external source tree /home/roberto/Scrivania/dev/build/workspace/sources/hello

但我收到以下错误并且程序停止:

ERROR: hello-1.0+git999-r0 do_install: Execution of '/home/roberto/Scrivania/dev/build/tmp/work/core2-64-poky-linux/hello/1.0+git999-r0/temp/run.do_install.5279' failed with exit code 1:
ninja: error: unknown target 'install'

那么,你能解释一下为什么我会收到这个错误吗?我认为不需要 do_install tarhet,对吗?程序有问题吗?

非常感谢。

作为此处的附加信息,有整个跟踪:

 bitbake hello
    Loading cache: 100% |##########################################################################################################################| Time: 0:00:00
Loaded 1365 entries from dependency cache.
Parsing recipes: 100% |########################################################################################################################| Time: 0:00:00
Parsing of 790 .bb files complete (789 cached, 1 parsed). 1366 targets, 42 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.49.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "x86_64-poky-linux"
MACHINE              = "qemux86-64"
DISTRO               = "poky"
DISTRO_VERSION       = "3.2+snapshot-20201117"
TUNE_FEATURES        = "m64 core2"
TARGET_FPU           = ""
meta                 
meta-poky            
meta-yocto-bsp       = "master:1ad28364512be087f35b7cac6f6289027c070767"
workspace            = "<unknown>:<unknown>"

Initialising tasks: 100% |#####################################################################################################################| Time: 0:00:01
Sstate summary: Wanted 0 Found 0 Missed 0 Current 132 (0% match, 100% complete)
NOTE: Executing Tasks
NOTE: hello: compiling from external source tree /home/roberto/Scrivania/dev/build/workspace/sources/hello
ERROR: hello-1.0+git999-r0 do_install: Execution of '/home/roberto/Scrivania/dev/build/tmp/work/core2-64-poky-linux/hello/1.0+git999-r0/temp/run.do_install.5279' failed with exit code 1:
ninja: error: unknown target 'install'
WARNING: exit code 1 from a shell command.

ERROR: Logfile of failure stored in: /home/roberto/Scrivania/dev/build/tmp/work/core2-64-poky-linux/hello/1.0+git999-r0/temp/log.do_install.5279
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['virtual:native:/home/roberto/Scrivania/dev/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', 'virtual:native:/home/roberto/Scrivania/dev/poky/meta/recipes-devtools/ninja/ninja_1.10.1.bb:do_populate_sysroot', '/home/roberto/Scrivania/dev/poky/meta/recipes-devtools/cmake/cmake-native_3.18.4.bb:do_populate_sysroot', '/home/roberto/Scrivania/dev/poky/meta/recipes-devtools/gcc/gcc-cross_10.2.bb:do_populate_sysroot', '/home/roberto/Scrivania/dev/poky/meta/recipes-devtools/gcc/gcc-runtime_10.2.bb:do_populate_sysroot', '/home/roberto/Scrivania/dev/poky/meta/recipes-core/glibc/glibc_2.32.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['pseudo-native', 'ninja-native', 'cmake-native', 'gcc-cross-x86_64', 'gcc-runtime', 'glibc', 'quilt-native', 'curl-native', 'bzip2-native', 'ncurses-native', 'zlib-native', 'xz-native', 'gmp-native', 'libtool-native', 'autoconf-native', 'linux-libc-headers', 'mpfr-native', 'flex-native', 'binutils-cross-x86_64', 'automake-native', 'patch-native', 'gnu-config-native', 'texinfo-dummy-native', 'libmpc-native', 'libgcc', 're2c-native', 'pkgconfig-native', 'openssl-native', 'gettext-minimal-native', 'm4-native', 'attr-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| NOTE: DESTDIR=/home/roberto/Scrivania/dev/build/tmp/work/core2-64-poky-linux/hello/1.0+git999-r0/image VERBOSE=1 cmake --build /home/roberto/Scrivania/dev/build/tmp/work/core2-64-poky-linux/hello/1.0+git999-r0/hello-1.0+git999/ --target install --
| ninja: error: unknown target 'install'
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/roberto/Scrivania/dev/build/tmp/work/core2-64-poky-linux/hello/1.0+git999-r0/temp/run.do_install.5279' failed with exit code 1:
| ninja: error: unknown target 'install'
| WARNING: exit code 1 from a shell command.
| 
ERROR: Task (/home/roberto/Scrivania/dev/build/workspace/recipes/hello/hello_git.bb:do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 552 tasks of which 549 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/roberto/Scrivania/dev/build/workspace/recipes/hello/hello_git.bb:do_install
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

标签: cmakeyoctodevtoolsninjarecipe

解决方案


推荐阅读