CMake + native devtool recipe seems lost #cmake #devtool
Here is my recipe, configured to build natively with cmake
# We only need to build langLookupUtil natively
BBCLASSEXTEND = "native"
# We want to do 'make' in a cmake-style
inherit cmake
LICENSE = "Apache-2.0 & Unknown"SRC_URI = "git://git@somewhere/Joseph-Maniaci/mclinux_yocto.git;protocol=ssh;branch=main" # Modify these as desired
PV = "1.0+git"
SRCREV = "${AUTOREV}"
S = "${WORKDIR}/git"do_compile () {
echo "FIRST" && ls -l && echo "SECOND" && ls -l .. && . sourceme.env ${MC_APP_ARGS} && oe_runmake langLookup }
OUTPUT:
DEBUG: Executing shell function do_compile
| FIRST | total 0 | SECOND | total 40 | drwxr-xr-x 2 user user 4096 Jun 30 20:44 deploy-source-date-epoch | drwxr-xr-x 2 user user 4096 Jun 30 21:11 lang-lookup-util-1.0+git | drwxr-xr-x 4 user user 4096 Jun 30 21:11 recipe-sysroot | drwxr-xr-x 8 user user 4096 Jun 30 21:03 recipe-sysroot-native | drwxr-xr-x 2 user user 4096 Jun 30 20:44 source-date-epoch | drwxr-xr-x 2 user user 4096 Jun 30 21:20 temp | -rw-r--r-- 1 user user 12529 Jun 30 20:44 toolchain.cmake | /home/user/eps-yocto/build/exos-x-vanadium-bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/lang-lookup-util-native/1.0+git/temp/run.do_compile.213836: line 141: .: sourceme.env: file not found | WARNING: /home/user/eps-yocto/build/exos-x-vanadium-bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/lang-lookup-util-native/1.0+git/temp/run.do_compile.213836:141 exit 1 from '. sourceme.env -t ARM -v VAN000' | WARNING: Backtrace (BB generated script): | #1: do_compile, /home/user/eps-yocto/build/exos-x-vanadium-bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/lang-lookup-util-native/1.0+git/temp/run.do_compile.213836, line 141 | #2: main, /home/user/eps-yocto/build/exos-x-vanadium-bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/lang-lookup-util-native/1.0+git/temp/run.do_compile.213836, line 180
ERROR: Task (/home/user/eps-yocto/build/exos-x-vanadium-bmc/workspace/recipes/lang-lookup-util-native/lang-lookup-util-native_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 449 tasks of which 448 didn't need to be rerun and 1 failed.
Earlier today cmake was definitely in the right directory, I was playing around with AUTOREV/PV being broken(I can only use the code repo as it existed when the recipe was created) and now I got myself in this pickle. I saw the 'toolchain.cmake' file and thought, "Well at least I can see if native-related flags are being set right" and that doesn't appear to be the case either. I even deleted my entire workspace and build directory and regenerated the recipe with 'devtool add', hasn't made a difference. sourceme.env is just a legacy thing I'm hoping to get rid of later. Can confirm that from the source directory of the repo, I can target this...target with cmake and successfully build.
Upper portion of ../exos-x-vanadium-bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/lang-lookup-util-native/1.0+git/toolchain.cmake
# CMake system name must be something like "Linux". # This is important for cross-compiling.
set ( CMAKE_SYSTEM_NAME Linux )
set ( CMAKE_SYSTEM_PROCESSOR arm )
set ( CMAKE_C_COMPILER arm-openbmc-linux-gnueabi-gcc )
set ( CMAKE_CXX_COMPILER arm-openbmc-linux-gnueabi-g++ )
set ( CMAKE_C_COMPILER_LAUNCHER )
set ( CMAKE_CXX_COMPILER_LAUNCHER )
set ( CMAKE_ASM_COMPILER arm-openbmc-linux-gnueabi-gcc )find_program ( CMAKE_AR arm-openbmc-linux-gnueabi-gcc-ar DOC "Archiver" REQUIRED )
set ( CMAKE_C_FLAGS " -march=armv7-a -mfpu=vfpv4-d16 -mfloat-abi=hard -fstack-protector-strong......
....
Quoted 18 lines · joseph.maniaci via lists.yoctoproject.org
Here is my recipe, configured to build natively with cmake
*# We only need to build langLookupUtil natively*
*BBCLASSEXTEND = "native"*
*# We want to do 'make' in a cmake-style*
*inherit cmake*
*LICENSE = "Apache-2.0 & Unknown"**SRC_URI= "git://git@somewhere/Joseph-Maniaci/mclinux_yocto.git;protocol=ssh;branch=main"**# Modify these as desired*
*PV = "1.0+git"*
*SRCREV = "${AUTOREV}"*
*S = "${WORKDIR}/git"**do_compile() {*
* echo "FIRST" && ls -l && echo "SECOND" && ls -l .. && . sourceme.env
${MC_APP_ARGS} &&oe_runmakelangLookup*
*}*
Where is this env file placed ? Maybe you need to source it using S
Quoted 81 lines
OUTPUT:
*DEBUG: Executing shell function do_compile*
*| FIRST* *| total 0* *| SECOND* *| total 40* *| drwxr-xr-x 2 user user 4096 Jun 30 20:44 deploy-source-date-epoch* *| drwxr-xr-x 2 user user 4096 Jun 30 21:11 lang-lookup-util-1.0+git* *| drwxr-xr-x 4 user user 4096 Jun 30 21:11 recipe-sysroot* *| drwxr-xr-x 8 user user 4096 Jun 30 21:03 recipe-sysroot-native* *| drwxr-xr-x 2 user user 4096 Jun 30 20:44 source-date-epoch* *| drwxr-xr-x 2 user user 4096 Jun 30 21:20 temp* *| -rw-r--r-- 1 user user 12529 Jun 30 20:44 toolchain.cmake* *|
/home/user/eps-yocto/build/exos-x-vanadium-bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/lang-lookup-util-native/1.0+git/temp/run.do_compile.213836:
line 141: .: sourceme.env: file not found*
*| WARNING:/home/user/eps-yocto/build/exos-x-vanadium-bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/lang-lookup-util-native/1.0+git/temp/run.do_compile.213836:141exit 1 from '. sourceme.env -t ARM -v VAN000'*
*| WARNING: Backtrace (BB generated script):*
*| #1:do_compile,/home/user/eps-yocto/build/exos-x-vanadium-bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/lang-lookup-util-native/1.0+git/temp/run.do_compile.213836, line 141*
*| #2: main,/home/user/eps-yocto/build/exos-x-vanadium-bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/lang-lookup-util-native/1.0+git/temp/run.do_compile.213836, line 180*
*ERROR: Task (/home/user/eps-yocto/build/exos-x-vanadium-bmc/workspace/recipes/lang-lookup-util-native/lang-lookup-util-native_git.bb:do_compile) failed with exit code '1'*
*NOTE: Tasks Summary: Attempted 449 tasks of which 448 didn't need to be
rerun and 1 failed.*Earlier today cmake was definitely in the right directory, I was playing around with AUTOREV/PV being broken(I can only use the code repo as it existed when the recipe was created) and now I got myself in this pickle. I saw the 'toolchain.cmake' file and thought, "Well at least I can see if native-related flags are being set right" and that doesn't appear to be the case either. I even deleted my entire workspace and build directory and regenerated the recipe with 'devtool add', hasn't made a difference. sourceme.env is just a legacy thing I'm hoping to get rid of later. Can confirm that from the source directory of the repo, I can target this...target with cmake and successfully build.
Upper portion of ../exos-x-vanadium-bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/lang-lookup-util-native/1.0+git/toolchain.cmake
*# CMake system name must be something like "Linux".* *# This is important for cross-compiling.*
*set(
CMAKE_SYSTEM_NAMELinux )*
*set(CMAKE_SYSTEM_PROCESSORarm )*
*set(CMAKE_C_COMPILERarm-openbmc-linux-gnueabi-gcc )* *set(CMAKE_CXX_COMPILERarm-openbmc-linux-gnueabi-g++ )* *set(CMAKE_C_COMPILER_LAUNCHER)*
*set(CMAKE_CXX_COMPILER_LAUNCHER)*
*set(CMAKE_ASM_COMPILERarm-openbmc-linux-gnueabi-gcc )* *find_program(CMAKE_ARarm-openbmc-linux-gnueabi-gcc-ar DOC "Archiver" REQUIRED )**set(
CMAKE_C_FLAGS" -march=armv7-a -mfpu=vfpv4-d16 -mfloat-abi=hard -fstack-protector-strong......*
*....*-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
You automatically follow any topics you start or reply to. View/Reply Online (#65569):
https://lists.yoctoproject.org/g/yocto/message/65569
Mute This Topic: https://lists.yoctoproject.org/mt/113916891/1997914
Mute #cmake:https://lists.yoctoproject.org/g/yocto/mutehashtag/cmake Mute #devtool:https://lists.yoctoproject.org/g/yocto/mutehashtag/devtool Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
It's a legacy file/mechansim in our codebase at the root of the repo. It also wasn't working with . ./sourceme.env and that's when I started looking at the directory structure and realized I was in the directory I should be in. Even without the weird 'source' file(there needs to be a different name for a file you 'source' with 'source') I'm definitely not seeing my CMakeLists.txt file.
It's a legacy file/mechansim in our codebase at the root of the repo. It also wasn't working with . ./sourceme.env and that's when I started looking at the directory structure and realized I was not in the directory I should be in.
Even without the weird 'source' file(there needs to be a different name for a file you 'source' with 'source') I'm definitely not seeing my CMakeLists.txt file.
It's a legacy file/mechansim in our codebase at the root of the repo. It also wasn't working with . ./sourceme.env and that's when I started looking at the directory structure and realized I was not in the directory I should be in.
Even without the weird 'source' file(there needs to be a different name for a file you 'source' with 'source') I'm definitely not seeing my CMakeLists.txt file.
SOLVED: I did not realize that when doing cmake builds, oe_runmake needs to be changed cmake_do_compile, and that's it appears there are others as well for things like do_configure(though this is implicitly done), just in case this helps anyone.
It's a legacy file/mechansim in our codebase at the root of the repo. It also wasn't working with . ./sourceme.env and that's when I started looking at the directory structure and realized I was not in the directory I should be in.
Even without the weird 'source' file(there needs to be a different name for a file you 'source' with 'source') I'm definitely not seeing my CMakeLists.txt file.
Maybe a hint to what's going on: I think the implicit do_configure that a cmake build does is what is changing the directory, I just need to find a ${variable} that points back to my source code.
So if I try to do something crafty like:
do_configure () {
cd ${S} && . ./sourceme.env ${MC_APP_ARGS} && cd - }
I lose my cmake(assuming) cache, also, it appears that 'cmake_do_compile langLookup' ignores the target and tries to build all
DEBUG: Executing shell function do_compile
| NOTE: VERBOSE=1 cmake --build /home/user/eps-yocto/build/exos-x-vanadium-bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/lang-lookup-util/1.0+git/lang-lookup-util-1.0+git --target all -- | Error: could not load cache
I sure hope my spam helps out someone.
So if you explicitly call do_configure() on a cmake inherited recipe, you are then responsible for explictly calling cmake_do_configure at the end.