Bug 3019

Summary: NullPointerException when setting sysroot in Window->Preferences
Product: [Yocto Project Subprojects] Eclipse Plugin Reporter: Björn Arnelid <bjorn.arnelid>
Component: eclipse-pluginAssignee: Jessica <jessica.zhang>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: Medium CC: alexandru.c.georgescu, david.c.nystrom, david.nystrom, ioanax.grigoropol, yp.ep.watcher, yp.watcher
Version: 1.2   
Target Milestone: 1.3 M5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Björn Arnelid 2012-08-28 09:16:13 UTC
When pointing to a sysroot with a name differrent from *-pokysdk-linux a NullPointerException will be thrown and sysroot is not set since "-pokysdk-linux" is hardcoded.
Comment 1 Björn Arnelid 2012-08-31 13:16:34 UTC
Workaround for me is to create a folder in <toolchaindir>/sysroot named <architecture>-pokysdk-linux.
Comment 2 David Nyström 2012-09-04 08:47:07 UTC
Patch posted on yocto ML.

http://permalink.gmane.org/gmane.linux.embedded.yocto.general/8861
Comment 3 Jessica 2012-09-04 17:22:56 UTC
Hi David,

Send the question to your patch, please help clarify how you generate your toolchain that's not following the naming convention.

Thanks,
Jessica
Comment 4 David Nyström 2012-09-13 05:49:26 UTC
Laurentiu Serban, asked me to followup, so here it goes:

In cases where toolchains are created with ${DISTRO} != "poky", this nullpointerexception is seen,
This patch has already been merged to master, and judging by the git tags, will be apart of the 1.3 release I guess.

Br,
David
Comment 6 Alexandru Georgescu 2012-11-06 14:40:17 UTC
Hi David,

I am trying to verify this bug but I need some additional details. 
Can you tell me what exact distro are you using, and also what eclipse plugin version you were using?

Thanks,
Alex.
Comment 7 Björn Arnelid 2012-11-07 06:42:04 UTC
This bug is fixed in yocto plugin 1.3. 
It was a problem using yocto plugin 1.2 and earlier on any version of eclipse running on any version of Linux. 

As David described you need to create a toolchain where ${DISTRO} is something other then "poky" to get this error.

I first encountered this bug using eclipse 3.8.1, Yocto plugin 1.2 on Ubuntu 12.04 LTS
Comment 8 Alexandru Georgescu 2012-11-07 17:03:19 UTC
Tested with 78983e939ab17f02f8911c8b0d0e326b419856b9 on master.


In order to verify, I modified the DISTRO to be other than poky. To do so, the following have to be modified in poky:

1. chose a name different than poky for DISTRO, e.g: pob
2. Change in conf/local.conf DISTRO = "poky" to: DISTRO = "pob"
3. Copy meta-yocto/conf/distro/poky.conf to meta-yocto/conf/distro/pob.conf
4. In meta-yocto/conf/distro/pob.conf change the following parameters to other than standard, for ex:

DISTRO = "pob"
SDK_VENDOR = "-pobsdk"
TARGET_VENDOR = "-poby"

This way the folders under sysroots  after sdk is installed will have a different name than "-pokysdk-linux"

5. Source the poky environment: $ source oe-init-build-env
6. Build the standalone toolchain: $ bitbake meta-toolchain-sdk
7. Install the resulted toolchain.

In the latest eclipse (juno) with the latest plugin (http://autobuilder.yoctoproject.org/pub/nightly/20121102-2/eclipse-plugin/) the standalone toolchain created can be imported and used to create and build a new helloworld project.

In eclipse indigo with the 1.2 eclipse plugin release (http://downloads.yoctoproject.org/releases/eclipse-plugin/1.2) and the above toolchain created does not exactly show me a NullPointerException but when pressing OK, a popup window appears and disappears immediately and then the Yocto Project ADT window closes without saving the changes.

Given that using the fix and latest eclipse-plugin and eclipse juno I could build successfully a Hello World application, we can close the bug.