Re: Problem with recipe that depends on a binary that is generated during its build

Khem Raj

On 11/25/20 12:37 AM, Matteo Iervasi wrote:
Ok I've found a solution by myself. Basically I just used the trick showed in the Technical FAQ and put a bunch of install commands in the do_install task.
Now the only problem I have is that the do_install task for target complains that needs administrative privileges (maybe I'm just doing it wrong, I'm still not that experienced with Yocto).
| [100%] Built target boosttest-test-livestatus
| make[1]: Leaving directory '/home/matteo/boxio/toradex/colibri-imx6ull/build-boxio-colibri-imx6ull/tmp-glibc/work/cortexa7t2hf-neon-angstrom-linux-gnueabi/icinga-core/2.12.0-r0/build'
| /home/matteo/boxio/toradex/colibri-imx6ull/build-boxio-colibri-imx6ull/tmp-glibc/work/cortexa7t2hf-neon-angstrom-linux-gnueabi/icinga-core/2.12.0-r0/recipe-sysroot-native/usr/bin/cmake -E cmake_progress_start /home/matteo/boxio/toradex/colibri-imx6ull/build-boxio-colibri-imx6ull/tmp-glibc/work/cortexa7t2hf-neon-angstrom-linux-gnueabi/icinga-core/2.12.0-r0/build/CMakeFiles 0
| make -f CMakeFiles/Makefile2 preinstall
| make[1]: Entering directory '/home/matteo/boxio/toradex/colibri-imx6ull/build-boxio-colibri-imx6ull/tmp-glibc/work/cortexa7t2hf-neon-angstrom-linux-gnueabi/icinga-core/2.12.0-r0/build'
| make[1]: Nothing to be done for 'preinstall'.
| make[1]: Leaving directory '/home/matteo/boxio/toradex/colibri-imx6ull/build-boxio-colibri-imx6ull/tmp-glibc/work/cortexa7t2hf-neon-angstrom-linux-gnueabi/icinga-core/2.12.0-r0/build'
| Install the project...
| /home/matteo/boxio/toradex/colibri-imx6ull/build-boxio-colibri-imx6ull/tmp-glibc/work/cortexa7t2hf-neon-angstrom-linux-gnueabi/icinga-core/2.12.0-r0/recipe-sysroot-native/usr/bin/cmake -P cmake_install.cmake
| -- Install configuration: "Release"
| CMake Error at cmake_install.cmake:36 (file):
|   file cannot create directory: /usr/share/doc/icinga2.  Maybe need
|   administrative privileges.
this just means that its not able to relocate the install location to ${D} which is what default do_install should do. So the package needs some work to respect an option to relocate the installation directory once you have that then you can specify that vi OE_EXTRACMAKE += "-D...=${D}" or some such. That could be a fix sent to upstream as well otherwise your fix it ok too for your needs.

| Makefile:74: recipe for target 'install' failed
| make: *** [install] Error 1
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_install (log file is located at /home/matteo/boxio/toradex/colibri-imx6ull/build-boxio-colibri-imx6ull/tmp-glibc/work/cortexa7t2hf-neon-angstrom-linux-gnueabi/icinga-core/2.12.0-r0/temp/log.do_install.25788)
ERROR: Task (/home/matteo/boxio/toradex/colibri-imx6ull/build-boxio-colibri-imx6ull/../layers/meta-boxio-colibri-imx6ull/recipes-extended/icinga-core/ failed with exit code '1'
NOTE: Tasks Summary: Attempted 3457 tasks of which 3447 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
The recipe that now compiles ok is attached here.
Matteo Iervasi

Join to automatically receive all group messages.