Bug 12483

Summary: cmake: toolchain.cmake contains not correct CMAKE_FIND_ROOT_PATH
Product: [Yocto Project Subprojects] Eclipse Plugin Reporter: Lukas Durfina <lukas.durfina>
Component: eclipse-pluginAssignee: Chin Huat Ang <chin.huat.ang>
Status: CLOSED OBSOLETE QA Contact: Toaster default assignee <toaster>
Severity: normal    
Priority: Medium+ CC: david.reyna, ioanax.grigoropol, randy.macleod, yp.ep.watcher, yp.watcher
Version: 2.4.2   
Target Milestone: 4.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Lukas Durfina 2018-01-15 12:07:46 UTC
Preconditions/Environment
-------------------------
A CMake project built with Yocto plugin.
There is an issue with generated file toolchain.cmake. For the variable CMAKE_FIND_ROOT_PATH, there is the first path to meta-ide-support/1.0-r3/recipe-sysroot-native/ and the second path is to tmp/sysroots/<value> (this is used as the sysroot in the plugin settings). I think that the first path should not be there at all.

Triggering Action/Cause
-----------------------
Try to build an executable for target platform.
One scenario from the many possible: Linked tries to link googletest library from native path (x86) and it fails, because target executable is for arm.

Expectation
-----------
Path to `meta-ide-support/1.0-r3/recipe-sysroot-native/` is *not* generated for CMAKE_FIND_ROOT_PATH in the file toolchain.cmake 

Actual Result
-------------
The path `meta-ide-support/1.0-r3/recipe-sysroot-native/` is generated for CMAKE_FIND_ROOT_PATH.

Reproducibility
---------------
10/10

Other notes
-----------
It is related to the source code - plugins/org.yocto.cmake.managedbuilder/src/org/yocto/cmake/managedbuilder/YoctoCMakeMakefileGenerator.java:239
The question is if "OECORE_NATIVE_SYSROOT" should be in the list findRootPathValues? And, if it has to be there, is the first position the correct one? Would not it be better to have it as the second/last one after "OECORE_TARGET_SYSROOT"?
Comment 1 Randy MacLeod 2018-01-18 15:39:39 UTC
Chin, Should be mostly straight-forward but if you have questions please ask David Reyna or Ross Burton.
Comment 2 Lukas Durfina 2018-02-28 13:20:49 UTC
I can provide you more support if needed.
Would it be helpful if I create a patch and send to the mailing list?
Comment 3 David Reyna 2018-02-28 23:07:24 UTC
Hi Lukas,

> Would it be helpful if I create a patch and send to the mailing list?

I would think that would be very helpful. I see that Chin Huat is very active at the moment in pushing fixes for the Eclipse plug-in, and a proposed patch could be very useful and timely.

As you probably know, the mailing list just got moved to 'eclipse-yocto@yoctoproject.org".

I am glad you are following up on this issue. I reported it directly to Tim Orling but had not filed a formal defect.
Comment 4 Chin Huat Ang 2018-04-11 00:43:45 UTC
Patches would be most welcomed as I'm currently not very familiar with cmake, although this might be too late for 2.5 unless if something is flaming broken.
Comment 6 Armin Kuster 2019-08-29 15:16:01 UTC
Eclipse got dropped from project support.
Comment 7 Armin Kuster 2019-08-29 15:17:25 UTC
closing