<?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>11427</bug_id>
          
          <creation_ts>2017-04-27 10:44:43 +0000</creation_ts>
          <short_desc>opkg: libresolv backend fails to find depenednecies on x86/core2-32 platforms (BAD_RECOMMENDS issue/docs/better debug output?)</short_desc>
          <delta_ts>2019-02-08 15:43:33 +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>2.3</version>
          <rep_platform>x86</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.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Holger Freyther">holger</reporter>
          <assigned_to name="Alejandro del Castillo">alejandro.delcastillo</assigned_to>
          <cc>alejandro.delcastillo</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>mikko.ylinen</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</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>72888</commentid>
    <comment_count>0</comment_count>
    <who name="Holger Freyther">holger</who>
    <bug_when>2017-04-27 10:44:43 +0000</bug_when>
    <thetext>Trying to build for my &quot;sysmocom-bsc-v2&quot; machine (tuning for core2-32) will fail to build a rootfs on missing dependency. Using PACKAGECONFIG_pn-opkg... = &quot;&quot; to disable the libresolv backend is resolving the issue.


Error output:
NOTE: Installing the following packages: rauc dropbear task-core-boot opkg
NOTE: /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/recipe-sysroot-native/usr/bin/opkg --volatile-cache -f /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/opkg.conf -t /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/temp/ipktemp/ -o /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/rootfs  --force_postinstall --prefer-arch-to-version   install rauc dropbear task-core-boot opkg
ERROR: Unable to install packages. Command &apos;/home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/recipe-sysroot-native/usr/bin/opkg --volatile-cache -f /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/opkg.conf -t /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/temp/ipktemp/ -o /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/rootfs  --force_postinstall --prefer-arch-to-version   install rauc dropbear task-core-boot opkg&apos; returned 1:
Collected errors:
 * opkg_finalize_intercepts: Failed to open dir /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/temp/ipktemp//opkg-vA5gmJ/opkg-intercept-P0Esvt: No such file or directory.
 * rm_r: Failed to open dir /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/temp/ipktemp//opkg-vA5gmJ/opkg-intercept-P0Esvt: No such file or directory.
 * rm_r: Failed to open dir /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/temp/ipktemp//opkg-vA5gmJ: No such file or directory.
Solver encountered 1 problem(s):
Problem 1/1:
  - nothing provides kbd needed by keymaps-1.0-r31.0.bsc_v2

Solution 1:
  - do not ask to install a package providing task-core-boot



Package is available:

$ cat opkg.conf 
arch all 1
arch any 6
arch noarch 11
arch x86 16
arch i586 21
arch core2-32 26
arch bsc_v2 31
src oe file:/home/hfreyther/images/poky-resurrection/new/tmp/deploy/ipk
src oe-all file:/home/hfreyther/images/poky-resurrection/new/tmp/deploy/ipk/all
src oe-core2-32 file:/home/hfreyther/images/poky-resurrection/new/tmp/deploy/ipk/core2-32
src oe-bsc_v2 file:/home/hfreyther/images/poky-resurrection/new/tmp/deploy/ipk/bsc_v2


$ cat rootfs/var/lib/opkg/lists/oe-core2-32 | egrep -C 18 &quot;Package: kbd$&quot;
...
Package: kbd
Version: 2.0.4-r0.0
Depends: libc6 (&gt;= 2.25), update-alternatives-opkg
Provides: console-tools
Replaces: console-tools
Conflicts: console-tools
Section: base
Architecture: core2-32
Maintainer: Poky &lt;poky@yoctoproject.org&gt;
MD5Sum: ee695f031f2c524929318d0f0738e453
Size: 167626
Filename: kbd_2.0.4-r0.0_core2-32.ipk
Source: http://cdn.kernel.org/pub/linux/utils/kbd/kbd-2.0.4.tar.xz file://run-ptest file://set-proper-path-of-resources.patch
Description: Keytable files and keyboard utilities
 Keytable files and keyboard utilities.
OE: kbd
License: GPLv2+
Priority: optional



Debug output of -V4 and kbd (and kbd is only in the core2-32 Packages file so not sure why there is dup)

