<?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>14987</bug_id>
          
          <creation_ts>2022-12-13 09:14:14 +0000</creation_ts>
          <short_desc>rpm package dependency version rewrite fails for &apos;perf&apos; with 6.1 kernel</short_desc>
          <delta_ts>2023-01-10 10:17:03 +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>4.0.3</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>normal</bug_severity>
          <target_milestone>4.2 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Enrico Jorns">ejo</reporter>
          <assigned_to name="Pavel Zhukov">pavel</assigned_to>
          <cc>bruce.ashfield</cc>
    
    <cc>bst</cc>
    
    <cc>ejo</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>yocto</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>94522</commentid>
    <comment_count>0</comment_count>
    <who name="Enrico Jorns">ejo</who>
    <bug_when>2022-12-13 09:14:14 +0000</bug_when>
    <thetext>We have noticed, that with kernel version 6.1 the package dependency rewrite magic of the package_rpm.bbclass fails for the &apos;perf&apos; recipe.

What happens is, that the perf-dev package gets a faulty dependency on the perf package:

&gt;  perf = 6.6.1.0-r9

As you will notice, there is one &quot;6&quot; too much. E.g. generating an SDK that includes perf (and thus actually installs perf-dev) will fail with a dependency error:

&gt; Error: 
&gt;  Problem: conflicting requests
&gt;   - nothing provides perf = 6.6.1.0-r9 needed by perf-dev-6.1.0-r9.nxp_imx8mp_evk

While it is quite clear why this happens, a proper fix for this is unclear to me since I do not have an overview of the history and corner cases that seemed to be covered by the rpm rename handling. But maybe someone has? :)


A more detailed description of the error cause:

Perf has PV set to &quot;1.0&quot; default and gets &quot;PKGV&quot; from the kernel sources (using KERNEL_VERSION of kernelsrc.bbclass) during &apos;do_package&apos;.
For the above-noted case, PKGV will be set to &quot;6.1.0&quot;.

Now, since rpm allows only a single &apos;-&apos; in the dependency version (as a separator between &quot;Version&quot; and &quot;Release&quot;), the translate_vers() method attempts to rewrite the package dependency string and replace &apos;-&apos; by &apos;+&apos;.
This is however useless in case of perf since the only &quot;-&quot; contained is for the revision (&quot;-r9&quot;) but the check is triggered anyway by:

&gt; if &apos;-&apos; in ver:

with &apos;ver&apos; being &apos;6.1.0-r9&apos; in this case.

The lines

&gt; if &apos;PKGV&apos; in subd:
&gt;     pv = subd[&apos;PV&apos;]
&gt;     pkgv = subd[&apos;PKGV&apos;]
&gt;     reppv = pkgv.replace(&apos;-&apos;, &apos;+&apos;)
&gt;     ver = ver.replace(pv, reppv).replace(pkgv, reppv)

then lead to a replacement of the substring &quot;1.0&quot; (pv) in &quot;6.1.0-r9&quot; (ver)  with &quot;6.1.0&quot; (reppv).
Which then produces the above-mentioned &quot;6.6.1.0-r9&quot; dependency version string.

This replacement has always been attempted but never succeeded as long as the kernel PKGV did not contain &quot;1.0&quot;.
This however changes with &quot;6.1.0&quot; now (and should have happened with &quot;5.1.0&quot;, too).
Since 6.1 will be the next LTS kernel, people will likely run into this.


Reported-by: Bastian-Krause &lt;b.krause@pengutronix.de&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94540</commentid>
    <comment_count>1</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2022-12-15 23:51:23 +0000</bug_when>
    <thetext>Strangely, I&apos;m not seeing the same behaviour:

root@qemux86-64-c9:~# rpm -qa |grep perf
perf-dev-6.1.0-r9.qemux86_64
perf-6.1.0-r9.qemux86_64
root@qemux86-64-c9:~# uname -a
Linux qemux86-64-c9 6.1.0-yocto-standard #1 SMP PREEMPT_DYNAMIC Wed Dec 14 21:14:11 UTC 2022 x86_64 GNU/Linux

