<?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>14444</bug_id>
          
          <creation_ts>2021-06-17 17:30:31 +0000</creation_ts>
          <short_desc>[multilib] lib32-core-image-minimal -c populate_sdk failure on dunfell</short_desc>
          <delta_ts>2021-09-10 16:04:51 +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>core</component>
          <version>3.1.11</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>3.1.11</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Arun P Madhavan">arunpm04</reporter>
          <assigned_to name="Steve Sakoman">steve</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>raj.khem</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</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>90696</commentid>
    <comment_count>0</comment_count>
    <who name="Arun P Madhavan">arunpm04</who>
    <bug_when>2021-06-17 17:30:31 +0000</bug_when>
    <thetext>Preconditions/Environment
-------------------------
Build machine: Linux USERABC 5.4.0-74-generic #83-Ubuntu SMP Sat May 8 02:35:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
git clone -b dunfell git://git.yoctoproject.org/poky.git
cd poky
source oe-init-build-env
Enable multilib configuration in conf/local.conf by appending below details.

MACHINE = &quot;qemux86-64&quot;
require conf/multilib.conf
MULTILIBS = &quot;multilib:lib32&quot;
DEFAULTTUNE_virtclass-multilib-lib32 = &quot;x86&quot;
IMAGE_INSTALL_append = &quot; lib32-glib-2.0&quot;

Triggering Action/Cause
-----------------------
bitbake lib32-core-image-minimal -c populate_sdk

Expectation
-----------
Build shall succeed without any error and SDK shall be generated.

Actual Result
-------------
VM2[16/Jun|22:45:40]build$ bitbake lib32-core-image-minimal -c populate_sdk
Loading cache: 100% |##############################################################################################################################################################################| Time: 0:00:00
Loaded 2093 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = &quot;1.46.0&quot;
BUILD_SYS            = &quot;x86_64-linux&quot;
NATIVELSBSTRING      = &quot;universal&quot;
TARGET_SYS           = &quot;x86_64-poky-linux&quot;
MACHINE              = &quot;qemux86-64&quot;
DISTRO               = &quot;poky&quot;
DISTRO_VERSION       = &quot;3.1.8&quot;
TUNE_FEATURES        = &quot;m64 core2&quot;
TARGET_FPU           = &quot;&quot;
meta
meta-poky
meta-yocto-bsp       = &quot;dunfell:26428489f4ed53a4774d669f5ed28ccd0184be8c&quot;

ERROR: Task do_populate_sdk does not exist for target lib32-core-image-minimal (virtual:multilib:lib32:/home/USERABC/codebase/poky/meta/recipes-core/images/core-image-minimal.bb:do_populate_sdk). Close matches:
  do_populate_lic_deploy
ERROR: Command execution failed: 1

Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
VM2[16/Jun|22:46:34]build$

Reproducibility
---------------
5/5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90721</commentid>
    <comment_count>1</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2021-06-20 21:47:03 +0000</bug_when>
    <thetext>patch is on mailing list</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90722</commentid>
    <comment_count>2</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2021-06-20 21:47:59 +0000</bug_when>
    <thetext>patch is on mailing list</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90746</commentid>
    <comment_count>3</comment_count>
    <who name="Arun P Madhavan">arunpm04</who>
    <bug_when>2021-06-24 14:17:39 +0000</bug_when>
    <thetext>Cherrypicked related change-set and gave a try.
With that SDK is being generated but the SDK is not picking the MULTILIB version of packages.
Meaning; if we try to cross compile any sample application on a Host machine using SDK which has any MULTILIB package dependency; then it will fail saying that package is not found.

Eg: Tried cross-compiling a very basic gstreamer sample application with the SDK generated.

......................................
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /opt/poky/2.0/sysroots/x86_64-poky-linux/usr/bin/pkg-config (found version &quot;0.29.2&quot;) 
-- Checking for module &apos;gstreamer-1.0&apos;
--   No package &apos;gstreamer-1.0&apos; found
-- Could NOT find PC_GSTREAMER (missing: PC_GSTREAMER_FOUND) 
-- Configuring done
CMake Error at CMakeLists.txt:21 (add_executable):
  Target &quot;gstSampleNativeApp&quot; links to target
  &quot;GStreamer::GStreamer&quot; but the target was not found.  Perhaps a
  find_package() call is missing for an IMPORTED target, or an ALIAS target
  is missing?
-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
......................................

If we verify PKG_CONFIG_PATH; it seems pointing to proper locations:
......................................
dunfell@dunfell-VirtualBox:$ echo $PKG_CONFIG_PATH 
/opt/poky/2.0/sysroots/aarch64-poky-linux/usr/lib/pkgconfig:/opt/poky/2.0/sysroots/aarch64-poky-linux/usr/share/pkgconfig
......................................

