<?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>12337</bug_id>
          
          <creation_ts>2017-11-12 10:29:30 +0000</creation_ts>
          <short_desc>PKG_CONFIG_PATH not read correctly from SDK environment</short_desc>
          <delta_ts>2019-08-29 15:17:25 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Eclipse Plugin</product>
          <component>eclipse-plugin</component>
          <version>2.4</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>OBSOLETE</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dennis Menschel">menschel-d</reporter>
          <assigned_to name="Chin Huat Ang">chin.huat.ang</assigned_to>
          <cc>ioanax.grigoropol</cc>
    
    <cc>jose.perez.carranza</cc>
    
    <cc>ross.burton</cc>
    
    <cc>yp.ep.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>78162</commentid>
    <comment_count>0</comment_count>
    <who name="Dennis Menschel">menschel-d</who>
    <bug_when>2017-11-12 10:29:30 +0000</bug_when>
    <thetext>Preconditions/Environment
-------------------------
Eclipse: Oxygen.1a Release (4.7.1a)
Yocto Project SDK Plugin: 1.4.1.201710162310
SDK: http://downloads.yoctoproject.org/releases/yocto/yocto-2.4/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-cortexa8hf-neon-toolchain-ext-2.4.sh

Triggering Action/Cause
-----------------------
1. Install SDK.
2. Configure Eclipse to use the SDK.
3. Create new &quot;C++ Project&quot;, select &quot;Yocto Project SDK Autotools Project&quot; and then &quot;Hello World C++ Autotools Project&quot;.
4. Select &quot;Project&quot;, &quot;Properties&quot;, &quot;C/C++ Build&quot;, &quot;Environment&quot; and take a look at PKG_CONFIG_PATH.

Expectation
-----------
PKG_CONFIG_PATH should have been set to &quot;$SDKTARGETSYSROOT/usr/lib/pkgconfig:$SDKTARGETSYSROOT/usr/share/pkgconfig&quot;.

Actual Result
-------------
PKG_CONFIG_PATH is set to &quot;$SDKTARGETSYSROOT/usr/lib/pkgconfig&quot;.

Reproducibility
---------------
Always.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78246</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-11-16 15:48:41 +0000</bug_when>
    <thetext>meta/classes/toolchain-scripts.bbclass:

echo &apos;export PKG_CONFIG_PATH=$SDKTARGETSYSROOT&apos;&quot;$libdir&quot;&apos;/pkgconfig:$SDKTARGETSYSROOT&apos;&quot;$prefix&quot;&apos;/share/pkgconfig&apos; &gt;&gt; $script

This was fixed in oe-core 1bea760f3f462fdcc3eefc0d8597688d61447ddd which is in morty/pyro/rocko.

So maybe this is an Eclipse thing after all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78280</commentid>
    <comment_count>2</comment_count>
    <who name="Dennis Menschel">menschel-d</who>
    <bug_when>2017-11-18 12:49:16 +0000</bug_when>
    <thetext>Examining the current master of eclipse-poky (126e707a6de212feeaaf093edc170aaa74192ce7) reveals the following:

$ git grep -n PKG_CONFIG_PATH
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java:164:                   } else if (sKey.matches(&quot;PKG_CONFIG_PATH&quot;)) {
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java:174:                   else if (sKey.matches(&quot;PKG_CONFIG_PATH&quot;))

$ head -n 171 plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | tail -n 8                                                                   ~/projects/foreign/eclipse-poky
                        } else if (sKey.matches(&quot;PKG_CONFIG_PATH&quot;)) {
                                sValue = elem.getStrSysrootLoc();
                                targetFilePath = elem.getStrSysrootLoc() + &quot;/&quot; + elem.getStrTarget();
                                targetFile = new File(targetFilePath);
                                if (targetFile.exists())
                                        sValue = sValue + &quot;/&quot; + elem.getStrTarget();
                                sValue = sValue + &quot;/usr/lib/pkgconfig&quot;;
                        }

From what I can tell, the actual value of the environment variable PKG_CONFIG_PATH is not read at all, but instead constructed by concatenating &lt;sysroot location&gt;, &lt;target&gt; and the hardcoded string &quot;/usr/lib/pkgconfig&quot;. This would also explain why the second path &quot;$SDKTARGETSYSROOT/usr/share/pkgconfig&quot; is entirely missing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78628</commentid>
    <comment_count>3</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-12-08 22:15:44 +0000</bug_when>
    <thetext>Moving to Chin Huat.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84784</commentid>
    <comment_count>4</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-08-29 15:16:01 +0000</bug_when>
    <thetext>Eclipse got dropped from project support.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84830</commentid>
    <comment_count>5</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-08-29 15:17:25 +0000</bug_when>
    <thetext>closing</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>