<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12827</bug_id>
          
          <creation_ts>2018-06-28 07:11:19 +0000</creation_ts>
          <short_desc>nativesdk-cmake: can&apos;t find OEToolchainConfig.cmake</short_desc>
          <delta_ts>2018-11-05 23:45:52 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>2.6</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.5.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chin Huat Ang">chin.huat.ang</reporter>
          <assigned_to name="Armin Kuster">akuster</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>geissonator</cc>
    
    <cc>henry.bruce</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>otavio</cc>
    
    <cc>pokylinux</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sjolley.yp.pm</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>80948</commentid>
    <comment_count>0</comment_count>
    <who name="Chin Huat Ang">chin.huat.ang</who>
    <bug_when>2018-06-28 07:11:19 +0000</bug_when>
    <thetext>Sourcing SDK environment-setup-* script adds following cmake alias which depends on cmake toolchain file:

alias cmake=&apos;cmake -DCMAKE_TOOLCHAIN_FILE=/opt/poky/2.5+snapshot/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake&apos;

However OEToolchainConfig.cmake is packaged in nativesdk-cmake-dev which is not installed as part of SDK by default.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80968</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-06-28 14:53:52 +0000</bug_when>
    <thetext>I&apos;d suggest this is a trivial tweak of FILES_* to get the file in the right place.  I&apos;d also say the eSDK test suite needs extending to ensure that cmake builds actually work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80969</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2018-06-28 14:54:15 +0000</bug_when>
    <thetext>I&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80992</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2018-07-02 06:39:06 +0000</bug_when>
    <thetext>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!

---------

&quot;classic&quot; 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 &quot;classic&quot; SDK and not with the extensible SDK:

alias | grep -i cmake
alias cmake=&apos;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&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81075</commentid>
    <comment_count>4</comment_count>
    <who name="Chin Huat Ang">chin.huat.ang</who>
    <bug_when>2018-07-12 03:31:13 +0000</bug_when>
    <thetext>It&apos;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 &quot;Unix Makefiles&quot;.  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&apos;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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81098</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-07-12 16:47:57 +0000</bug_when>
    <thetext>It&apos;s not fixed until the patch is in master.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81398</commentid>
    <comment_count>6</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2018-08-16 19:01:46 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81408</commentid>
    <comment_count>7</comment_count>
    <who name="Andrew">geissonator</who>
    <bug_when>2018-08-20 13:06:02 +0000</bug_when>
    <thetext>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&apos;ll have much luck getting it in - https://gerrit.openbmc-project.xyz/#/c/openbmc/openbmc/+/11901/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81657</commentid>
    <comment_count>8</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-09-27 15:06:49 +0000</bug_when>
    <thetext>FWIW I believe a6ce79b87d3db57033a3d1710cb3292366a0a8f7 fixed this in master.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81695</commentid>
    <comment_count>9</comment_count>
    <who name="Chin Huat Ang">chin.huat.ang</who>
    <bug_when>2018-10-02 08:51:04 +0000</bug_when>
    <thetext>I&apos;ve verified building SDK from master with the following commit fixes the problem:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=206f8102a45e5e91657dd6e8c098ffe0f257b1cc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81697</commentid>
    <comment_count>10</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2018-10-02 15:26:17 +0000</bug_when>
    <thetext>Need a backport to 2.5.2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81698</commentid>
    <comment_count>11</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2018-10-02 16:03:55 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; Need a backport to 2.5.2

in stable/sumo-nmut</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82022</commentid>
    <comment_count>12</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2018-11-05 23:45:40 +0000</bug_when>
    <thetext>in sumo proper

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/recipes-devtools/cmake?h=sumo&amp;id=b8a4eb80622228c7787c5465b4fef4563763c998</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82023</commentid>
    <comment_count>13</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2018-11-05 23:45:52 +0000</bug_when>
    <thetext>closing</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>