Can you elaborate on your setup ? distro ? host distro ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94543</commentid>
    <comment_count>2</comment_count>
    <who name="Enrico Jorns">ejo</who>
    <bug_when>2022-12-16 15:07:20 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Strangely, I&apos;m not seeing the same behaviour:
&gt; 
&gt; root@qemux86-64-c9:~# rpm -qa |grep perf
&gt; perf-dev-6.1.0-r9.qemux86_64
&gt; perf-6.1.0-r9.qemux86_64

Yes, the generated package versions aren&apos;t affected.
But dependencies within the dev-package should be:

rpm -qR tmp/deploy/rpm/qemux86_64/perf-dev-6.1.0-r9.qemux86_64.rpm
perf = 6.6.1.0-r9
[...]

Adding an &quot;IMAGE_INSTALL:append = &quot; perf-dev&quot; should be sufficient to trigger the issue during do_rootfs.

&gt; root@qemux86-64-c9:~# uname -a
&gt; Linux qemux86-64-c9 6.1.0-yocto-standard #1 SMP PREEMPT_DYNAMIC Wed Dec 14
&gt; 21:14:11 UTC 2022 x86_64 GNU/Linux
&gt; 
&gt; Can you elaborate on your setup ? distro ? host distro ?

Poky git with poky distro. Host distro is Debian 11.

Detailed info:

Build Configuration:
BB_VERSION           = &quot;2.0.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;4.0.5&quot;
TUNE_FEATURES        = &quot;m64 core2&quot;
TARGET_FPU           = &quot;&quot;
meta                 
meta-poky            
meta-yocto-bsp       = &quot;HEAD:c8839099506ee9c694f5b9da3ef6cc7cf0b2c142&quot;


