Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Yocto 自定义设置的BitBake配方.py_Yocto_Bitbake_Recipe - Fatal编程技术网

Yocto 自定义设置的BitBake配方.py

Yocto 自定义设置的BitBake配方.py,yocto,bitbake,recipe,Yocto,Bitbake,Recipe,在我的配方中,我必须下载git存储库并运行CMake。CMake完成其工作后,将创建额外的目录OUT,其中包含我喜欢在do_install中运行的setup.py文件? 我试过: DEPENDS = "setuptools python" do_install () { python OUT/setup.py install } 但它没有引发setup.py发现错误。 有人能处理这样的问题吗 之所以发生这种情况,是因为bitbake不知道setup.py存储在哪里-您需要使用bitbake

在我的配方中,我必须下载git存储库并运行CMake。CMake完成其工作后,将创建额外的目录OUT,其中包含我喜欢在do_install中运行的setup.py文件? 我试过:

DEPENDS = "setuptools python" 
do_install () {
python OUT/setup.py install 
}
但它没有引发setup.py发现错误。
有人能处理这样的问题吗

之所以发生这种情况,是因为bitbake不知道setup.py存储在哪里-您需要使用bitbake生成的${s}变量来提供此脚本的完整路径


请阅读\u install()任务是如何工作的-

目前我已重新整理了我的配方,如下所示:

LICENSE = "CLOSED"
BB_STRICT_CHECKSUM = "0"

inherit cmake setuptools pythonnative

DEPENDS = "boost udev python swig-native python-native python-setuptools-native cmake-native"

SRC_URI = " \
    git://github.com/my_repo.git;name=my_name \
    file://0001-system-install.patch \
"
SRCREV_my_name = "404ff3eeff0d79c15cbfdbc126c4bff2996baea6"

S = "${WORKDIR}/git"

PARALLEL_MAKEINST = ""
基于CMake从git上下载的项目,其安装如下:

install(CODE "execute_process(COMMAND python \"${PROJECT_SOURCE_DIR}/python/setup.py\" \"install\")")
但当我调用recipe to build(bitbake my_recipe)或包含该配方的build image(bitbake my_image)时,我收到了这样的错误:

ERROR: pc-ble-driver-git-r0 do_compile: python setup.py build execution failed.
ERROR: pc-ble-driver-git-r0 do_compile: Function failed: do_compile (log file is located at /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/temp/log.do_compile.16502)
ERROR: Logfile of failure stored in: /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/temp/log.do_compile.16502
Log data follows:
| DEBUG: Executing shell function do_compile
| ERROR: python setup.py build execution failed.
| /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/recipe-sysroot-native/usr/bin/python-native/python: can't open file 'setup.py': [Errno 2] No such file or directory
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/temp/log.do_compile.16502)
ERROR: Task (/build/yocto-fsl/sources/meta-slabs/recipes-external/pc-ble-driver/pc-ble-driver_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2195 tasks of which 2194 didn't need to be rerun and 1 failed.
在我的电脑上,当我建立CMake项目并调用“使安装一切按我的设想进行”时,请注意


还有其他建议吗?

尝试在配方文件中添加下面的命令

distutils_do_compile() {                                                                                                                                       
    :                                                                                                                                                          
}                                                                                                                                                              
distutils_stage_headers() {                                                                                                                                    
    :                                                                                                                                                          
}                                                                                                                                                              
distutils_stage_all() {                                                                                                                                        
    :                                                                                                                                                          
}                                                                                                                                                              
distutils_do_install() {                                                                                                                                       
    :                                                                                                                                                          
} 
请参阅下面的更多详细信息。。。
/poky/meta/classes/distutils tools.bbclass

您的继承行不应包含
字符My bad I have dependens而不是inherit(在主帖子中更正)。还有其他建议吗?