$ grep &quot;kbd &quot; temp/log.do_rootfs
pkg_vec_insert_merge: Adding new pkg=kbd version=2.0.4 arch=core2-32.
pkg_vec_insert_merge: kbd 2.0.4 arch=core2-32 vs. kbd 2.0.4 arch=core2-32.
pkg_vec_insert_merge: Duplicate for pkg=kbd version=2.0.4 arch=core2-32.
pkg_vec_insert_merge: Merging kbd 2.0.4 arch=core2-32, set_status=1.
pkg2solvable: kbd-dev depends kbd = 2.0.4-r0.0
  - nothing provides kbd needed by keymaps-1.0-r31.0.bsc_v2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72910</commentid>
    <comment_count>1</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2017-04-27 18:51:49 +0000</bug_when>
    <thetext>Nothing stands out as being clearly of...but I am suspecting the root cause may be a behavior change between internalsolv and libsolv: Provides dependencies that have version constrains have to be real packages. The libsolv behavior is more restrictive, but is the correct one by Debian policy [1].

Seems like opkg is failing when installing task-core-boot. A way to get more info would be to try to manually run the opkg install command on task-core-boot [2]. I would assume that will fail on keymaps. Then the idea would be to try to install keymaps manually, so we can get down the tree chain (and so on).


[1] https://www.debian.org/doc/debian-policy/ch-relationships.html (Provides section)
[2] /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/recipe-sysroot-native/usr/bin/opkg --volatile-cache -f /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/opkg.conf -t /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/temp/ipktemp/ -o /home/hfreyther/images/poky-resurrection/new/tmp/work/bsc_v2-poky-linux/image-rauc-rescue-initramfs/1.0-r0/rootfs  --force_postinstall --prefer-arch-to-version   install task-core-boot</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72911</commentid>
    <comment_count>2</comment_count>
    <who name="Holger Freyther">holger</who>
    <bug_when>2017-04-27 18:53:40 +0000</bug_when>
    <thetext>so you would like to have &quot;opkg -V4 install keymaps&quot;? What are you looking for?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72912</commentid>
    <comment_count>3</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2017-04-27 18:59:35 +0000</bug_when>
    <thetext>yes, if you can go down the chain would be great. So, try to install task-core-boot first. If that fails because keymaps can&apos;t be installed, then try to install keymaps. If keymaps fail because X , then try X. I am basically trying to see what&apos;s the dependency that can&apos;t be satisified.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72913</commentid>
    <comment_count>4</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2017-04-27 18:59:54 +0000</bug_when>
    <thetext>yes, if you can go down the chain would be great. So, try to install task-core-boot first. If that fails because keymaps can&apos;t be installed, then try to install keymaps. If keymaps fail because X , then try X. I am basically trying to see what&apos;s the dependency that can&apos;t be satisified.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72914</commentid>
    <comment_count>5</comment_count>
    <who name="Holger Freyther">holger</who>
    <bug_when>2017-04-27 19:00:44 +0000</bug_when>
    <thetext>Am I missing something but isn&apos;t it printed?

task-core-boot -&gt; keymaps -&gt; kbd (kbd can&apos;t as it seems to have been eliminated, merged with itself?)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72915</commentid>
    <comment_count>6</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2017-04-27 19:23:55 +0000</bug_when>
    <thetext>Nope, you are not missing anything. I mainly wanted to see at which node the dependency fails, but I guess it&apos;s clear it&apos;s on keymaps. Can you paste the control file of keymaps then?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72958</commentid>
    <comment_count>7</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2017-05-01 21:08:23 +0000</bug_when>
    <thetext>also, instructions on how to reproduce the problem can go a long way. If you could provide me with those, it will be simpler for me to root cause what&apos;s going on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72959</commentid>
    <comment_count>8</comment_count>
    <who name="Holger Freyther">holger</who>
    <bug_when>2017-05-01 21:12:19 +0000</bug_when>
    <thetext>Sorry. I didn&apos;t have the time to try the rootfs by hand.

1.) Get your pyro poky
2.) Get the BSP
git clone git://git.sysmocom.de/poky/meta-sysmocom-bsp/
3.) Use &quot;sysmocom-bsc-v2&quot; as MACHINE type
4.) build &quot;image-rauc-rescue-initramfs&quot;