Search for pkgconfig in the SDK installed path:
......................................
dunfell@dunfell-VirtualBox:/opt/poky$ find ./ -iname &quot;pkgconfig&quot;
./2.0/sysroots/aarch64-poky-linux/usr/lib64/pkgconfig
dunfell@dunfell-VirtualBox:/opt/poky$
......................................</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91231</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-08-19 15:23:35 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=bb30baceecee69f095104c7a350830f2bf277881</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91232</commentid>
    <comment_count>5</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-08-19 15:25:19 +0000</bug_when>
    <thetext>The patch may have enabled building but not regular usage so there may be more work to do in master according to Richard.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91238</commentid>
    <comment_count>6</comment_count>
    <who name="Steve Sakoman">steve</who>
    <bug_when>2021-08-19 17:38:06 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; Cherrypicked related change-set and gave a try.
&gt; With that SDK is being generated but the SDK is not picking the MULTILIB
&gt; version of packages.
&gt; Meaning; if we try to cross compile any sample application on a Host machine
&gt; using SDK which has any MULTILIB package dependency; then it will fail
&gt; saying that package is not found.
&gt; 
&gt; Eg: Tried cross-compiling a very basic gstreamer sample application with the
&gt; SDK generated.
&gt; 
&gt; ......................................
&gt; -- Detecting C compile features
&gt; -- Detecting C compile features - done
&gt; -- Found PkgConfig:
&gt; /opt/poky/2.0/sysroots/x86_64-poky-linux/usr/bin/pkg-config (found version
&gt; &quot;0.29.2&quot;) 
&gt; -- Checking for module &apos;gstreamer-1.0&apos;
&gt; --   No package &apos;gstreamer-1.0&apos; found
&gt; -- Could NOT find PC_GSTREAMER (missing: PC_GSTREAMER_FOUND) 
&gt; -- Configuring done
&gt; CMake Error at CMakeLists.txt:21 (add_executable):
&gt;   Target &quot;gstSampleNativeApp&quot; links to target
&gt;   &quot;GStreamer::GStreamer&quot; but the target was not found.  Perhaps a
&gt;   find_package() call is missing for an IMPORTED target, or an ALIAS target
&gt;   is missing?
&gt; -- Generating done
&gt; CMake Generate step failed.  Build files cannot be regenerated correctly.
&gt; ......................................
&gt; 
&gt; If we verify PKG_CONFIG_PATH; it seems pointing to proper locations:
&gt; ......................................
&gt; dunfell@dunfell-VirtualBox:$ echo $PKG_CONFIG_PATH 
&gt; /opt/poky/2.0/sysroots/aarch64-poky-linux/usr/lib/pkgconfig:/opt/poky/2.0/
&gt; sysroots/aarch64-poky-linux/usr/share/pkgconfig
&gt; ......................................
&gt; 
&gt; Search for pkgconfig in the SDK installed path:
&gt; ......................................
&gt; dunfell@dunfell-VirtualBox:/opt/poky$ find ./ -iname &quot;pkgconfig&quot;
&gt; ./2.0/sysroots/aarch64-poky-linux/usr/lib64/pkgconfig
&gt; dunfell@dunfell-VirtualBox:/opt/poky$
&gt; ......................................

Can you point me to the source for the sample app you are trying to compile so that I can try to reproduce this?  Have you tried this with master branch? I suspect the issue is also present there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91300</commentid>
    <comment_count>7</comment_count>
    <who name="Arun P Madhavan">arunpm04</who>
    <bug_when>2021-08-28 16:29:52 +0000</bug_when>
    <thetext>Sorry for the delay.
Please find the sample application repo https://github.com/arun-madhavan-013/gstreamer-channelchange-testapp
I didn&apos;t tried with master but there also same issue will be present.
Most of our product stacks are based on dunfell hence we are more focused in it.

Regards,
Arun</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91315</commentid>
    <comment_count>8</comment_count>
    <who name="Steve Sakoman">steve</who>
    <bug_when>2021-08-31 17:07:35 +0000</bug_when>
    <thetext>I tried this on master and encountered the same &quot;No package &apos;gstreamer-1.0&apos; found&quot; error.

However I think this is because core-image-minimal does not include gstreamer-1.0

So to test this I modified your local.conf changes to include gstreamer in the image:

MACHINE = &quot;qemux86-64&quot;
require conf/multilib.conf
MULTILIBS = &quot;multilib:lib32&quot;
DEFAULTTUNE:virtclass-multilib-lib32 = &quot;x86&quot;
IMAGE_INSTALL:append = &quot; lib32-glib-2.0 lib32-gstreamer1.0&quot;

(note the use of colons for the master branch, if trying this on dunfell remember to use underscores)

I rebuilt and installed the sdk and tried your test app once more.  This time gstreamer is found:

-- Checking for module &apos;gstreamer-1.0&apos;
--   Found gstreamer-1.0, version 1.18.4

And a subsequent make command builds the app successfully.

However there is the following cmake warning, which may or may not be an issue:

CMake Warning (dev) at /opt/poky/3.3+snapshot/sysroots/x86_64-pokysdk-linux/usr/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args`
  (PC_GSTREAMER) does not match the name of the calling package (GStreamer).
  This can lead to problems in calling code that expects `find_package`
  result variables (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindGStreamer.cmake:29 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:11 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

Let me know if this resolves the issue for you.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91318</commentid>
    <comment_count>9</comment_count>
    <who name="Arun P Madhavan">arunpm04</who>
    <bug_when>2021-08-31 21:33:43 +0000</bug_when>
    <thetext>Thank you for confirming on master.

I&apos;ll try and share feedback on latest dunfell as it is what our product stack is based on and gstreamer and glib is part of our final image(its not core-image-minimal).

By any chance; do you know which change fixed this root issue (failure of populate_sdk)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91320</commentid>
    <comment_count>10</comment_count>
    <who name="Steve Sakoman">steve</who>
    <bug_when>2021-08-31 22:34:24 +0000</bug_when>
    <thetext>Richard posted a link to the fix in master in one of the previous comments above.

I cherry-picked the same fix into dunfell:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=dunfell&amp;id=ed4791c8b05d02edb783359656376216b98c1c49</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91321</commentid>
    <comment_count>11</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-09-01 10:57:12 +0000</bug_when>
    <thetext>Steve: From other reports/memories, I think this is still broken on master but I haven&apos;t been able to prove that or debug it. I&apos;m nervous about taking the breakage back to dunfell.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91322</commentid>
    <comment_count>12</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-09-01 10:58:26 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; Steve: From other reports/memories, I think this is still broken on master
&gt; but I haven&apos;t been able to prove that or debug it. I&apos;m nervous about taking
&gt; the breakage back to dunfell.

Although you&apos;re saying you have this working so perhaps it is fine. Not sure, just nervous.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91323</commentid>
    <comment_count>13</comment_count>
    <who name="Steve Sakoman">steve</who>
    <bug_when>2021-09-01 14:15:28 +0000</bug_when>
    <thetext>Yes, with the fix the original reported sdk build issue is resolved. The secondary issue reported here appears to be related to attempting to build a test app that requires a package not included in the sdk image (gstreamer). Adding this package resolves that issue and the test app build completes.

Let&apos;s see if Arun can confirm that all of issues are resolved.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91325</commentid>
    <comment_count>14</comment_count>
    <who name="Steve Sakoman">steve</who>
    <bug_when>2021-09-02 14:15:10 +0000</bug_when>
    <thetext>It appears that dunfell should also have &quot;sdk: Decouple default install path from built in path&quot;: https://git.openembedded.org/openembedded-core/commit/?id=bc4ee5453560dcefc4a4ecc5657df5cc1666e153

Otherwise there will be a large number of sed errors at sdk installation due to undefined  SDK_BUILD_PATH.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91344</commentid>
    <comment_count>15</comment_count>
    <who name="Arun P Madhavan">arunpm04</who>
    <bug_when>2021-09-06 18:53:55 +0000</bug_when>
    <thetext>Hi Team,

I cloned poky dunfell and the SDK generation worked after cherry-picking following change that you have suggested.
Able to verify SDK by building the same sample application.

https://git.openembedded.org/openembedded-core/commit/?id=bc4ee5453560dcefc4a4ecc5657df5cc1666e153

I&apos;ll get these changes in our product stack and confirm how that is going with.

Appreciate your support !!!
Thank you.

-----------------------------------------------------------
bitbake lib32-core-image-minimal -c populate_sdk
Parsing recipes: 100% |#########################################################################################################################################################################################################################################| Time: 0:00:27
Parsing of 774 .bb files complete (0 cached, 774 parsed). 2093 targets, 109 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = &quot;1.46.0&quot;
BUILD_SYS            = &quot;x86_64-linux&quot;
NATIVELSBSTRING      = &quot;ubuntu-18.04&quot;
TARGET_SYS           = &quot;x86_64-poky-linux&quot;
MACHINE              = &quot;qemux86-64&quot;
DISTRO               = &quot;poky&quot;
DISTRO_VERSION       = &quot;3.1.10&quot;
TUNE_FEATURES        = &quot;m64 core2&quot;
TARGET_FPU           = &quot;&quot;
meta
meta-poky
meta-yocto-bsp       = &quot;dunfell:bdd30be1a3815f70062d8febca91eaf042a77c3d&quot;

NOTE: Fetching uninative binary shim http://downloads.yoctoproject.org/releases/uninative/3.2/x86_64-nativesdk-libc.tar.xz;sha256sum=3ee8c7d55e2d4c7ae3887cddb97219f97b94efddfeee2e24923c0cb0e8ce84c6 (will check PREMIRRORS first)
Initialising tasks: 100% |######################################################################################################################################################################################################################################| Time: 0:00:04
Sstate summary: Wanted 1650 Found 0 Missed 1650 Current 0 (0% match, 0% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 4751 tasks of which 0 didn&apos;t need to be rerun and all succeeded. 
-----------------------------------------------------------</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91384</commentid>
    <comment_count>16</comment_count>
    <who name="Steve Sakoman">steve</who>
    <bug_when>2021-09-10 16:04:51 +0000</bug_when>
    <thetext>Fixed in dunfell with:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=dunfell&amp;id=ed4791c8b05d02edb783359656376216b98c1c49

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=dunfell&amp;id=6fef2a1c2ca8a4450c8a4b49e6eb5e01f80ef97b</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>