<?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>4050</bug_id>
          
          <creation_ts>2013-03-19 02:38:52 +0000</creation_ts>
          <short_desc>build multilib core-image-sato failed when PR Server is enabled</short_desc>
          <delta_ts>2013-04-18 05:18:13 +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>1.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</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>1.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hongxu Jia">hongxu.jia</reporter>
          <assigned_to name="Hongxu Jia">hongxu.jia</assigned_to>
          <cc>hongxu.jia</cc>
    
    <cc>kai.kang</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>ning.zhang</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>30817</commentid>
    <comment_count>0</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-03-19 02:38:52 +0000</bug_when>
    <thetext>*env
1, Build Configuration:
BB_VERSION        = &quot;1.17.1&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;RedHatEnterpriseServer-6.3&quot;
TARGET_SYS        = &quot;x86_64-poky-linux&quot;
MACHINE           = &quot;qemux86-64&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;1.3+snapshot-20130318&quot;
TUNE_FEATURES     = &quot;m64&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-yocto        
meta-yocto-bsp    = &quot;hongxu-0206:6d9a3ac0515380d0789ee3d316c08212592a6f9a&quot;

2, conf/local.conf:
...
MACHINE = &quot;qemux86-64&quot;
PACKAGE_CLASSES = &quot;package_rpm&quot;
require conf/multilib.conf
MULTILIBS = &quot;multilib:lib32&quot;
DEFAULTTUNE_virtclass-multilib-lib32 = &quot;x86&quot;
PRSERV_HOST = &quot;localhost:10000&quot;
INHERIT += &quot;buildhistory&quot;
BUILDHISTORY_COMMIT = &quot;1&quot; 
IMAGE_INSTALL_append = &quot; lib32-neard-dev lib32-neard-dbg&quot;
...

3, Start PR Server: `bitbake-prserv --port=10000 --start&apos;

*problem
Build core-image-sato and it crashed at rootfs time:
...
| Note: to be installed:  packagegroup-core-ssh-dropbear@all packagegroup-core-x11-sato-games@qemux86_64 packagegroup-core-x11-base@all neard-dbg@lib32_x86 smartpm@x86_64 psplash@x86_64 neard-dev@lib32_x86 packagegroup-core-boot@qemux86_64 packagegroup-base-extended@qemux86_64 rpm@x86_64 packagegroup-core-x11-sato@qemux86_64 locale-base-en-us@x86_64 locale-base-en-gb@x86_64
| Loading cache...
| Updating cache...               ######################################## [100%]
| 
| Computing transaction...error: Can&apos;t install neard-dev-0.9+git1+1e20e396cb837017b7e5ef822bfdab6ce060d2cf-r1.3@lib32_x86: no package provides neard = 0.9+git1+1e20e396cb837017b7e5ef822bfdab6ce060d2cf-r1
| 
| Saving cache...
| 
| ERROR: Function failed: do_rootfs (see /home/jiahongxu/yocto/build-20130301-sanity/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/temp/log.do_rootfs.32373 for further information)
...

*analysis
1, Find out lib32-neard packages:
$ find tmp/deploy/ -name &quot;*neard*lib32*&quot;
tmp/deploy/rpm/lib32_x86/neard-0.9+git0+1e20e396cb837017b7e5ef822bfdab6ce060d2cf-r1.0.lib32_x86.rpm
tmp/deploy/rpm/lib32_x86/neard-dev-0.9+git0+1e20e396cb837017b7e5ef822bfdab6ce060d2cf-r1.0.lib32_x86.rpm
tmp/deploy/rpm/lib32_x86/neard-dbg-0.9+git0+1e20e396cb837017b7e5ef822bfdab6ce060d2cf-r1.0.lib32_x86.rpm

2, Check the dependency of neard-dev-0.9+git1+1e20e396cb837017b7e5ef822bfdab6ce060d2cf-r1.3@lib32_x86
rpm -qpR tmp/deploy/rpm/lib32_x86/neard-dev-0.9+git0+1e20e396cb837017b7e5ef822bfdab6ce060d2cf-r1.0.lib32_x86.rpm
...
neard = 0.9+git0+1e20e396cb837017b7e5ef822bfdab6ce060d2cf-r1
...

3, The `r1&apos; in versioned dependency string is incorrect. The `r1.0&apos; is expected.

4, PKGR is `r1.0&apos;, and PR is `r1&apos; and have
   PKGR ?= &quot;${PR}${EXTENDPRAUTO}&quot;
   EXTENDPKGV ?= &quot;${EXTENDPKGEVER}${PKGV}-${PKGR}&quot;
   RDEPENDS_${PN}-dev = &quot;${PN} (= ${EXTENDPKGV})&quot;
in bitbake.conf, when PR Server is enabled, EXTENDPRAUTO is not none.

5, When multilib is enabled, RDEPENDS_${PN}-dev is not expanded correctly which uses PR rather than PKGR in the versioned dependency string.

*solution
When write_specfile at do_package_rpm, make sure PKGR rahter than PR in version string.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30818</commentid>
    <comment_count>1</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-03-19 02:56:00 +0000</bug_when>
    <thetext>diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index b6d76e7..5108ccc 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -610,7 +610,14 @@ python write_specfile () {
                             pv = subd[&apos;PV&apos;]
                             pkgv = subd[&apos;PKGV&apos;]
                             reppv = pkgv.replace(&apos;-&apos;, &apos;+&apos;)
-                            verlist.append(ver.replace(pv, reppv).replace(pkgv, reppv))
+                            ver = ver.replace(pv, reppv).replace(pkgv, reppv)
+                        if &apos;PKGR&apos; in subd:
+                            # Make sure PKGR rahter than PR in ver
+                            pr = subd[&apos;PR&apos;]
+                            pkgr = subd[&apos;PKGR&apos;]
+                            import re
+                            ver = re.compile(&apos;-&apos;+pr+&apos;$&apos;).sub(&apos;-&apos;+pkgr, ver)
+                        verlist.append(ver)
                     else:
                         verlist.append(ver)
                 newdeps_dict[dep] = verlist</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31397</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-04-02 21:50:53 +0000</bug_when>
    <thetext>Could you reproduce this problem after http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=7803f5f98cf4d12d59ac793d9eb0048b701cafb7 and http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=b5e5d25c25f30db1f9855e24afef9d8f0bb77d35 were applied?

Note that current master won&apos;t show the issue since the &quot;-&quot; character was removed from neard&apos;s PV field. It would be good to know if the above commit was enough to resolve this issue though?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31407</commentid>
    <comment_count>3</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-04-03 06:16:05 +0000</bug_when>
    <thetext>Yes, the problem could be reproduced if add `IMAGE_INSTALL_append = 