(there are other layers like meta-telephony but they should not be required here</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72984</commentid>
    <comment_count>9</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2017-05-02 22:29:37 +0000</bug_when>
    <thetext>I was able to reproduce the problem using both dnf and opkg. After digging a bit more:

adelcast@delcastillo2 ~/upstream/poky/meta-sysmocom-bsp $ grep -R BAD_RECOMMENDATIONS | grep kbd
recipes-core/images/image-rauc-rescue-initramfs.bb:BAD_RECOMMENDATIONS_append = &quot; busybox-syslog kbd kbd-consolefonts kbd-keymaps&quot;

removing the BAD_RECOMMENDATIONS fixes the issue. According to the yocto manual [1]:

&quot;It is important to realize that if you choose to not install packages using this variable and some other packages are dependent on them (i.e. listed in a recipe&apos;s RDEPENDS variable), the OpenEmbedded build system ignores your request and will install the packages to avoid dependency errors.&quot;

which confused me a bit, since packagegroup-core-boot depends on keymaps, which depends on kbd. However, that seems to be a documentation/bug issue with OE, not with opkg, so I am closing this ticket as not a bug. Feel free to re-open if you experience something different that points to opkg directly.


[1] http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72986</commentid>
    <comment_count>10</comment_count>
    <who name="Holger Freyther">holger</who>
    <bug_when>2017-05-03 07:16:30 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; I was able to reproduce the problem using both dnf and opkg. After digging a
&gt; bit more:
&gt; 
&gt; adelcast@delcastillo2 ~/upstream/poky/meta-sysmocom-bsp $ grep -R
&gt; BAD_RECOMMENDATIONS | grep kbd
&gt; recipes-core/images/image-rauc-rescue-initramfs.bb:
&gt; BAD_RECOMMENDATIONS_append = &quot; busybox-syslog kbd kbd-consolefonts
&gt; kbd-keymaps&quot;


Oh! How did you debug that? Maybe this is something for opkg to ease? E.g. I didn&apos;t notice anything related to BAD_RECOMMENDATIONS in the output.


&gt; &quot;It is important to realize that if you choose to not install packages using
&gt; this variable and some other packages are dependent on them (i.e. listed in
&gt; a recipe&apos;s RDEPENDS variable), the OpenEmbedded build system ignores your
&gt; request and will install the packages to avoid dependency errors.&quot;
&gt; 
&gt; which confused me a bit, since packagegroup-core-boot depends on keymaps,
&gt; which depends on kbd. However, that seems to be a documentation/bug issue
&gt; with OE, not with opkg, so I am closing this ticket as not a bug. Feel free
&gt; to re-open if you experience something different that points to opkg
&gt; directly.

I disagree here. Te above says &quot;ignores your request&quot; but with libresolv it will fail. I don&apos;t mind it failing (it is probably an improvement) but it should lead to an error that is easier to understand?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73003</commentid>
    <comment_count>11</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2017-05-03 15:26:23 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #9)
&gt; &gt; I was able to reproduce the problem using both dnf and opkg. After digging a
&gt; &gt; bit more:
&gt; &gt; 
&gt; &gt; adelcast@delcastillo2 ~/upstream/poky/meta-sysmocom-bsp $ grep -R
&gt; &gt; BAD_RECOMMENDATIONS | grep kbd
&gt; &gt; recipes-core/images/image-rauc-rescue-initramfs.bb:
&gt; &gt; BAD_RECOMMENDATIONS_append = &quot; busybox-syslog kbd kbd-consolefonts
&gt; &gt; kbd-keymaps&quot;
&gt; 
&gt; 
&gt; Oh! How did you debug that? Maybe this is something for opkg to ease? E.g. I
&gt; didn&apos;t notice anything related to BAD_RECOMMENDATIONS in the output.

The installation succeeded if I manually deleted the file that keep package status (/var/lib/opkg/status) and manually tried to install keymaps. Looking at that file, I noticed that kbd status was set to &quot;deinstall hold not-installed&quot;, which is not a common status. Grepping on oe-core found that in oe-core at lib/oe/package_manager.py OE is manually modifying the status file in the case of BAD_RECOMMENDATIONS. 

Opkg (and dnf) are correctly identifying the conflict, so I don&apos;t think there is anything for opkg to do. As I mentioned, if this worked on the internal solver, then this probably means OE needs to change it&apos;s BAD_RECOMMENDATIONS code to have it worked as before.

&gt; &gt; &quot;It is important to realize that if you choose to not install packages using
&gt; &gt; this variable and some other packages are dependent on them (i.e. listed in
&gt; &gt; a recipe&apos;s RDEPENDS variable), the OpenEmbedded build system ignores your
&gt; &gt; request and will install the packages to avoid dependency errors.&quot;
&gt; &gt; 
&gt; &gt; which confused me a bit, since packagegroup-core-boot depends on keymaps,
&gt; &gt; which depends on kbd. However, that seems to be a documentation/bug issue
&gt; &gt; with OE, not with opkg, so I am closing this ticket as not a bug. Feel free
&gt; &gt; to re-open if you experience something different that points to opkg
&gt; &gt; directly.
&gt; 
&gt; I disagree here. Te above says &quot;ignores your request&quot; but with libresolv it
&gt; will fail. I don&apos;t mind it failing (it is probably an improvement) but it
&gt; should lead to an error that is easier to understand?

I do believe BAD_RECOMMENDS is not working as advertised, but that is not an opkg issue (it also fails with dnf), but an OE issue. I am not saying that the request should be ignored, what I am saying is that it shouldn&apos;t be tagged as an opkg issue but as an OE issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73036</commentid>
    <comment_count>12</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-05-04 10:35:39 +0000</bug_when>
    <thetext>Reopen against OE-Core as there is likely an issue here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73079</commentid>
    <comment_count>13</comment_count>
    <who name="Mikko Ylinen">mikko.ylinen</who>
    <bug_when>2017-05-05 11:06:43 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; Reopen against OE-Core as there is likely an issue here.

FWIW, we&apos;re seeing this too.

A package is listed in BAD_RECOMMENDATIONS and when I add it in a packagegroup (the packagegroup RDEPENDS on that package), I get the same failure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73435</commentid>
    <comment_count>14</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2017-05-22 22:49:29 +0000</bug_when>
    <thetext>I took a look at the code again, and looks to me like the current implementation for opkg is a bit hackish (it manually pins the bad recommends package to be deinstalled). Looking at dnf, it uses an --exclude flag to signal BAD_RECOMMENDS packages. I haven&apos;t tried this myself, but I am guessing those excludes will be ignored if there is a hard dependency.

I would be open to implement an --excludes flag in opkg (or at least give it a shot, if libsolv provides a way to signal that a package should be excluded, unless it&apos;s a hard dependency). If that pans out, we could keep the solution that changes the status file directly for opkg internalsolver, but have the --exclude flag solution for libsolv.

Ross, let me know your thoughts to see if I show move ahead and explore adding the --exclude option.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73693</commentid>
    <comment_count>15</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-06-05 20:07:36 +0000</bug_when>
    <thetext>--exclude sounds like a much better solution than hacking the status file.  Did you look at what dpkg/apt does?  I believe you can do something like:

$ apt-get install foo thing-that-foo-recommends- 

To install foo but not thing-that-foo-recommends (the trailing hyphen being the trick).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77319</commentid>
    <comment_count>16</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2017-10-03 22:08:21 +0000</bug_when>
    <thetext>Today, I finally decided to take another stab at this.

Looking into opkg, I realized that it already have a -add-exclude flag that does exactly the same thing as dnf --excludes. However, neither of those flags solve the BAD_RECOMMENDATIONS issue as they unconditionally exclude the listed packages. I ran a test where I included in an image package A and B, where A recommends C and B depends on C. I added a BAD_RECOMMENDATIONS=C. The expected behavior was to have package A, B and C installed (BAD_RECOMMENDATIONS would be ignored, since C depends on B). Instead, I got a solver &quot;nothing provides C&quot; error on both dnf and opkg.

At this point I am not sure how to proceed forward as it looks like we may need a libsolv way to implement something similar to smart&apos;s ignore-recommends per-package flag. Maybe we can loop in the dnf mantainer to decide on the best way forward for both opkg and dnf, since this is a feature request for both package managers? any other ideas?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79296</commentid>
    <comment_count>17</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2018-02-01 17:11:50 +0000</bug_when>
    <thetext>I prototyped a solution that adds a new --add-ignore-recommends option to opkg. That option is based on the libsolv solver flag SOLVER_DISFAVOR. The problem is that SOLVER_DISFAVOR doesn&apos;t work in conjunction with SOLVER_FLAG_STRONG_RECOMMENDS, which opkg uses to enforce recommended packages upgrades. I opened a bug ticket to libsolv [1]. This ticket is blocked until the libsolv ticket is solved.

[1] https://github.com/openSUSE/libsolv/issues/254</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82557</commentid>
    <comment_count>18</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2018-12-20 20:32:50 +0000</bug_when>
    <thetext>The libsolv fix just landed on master. I tested with my prototype of --add-ignore-recommends and it worked, so we have a path forward. I am going to wait until libsolv releases (0.7.3) to submit the new opkg feature (--add-ignore-recommends flag). Once that is in, we need to put the patches on OE, then modify OE BAD_RECOMMENDATIONS code to use the new flag.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82974</commentid>
    <comment_count>19</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2019-02-08 15:43:33 +0000</bug_when>
    <thetext>Commit 0d11e813ba9b4e8de9e6e5099ff85f5d914243bc replaces the current BAD_RECOMMENDATIONS implementation with the one based on the new opkg flag --add-ignore-recommends. This should fix the issue on this ticket.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>