Mender-artifact - Error in the package installation task while building the OS in yocto


I encoutered following problem:

install: cannot stat '.../build/tmp/raspberrypi/raspberrypi3-glibc/work/cortexa7t2hf-neon-vfpv4-oe-linux-gnueabi/mender-artifact/3.0.0-r0/build/bin/mender-artifact': No such file or directory

It looks like the mender-artifact binary file is searched in the bin directory - not in the linux_arm sub-directory related to the architecture of the target machine.

How to fix it without changing the original recipe file?

Yocto branch : thud
meta-mender commit SHA: df5ddd6
Target: Raspberry Pi 3 B+

Can you post the complete log that led to the problem, including the
command you used?

The error (that I posted below) occurs while building the system (which contains mender meta-layer) with the bitbake os-image-recipe command.

ERROR: mender-artifact-3.0.0-r0 do_install: Function failed: do_install (log file is located at (...)/build/tmp/raspberrypi/raspberrypi3-glibc/work/cortexa7t2hf-neon-vfpv4-oe-linux-gnueabi/mender-artifact/3.0.0-r0/temp/log.do_install.19632)
ERROR: Logfile of failure stored in: (...)/build/tmp/raspberrypi/raspberrypi3-glibc/work/cortexa7t2hf-neon-vfpv4-oe-linux-gnueabi/mender-artifact/3.0.0-r0/temp/log.do_install.19632
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['(...)/layers/openembedded/openembedded-core/meta/recipes-devtools/gcc/', '(...)/layers/openembedded/openembedded-core/meta/recipes-devtools/go/', '(...)/layers/openembedded/openembedded-core/meta/recipes-devtools/gcc/', 'virtual:native: (...)/layers/openembedded/openembedded-core/meta/recipes-devtools/pseudo/', '(...)/layers/openembedded/openembedded-core/meta/recipes-devtools/quilt/', '(...)/layers/openembedded/openembedded-core/meta/recipes-extended/xz/', (...)/layers/openembedded/openembedded-core/meta/recipes-core/glibc/', '(...)/layers/openembedded/openembedded-core/meta/recipes-devtools/go/']
| NOTE: Installed into sysroot: ['pseudo-native']
| NOTE: Skipping as already exists in sysroot: ['gcc-cross-arm', 'go-cross-cortexa7t2hf-neon-vfpv4', 'gcc-runtime', 'quilt-native', 'xz', 'glibc', 'go-runtime', 'libtool-native', 'libmpc-native', 'texinfo-dummy-native', 'gmp-native', 'zlib-native', 'autoconf-native', 'binutils-cross-arm', 'gnu-config-native', 'flex-native', 'automake-native', 'linux-libc-headers', 'mpfr-native', 'xz-native', 'go-native', 'libgcc', 'opkg-utils', 'm4-native', 'gettext-minimal-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| install: cannot stat '(...)/build/tmp/raspberrypi/raspberrypi3-glibc/work/cortexa7t2hf-neon-vfpv4-oe-linux-gnueabi/mender-artifact/3.0.0-r0/build/bin/mender-artifact': No such file or directory
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_install (log file is located at (...)/build/tmp/raspberrypi/raspberrypi3-glibc/work/cortexa7t2hf-neon-vfpv4-oe-linux-gnueabi/mender-artifact/3.0.0-r0/temp/log.do_install.19632)
ERROR: Task ((...)/layers/mender/meta-mender/meta-mender-core/recipes-mender/mender-artifact/ failed with exit code '1'

If I move the mender-artifact binary file manually (from linux_arm sub-directory to bin directory), the building process is performing correctly, but I would like to solve this problem automatically.

Are you trying to build mender-artifact on ARM? mender-artifact is a build tool, meant to be used on the build host. I don’t think building it on ARM is supported, at least it has never been tested under Yocto. The only dependency on mender-artifact should be mender-artifact-native.

Thanks for the answer.

Yes, I was trying to build mender-artifact for the target side, beacuse I need to read some data in artifacts for a validation purposes. So far I haven’t encountered any problems with this on the target side.
In the meantime I found similar issue thread, which proposed a solution:!topic/mender/fmC-WqT485Q

Has it been considered or checked further?

I don’t think we ever got a PR for it, so that would be my next suggestion!