&quot; lib32-neard-dev lib32-neard-dbg&quot;&apos; in local.conf.
The neard&apos;s PV field is ok, but the PKGV of lib32-neard-dev and
lib32-neard-dbg is incorrect.

1, In the neard.spec of lib32-neard:
  2 Name: neard
  3 Version: 0.10+git0+eb486bf35e24d7d1db61350f5ab393a0c880523d
  4 Release: r0.1
...
145 %package -n neard-dbg
...
149 Suggests: neard = 0.10+git0+eb486bf35e24d7d1db61350f5ab393a0c880523d-r0

2, `r0.1&apos; rather than `r0&apos; in the Suggests of neard-dbg is what we need.

3, The test is based on the master fd4e5c6c58183f1a017c6b5fe4d43c320e273567.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31408</commentid>
    <comment_count>4</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-04-03 06:19:01 +0000</bug_when>
    <thetext>diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index b6d76e7..34cf904 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -610,7 +610,14 @@ python write_specfile () {
                             pv = subd[&apos;PV&apos;]
                             pkgv = subd[&apos;PKGV&apos;]
                             reppv = pkgv.replace(&apos;-&apos;, &apos;+&apos;)
-                            verlist.append(ver.replace(pv, reppv).replace(pkgv, reppv))
+                            ver = ver.replace(pv, reppv).replace(pkgv, reppv)
+                        if &apos;PKGR&apos; in subd:
+                            # Make sure PKGR rather than PR in ver
+                            pr = &apos;-&apos; + subd[&apos;PR&apos;]
+                            pkgr = &apos;-&apos; + subd[&apos;PKGR&apos;]
+                            if pkgr not in ver:
+                                ver = ver.replace(pr, pkgr)
+                        verlist.append(ver)
                     else:
                         verlist.append(ver)
                 newdeps_dict[dep] = verlist</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31409</commentid>
    <comment_count>5</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-04-03 06:24:20 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; Yes, the problem could be reproduced if add `IMAGE_INSTALL_append = 
&gt; &quot; lib32-neard-dev lib32-neard-dbg&quot;&apos; in local.conf.
&gt; The neard&apos;s PV field is ok, but the PKGV of lib32-neard-dev and
&gt; lib32-neard-dbg is incorrect.
&gt; 
The PV of lib32-neard-dev and lib32-neard-dbg is incorrect, we should
make sure PKGR rather than PR in package version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31941</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-04-11 13:05:22 +0000</bug_when>
    <thetext>Fixed in master with http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=c567366d3b933d6a840e793845f81c3ecbe83585</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32330</commentid>
    <comment_count>7</comment_count>
    <who name="Ning Zhang">ning.zhang</who>
    <bug_when>2013-04-18 05:18:13 +0000</bug_when>
    <thetext>Verified env:
    poky: 90b98764555945a186562ca8d501a9585ce2b23f
    branch: master
Verified steps:
    1. Create a new build, modify conf/local.conf as below:

MACHINE = &quot;qemux86-64&quot;
PACKAGE_CLASSES = &quot;package_rpm&quot;
require conf/multilib.conf
MULTILIBS = &quot;multilib:lib32&quot;
DEFAULTTUNE_virtclass-multilib-lib32 = &quot;x86&quot;
PRSERV_HOST = &quot;localhost:10000&quot;
INHERIT += &quot;buildhistory&quot;
BUILDHISTORY_COMMIT = &quot;1&quot; 
IMAGE_INSTALL_append = &quot; lib32-neard-dev lib32-neard-dbg&quot;

    2. bitbake core-image-sato
    3. start qemux86-64

Result:
    The build success and qemu could be started.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>