ERROR: core-image-minimal-1.0-r0 do_rootfs: Could not invoke dnf. Command &apos;[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c [..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/yum.repos.d --installroot=[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs --setopt=logdir=[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/temp --repofrompath=oe-repo,[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo --nogpgcheck install dnf packagegroup-core-boot perf-dev rpm run-postinsts&apos; returned 1:
DNF version: 4.11.1
cachedir: [..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/var/cache/dnf
Added oe-repo repo from [..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo
User-Agent: falling back to &apos;libdnf&apos;: could not detect OS or basearch
repo: using cache for: oe-repo
oe-repo: using metadata from Fri 16 Dec 2022 02:56:56 PM UTC.
Last metadata expiration check: 0:00:01 ago on Fri 16 Dec 2022 02:56:57 PM UTC.
--&gt; Starting dependency resolution
--&gt; Finished dependency resolution
Error: 
 Problem: conflicting requests
  - nothing provides perf = 6.6.1.0-r9 needed by perf-dev-6.1.0-r9.qemux86_64
(try to add &apos;--skip-broken&apos; to skip uninstallable packages)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94546</commentid>
    <comment_count>3</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2022-12-16 17:35:18 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; &gt; Strangely, I&apos;m not seeing the same behaviour:
&gt; &gt; 
&gt; &gt; root@qemux86-64-c9:~# rpm -qa |grep perf
&gt; &gt; perf-dev-6.1.0-r9.qemux86_64
&gt; &gt; perf-6.1.0-r9.qemux86_64
&gt; 
&gt; Yes, the generated package versions aren&apos;t affected.
&gt; But dependencies within the dev-package should be:
&gt; 
&gt; rpm -qR tmp/deploy/rpm/qemux86_64/perf-dev-6.1.0-r9.qemux86_64.rpm
&gt; perf = 6.6.1.0-r9
&gt; [...]
&gt; 
&gt; Adding an &quot;IMAGE_INSTALL:append = &quot; perf-dev&quot; should be sufficient to
&gt; trigger the issue during do_rootfs.
&gt; 

Interesting. I&apos;m of course using poky master as well, as I&apos;m finalizing the new reference kernels, and I had worked through 6.1 before our fall release, as it was the development kernel.

And for my perf-dev testing, I have it in my local.conf in a similar manner.

grep perf-dev conf/local.conf
#CORE_IMAGE_EXTRA_INSTALL += &quot; perf perf-dev&quot;
IMAGE_INSTALL:append = &quot; perf-dev&quot;

Either technique works, and I&apos;m able to built, install and see it on the target.

I&apos;ll continue to poke at this a bit more.

&gt; &gt; root@qemux86-64-c9:~# uname -a
&gt; &gt; Linux qemux86-64-c9 6.1.0-yocto-standard #1 SMP PREEMPT_DYNAMIC Wed Dec 14
&gt; &gt; 21:14:11 UTC 2022 x86_64 GNU/Linux
&gt; &gt; 
&gt; &gt; Can you elaborate on your setup ? distro ? host distro ?
&gt; 
&gt; Poky git with poky distro. Host distro is Debian 11.
&gt; 
&gt; Detailed info:
&gt; 
&gt; Build Configuration:
&gt; BB_VERSION           = &quot;2.0.0&quot;
&gt; BUILD_SYS            = &quot;x86_64-linux&quot;
&gt; NATIVELSBSTRING      = &quot;universal&quot;
&gt; TARGET_SYS           = &quot;x86_64-poky-linux&quot;
&gt; MACHINE              = &quot;qemux86-64&quot;
&gt; DISTRO               = &quot;poky&quot;
&gt; DISTRO_VERSION       = &quot;4.0.5&quot;
&gt; TUNE_FEATURES        = &quot;m64 core2&quot;
&gt; TARGET_FPU           = &quot;&quot;
&gt; meta                 
&gt; meta-poky            
&gt; meta-yocto-bsp       = &quot;HEAD:c8839099506ee9c694f5b9da3ef6cc7cf0b2c142&quot;
&gt; 
&gt; 
&gt; ERROR: core-image-minimal-1.0-r0 do_rootfs: Could not invoke dnf. Command
&gt; &apos;[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-
&gt; sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c
&gt; [..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/dnf/
&gt; dnf.conf
&gt; --setopt=reposdir=[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-
&gt; r0/rootfs/etc/yum.repos.d
&gt; --installroot=[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/
&gt; rootfs
&gt; --setopt=logdir=[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-
&gt; r0/temp
&gt; --repofrompath=oe-repo,[..]/tmp/work/qemux86_64-poky-linux/core-image-
&gt; minimal/1.0-r0/oe-rootfs-repo --nogpgcheck install dnf
&gt; packagegroup-core-boot perf-dev rpm run-postinsts&apos; returned 1:
&gt; DNF version: 4.11.1
&gt; cachedir:
&gt; [..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/var/
&gt; cache/dnf
&gt; Added oe-repo repo from
&gt; [..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo
&gt; User-Agent: falling back to &apos;libdnf&apos;: could not detect OS or basearch
&gt; repo: using cache for: oe-repo
&gt; oe-repo: using metadata from Fri 16 Dec 2022 02:56:56 PM UTC.
&gt; Last metadata expiration check: 0:00:01 ago on Fri 16 Dec 2022 02:56:57 PM
&gt; UTC.
&gt; --&gt; Starting dependency resolution
&gt; --&gt; Finished dependency resolution
&gt; Error: 
&gt;  Problem: conflicting requests
&gt;   - nothing provides perf = 6.6.1.0-r9 needed by perf-dev-6.1.0-r9.qemux86_64
&gt; (try to add &apos;--skip-broken&apos; to skip uninstallable packages)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94547</commentid>
    <comment_count>4</comment_count>
    <who name="Enrico Jorns">ejo</who>
    <bug_when>2022-12-17 10:26:05 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; (In reply to comment #1)
&gt; &gt; &gt; Strangely, I&apos;m not seeing the same behaviour:
&gt; &gt; &gt; 
&gt; &gt; &gt; root@qemux86-64-c9:~# rpm -qa |grep perf
&gt; &gt; &gt; perf-dev-6.1.0-r9.qemux86_64
&gt; &gt; &gt; perf-6.1.0-r9.qemux86_64
&gt; &gt; 
&gt; &gt; Yes, the generated package versions aren&apos;t affected.
&gt; &gt; But dependencies within the dev-package should be:
&gt; &gt; 
&gt; &gt; rpm -qR tmp/deploy/rpm/qemux86_64/perf-dev-6.1.0-r9.qemux86_64.rpm
&gt; &gt; perf = 6.6.1.0-r9
&gt; &gt; [...]
&gt; &gt; 
&gt; &gt; Adding an &quot;IMAGE_INSTALL:append = &quot; perf-dev&quot; should be sufficient to
&gt; &gt; trigger the issue during do_rootfs.
&gt; &gt; 
&gt; 
&gt; Interesting. I&apos;m of course using poky master as well, as I&apos;m finalizing the
&gt; new reference kernels, and I had worked through 6.1 before our fall release,
&gt; as it was the development kernel.
&gt; 
&gt; And for my perf-dev testing, I have it in my local.conf in a similar manner.

Ok, I was still using kirkstone for testing but assumed master should behave the same since the code I assumed to be responsible did not change there.

Interestingly, since I have now tested against master, the issue is actually gone.

But as far as I can tell this is only because suddenly the &quot;perf-dev&quot; package does not depend on the &quot;perf&quot; package at all.

I have not yet further investigated if this is by design or by accident.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94548</commentid>
    <comment_count>5</comment_count>
    <who name="Pavel Zhukov">pavel</who>
    <bug_when>2022-12-18 15:16:12 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; (In reply to comment #1)
&gt; &gt; &gt; Strangely, I&apos;m not seeing the same behaviour:
&gt; &gt; &gt; 
&gt; &gt; &gt; root@qemux86-64-c9:~# rpm -qa |grep perf
&gt; &gt; &gt; perf-dev-6.1.0-r9.qemux86_64
&gt; &gt; &gt; perf-6.1.0-r9.qemux86_64
&gt; &gt; 
&gt; &gt; Yes, the generated package versions aren&apos;t affected.
&gt; &gt; But dependencies within the dev-package should be:
&gt; &gt; 
&gt; &gt; rpm -qR tmp/deploy/rpm/qemux86_64/perf-dev-6.1.0-r9.qemux86_64.rpm
&gt; &gt; perf = 6.6.1.0-r9
&gt; &gt; [...]
&gt; &gt; 
&gt; &gt; Adding an &quot;IMAGE_INSTALL:append = &quot; perf-dev&quot; should be sufficient to
&gt; &gt; trigger the issue during do_rootfs.
&gt; &gt; 
&gt; 
&gt; Interesting. I&apos;m of course using poky master as well, as I&apos;m finalizing the
&gt; new reference kernels, and I had worked through 6.1 before our fall release,
&gt; as it was the development kernel.
&gt; 
&gt; And for my perf-dev testing, I have it in my local.conf in a similar manner.
&gt; 
&gt; grep perf-dev conf/local.conf
&gt; #CORE_IMAGE_EXTRA_INSTALL += &quot; perf perf-dev&quot;
&gt; IMAGE_INSTALL:append = &quot; perf-dev&quot;
&gt; 
&gt; Either technique works, and I&apos;m able to built, install and see it on the
&gt; target.
&gt; 
&gt; I&apos;ll continue to poke at this a bit more.
&gt; 
&gt; &gt; &gt; root@qemux86-64-c9:~# uname -a
&gt; &gt; &gt; Linux qemux86-64-c9 6.1.0-yocto-standard #1 SMP PREEMPT_DYNAMIC Wed Dec 14
&gt; &gt; &gt; 21:14:11 UTC 2022 x86_64 GNU/Linux
&gt; &gt; &gt; 
&gt; &gt; &gt; Can you elaborate on your setup ? distro ? host distro ?
&gt; &gt; 
&gt; &gt; Poky git with poky distro. Host distro is Debian 11.
&gt; &gt; 
&gt; &gt; Detailed info:
&gt; &gt; 
&gt; &gt; Build Configuration:
&gt; &gt; BB_VERSION           = &quot;2.0.0&quot;
&gt; &gt; BUILD_SYS            = &quot;x86_64-linux&quot;
&gt; &gt; NATIVELSBSTRING      = &quot;universal&quot;
&gt; &gt; TARGET_SYS           = &quot;x86_64-poky-linux&quot;
&gt; &gt; MACHINE              = &quot;qemux86-64&quot;
&gt; &gt; DISTRO               = &quot;poky&quot;
&gt; &gt; DISTRO_VERSION       = &quot;4.0.5&quot;
&gt; &gt; TUNE_FEATURES        = &quot;m64 core2&quot;
&gt; &gt; TARGET_FPU           = &quot;&quot;
&gt; &gt; meta                 
&gt; &gt; meta-poky            
&gt; &gt; meta-yocto-bsp       = &quot;HEAD:c8839099506ee9c694f5b9da3ef6cc7cf0b2c142&quot;
&gt; &gt; 
&gt; &gt; 
&gt; &gt; ERROR: core-image-minimal-1.0-r0 do_rootfs: Could not invoke dnf. Command
&gt; &gt; &apos;[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-
&gt; &gt; sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c
&gt; &gt; [..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/dnf/
&gt; &gt; dnf.conf
&gt; &gt; --setopt=reposdir=[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-
&gt; &gt; r0/rootfs/etc/yum.repos.d
&gt; &gt; --installroot=[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/
&gt; &gt; rootfs
&gt; &gt; --setopt=logdir=[..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-
&gt; &gt; r0/temp
&gt; &gt; --repofrompath=oe-repo,[..]/tmp/work/qemux86_64-poky-linux/core-image-
&gt; &gt; minimal/1.0-r0/oe-rootfs-repo --nogpgcheck install dnf
&gt; &gt; packagegroup-core-boot perf-dev rpm run-postinsts&apos; returned 1:
&gt; &gt; DNF version: 4.11.1
&gt; &gt; cachedir:
&gt; &gt; [..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/var/
&gt; &gt; cache/dnf
&gt; &gt; Added oe-repo repo from
&gt; &gt; [..]/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo
&gt; &gt; User-Agent: falling back to &apos;libdnf&apos;: could not detect OS or basearch
&gt; &gt; repo: using cache for: oe-repo
&gt; &gt; oe-repo: using metadata from Fri 16 Dec 2022 02:56:56 PM UTC.
&gt; &gt; Last metadata expiration check: 0:00:01 ago on Fri 16 Dec 2022 02:56:57 PM
&gt; &gt; UTC.
&gt; &gt; --&gt; Starting dependency resolution
&gt; &gt; --&gt; Finished dependency resolution
&gt; &gt; Error: 
&gt; &gt;  Problem: conflicting requests
&gt; &gt;   - nothing provides perf = 6.6.1.0-r9 needed by perf-dev-6.1.0-r9.qemux86_64
&gt; &gt; (try to add &apos;--skip-broken&apos; to skip uninstallable packages)

I guess it was fixed in https://git.openembedded.org/openembedded-core/commit/?id=bf2096a43d56c2d633a4b6e3db9e4390da4be6e2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94554</commentid>
    <comment_count>6</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2022-12-19 01:06:47 +0000</bug_when>
    <thetext>Richard merged the fix, closing</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>