Yocto rust 配方还产生需要打包的原生输出

Yocto rust recipe also produces -native output that needs packaging

我在 hardknott 上尝试过这种方法,但我无法让它工作

这是一个生成 x86_64 应用程序的 rust 配方,我想在 sdk 中以正确的方式打包它,以便可以使用它。

我可以将主包分离到 -native-bin,我在 recipe-sysroot 中看到它,但是在构建时我无法让它填充文件 workdir 的 recipe-sysroot -本地助手食谱。我怀疑原因是我得到一个错误,找不到 x86_64 的主要配方?

ERROR: Manifest xxxxxx.populate_sysroot not found in vs_imx8mp cortexa53 armv8a-crc armv8a aarch64 allarch x86_64_x86_64-nativesdk (variant '')?

如果有任何有用的信息,我们将不胜感激!

像这样被黑:

Recipe.bb:

do_install_append() {
    # Set permision without run flag so that it doesn't fail on checks
    chmod 644 ${D}/usr/bin/@RECIPE@-compiler
}

# @RECIPE@ generates a compiler during the target generation step
#separate this to the -native-bin package, and skip the ARCH checks
#also in the image file for stations_sdk move the app to right dir and add execute flag
PACKAGES_prepend = "${PN}-native-bin "
PROVIDES_prepend = "${PN}-native-bin "
INSANE_SKIP_${PN}-native-bin = "arch"
FILES_${PN}-native-bin = "/usr/bin/@RECIPE@-compiler"

SYSROOT_DIRS += "/"

Image.bb:

# @RECIPE@ produces a compiler that is produced as a part of the target generation
#so we use the recipe and hack it to supply the -compiler as part of the 
#host binaries
TOOLCHAIN_TARGET_TASK_append = " @RECIPE@-native-bin"

do_fix_@RECIPE@() {
    mv ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/usr/bin/@RECIPE@-compiler ${SDK_OUTPUT}/${SDKPATHNATIVE}/usr/bin/@RECIPE@-compiler
    chmod 755 ${SDK_OUTPUT}/${SDKPATHNATIVE}/usr/bin/@RECIPE@-compiler
}

SDK_POSTPROCESS_COMMAND_prepend = "do_fix_@RECIPE@; "

最后在正确的目录中生成二进制文件