| Summary: | nativesdk-cmake: can't find OEToolchainConfig.cmake | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Chin Huat Ang <chin.huat.ang> |
| Component: | devtools / tool chain | Assignee: | Armin Kuster <akuster> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | bluelightning, geissonator, henry.bruce, meta.mr.watcher, meta.watcher, otavio, pokylinux, ross.burton, sjolley.yp.pm |
| Version: | 2.6 | ||
| Target Milestone: | 2.5.2 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Don't know | |
|
Description
Chin Huat Ang
2018-06-28 07:11:19 UTC
I'd suggest this is a trivial tweak of FILES_* to get the file in the right place. I'd also say the eSDK test suite needs extending to ensure that cmake builds actually work. I'm a little concerned about how we might fix this. We should perhaps only be including this configuration if cmake is installed in the sdk? We could wrap it in the shell script with a test whether the file exists. Also, does one cmake file really work for all the different target architectures? I think I am missing something here. In my case this looks differently for sumo, at least with a quick test for the extensible SDK. source /opt/ext-sdk/poky/2.5/multi-v7-ml/imx6q-phytec-mira-rdk-nand/environment-setup-armv7a-neon-poky-linux-gnueabi student@e450-1:~⟫ which cmake /opt/ext-sdk/poky/2.5/multi-v7-ml/imx6q-phytec-mira-rdk-nand/tmp/sysroots/x86_64/usr/bin/cmake alias | grep -i cmake returns nothing! --------- "classic" SDK student@e450-1:~⟫ source /opt/poky/2.5/multi-v7-ml/imx6q-phytec-mira-rdk-nand/environment-setup-armv7a-neon-poky-linux-gnueabi student@e450-1:~⟫ which cmake /opt/poky/2.5/multi-v7-ml/imx6q-phytec-mira-rdk-nand/sysroots/x86_64-pokysdk-linux/usr/bin/cmake please note, that I see this alias only with the "classic" SDK and not with the extensible SDK: alias | grep -i cmake alias cmake='cmake -DCMAKE_TOOLCHAIN_FILE=/opt/poky/2.5/multi-v7-ml/imx6q-phytec-mira-rdk-nand/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig cmake' It's worth pointing out that the SDK environment setup script looks for $OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh and thus sourced cmake.sh (installed by nativesdk-cmake), however it sets up a broken alias and rendered cmake unusable with the following error message:
###
parallels@ubuntu:~/git/cmake-hello/build$ cmake . ..
CMake Error at /opt/yocto-releases/2.6_M1.rc1/poky-glibc-x86_64-core-image-sato-i586-toolchain-2.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:100 (message):
Could not find toolchain file:
/opt/yocto-releases/2.6_M1.rc1/poky-glibc-x86_64-core-image-sato-i586-toolchain-2.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
###
Apparently bitbake.conf includes ${datadir}/cmake/* into nativesdk-cmake-dev package, so instead I'm moving the OEToolchainConfig.cmake file into the same directory as the cmake.sh file which depends on it.
Fix submitted: http://lists.openembedded.org/pipermail/openembedded-core/2018-July/152810.html
I've also sanity tested SDK generated for core-image-sato qemux86 and qemuarm64 targets and the cmake toolchain config file appears to work just fine after correcting the paths, although I should also mention that the toolchain file currently contains optional settings as the default cmake modules are smart enough to reuse common environment variables set by SDK environment script variables, e.g. CMakeDetermineCCompiler.cmake module which detects C compiler settings would prefer to derive CMAKE_C_COMPILER setting (if missing/unset) from $CC environment variable.
It's not fixed until the patch is in master. I have an internal customer using meta-intel who has just moved from rocko to sumo (on my advice) and hit this bug. I have fixed with a bbappend implementing the bug-fix patch pending backport to sumo. +1 on better test coverage for cmake. We hit this as well over in openbmc (https://github.com/openbmc). Be great to get this one in and done. I patched the change in directly but not sure I'll have much luck getting it in - https://gerrit.openbmc-project.xyz/#/c/openbmc/openbmc/+/11901/ FWIW I believe a6ce79b87d3db57033a3d1710cb3292366a0a8f7 fixed this in master. I've verified building SDK from master with the following commit fixes the problem: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=206f8102a45e5e91657dd6e8c098ffe0f257b1cc Need a backport to 2.5.2 (In reply to comment #10) > Need a backport to 2.5.2 in stable/sumo-nmut in sumo proper http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/recipes-devtools/cmake?h=sumo&id=b8a4eb80622228c7787c5465b4fef4563763c998 closing |