<?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>14720</bug_id>
          
          <creation_ts>2022-02-11 15:09:43 +0000</creation_ts>
          <short_desc>PACKAGE_EXCLUDE doesn&apos;t work with opkg 0.5</short_desc>
          <delta_ts>2022-02-25 13:14:17 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>opkg</product>
          <component>opkg</component>
          <version>0.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>next-patch</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Samuli Piippo">samuli.piippo</reporter>
          <assigned_to name="Samuli Piippo">samuli.piippo</assigned_to>
          <cc>alex.stewart</cc>
    
    <cc>randy.macleod</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>92541</commentid>
    <comment_count>0</comment_count>
    <who name="Samuli Piippo">samuli.piippo</who>
    <bug_when>2022-02-11 15:09:43 +0000</bug_when>
    <thetext>After opkg was upgraded to 0.5.0 (9e2a5d6557ca7d2c3aea39cfe18003e35310db34), PACKAGE_EXCLUDE no longer works.

with configurations:

PACKAGE_CLASSES = &quot;package_ipk&quot;
IMAGE_FEATURES += &quot;dev-pkgs&quot;
PACKAGE_EXCLUDE += &quot;base-files-dev&quot;

core-image-minimal build fails:

ERROR: core-image-minimal-1.0-r0 do_rootfs: Unable to install packages. Command &apos;/home/qt/build-core/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/bin/opkg --volatile-cache -f /home/qt/build-core/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/opkg.conf -t /home/qt/build-core/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/temp/ipktemp/ -o /home/qt/build-core/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/rootfs  --force_postinstall --prefer-arch-to-version  --add-exclude base-files-dev --add-exclude base-files-dev install base-files-dev base-passwd-dev busybox-dev eudev-dev init-ifupdown-dev init-system-helpers-dev initscripts-dev kmod-dev libc6-dev libz-dev modutils-initscripts-dev netbase-dev packagegroup-core-boot-dev run-postinsts-dev sysvinit-dev sysvinit-inittab-dev update-rc.d-dev util-linux-dev v86d-dev&apos; returned 1:
 * Solver encountered 1 problem(s):
 * Problem 1/1:
 *   - package base-files-dev-3.0.14-r89.qemux86_64 can only be installed by a direct request
 *   - conflicting requests
 * 
 * Solution 1:
 *   - install base-files-dev-3.0.14-r89.qemux86_64

 * Solution 2:
 *   - do not ask to install a package providing base-files-dev</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92570</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-02-17 15:34:44 +0000</bug_when>
    <thetext>Regression, can you work on this Alex?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92581</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-02-17 16:31:19 +0000</bug_when>
    <thetext>Alex, I may have botched the Product, Component, Milestone for this bug.
The intent is that this should be fixed ASAP since M3 is early next week.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92582</commentid>
    <comment_count>3</comment_count>
    <who name="Alex Stewart">alex.stewart</who>
    <bug_when>2022-02-17 16:52:05 +0000</bug_when>
    <thetext>@rmacleod, @spiippo
I would guess that this bug is almost certainly hitting the behavior added in opkg commit 4517d1bc87e9bfc0877d565230a4aeb42c474ba9 [1]. Previously, packages given to opkg via the `--add-exclude` argument were not propagated to libsolv, meaning that you could end up with an invalid set of installed packages in cases where the &apos;excluded&apos; package conflicts.

So in the BB output capture, libsolv/opkg is saying &quot;you have asked me to install packages, but some of them depend on `base-files-dev` - which you have said is supposed to be &apos;excluded&apos; from the solution&quot;.

My reading of the `PACKAGE_EXCLUDE` BB var [2] suggests that is a correct interpretation of the variable. So I believe that opkg&apos;s behavior has changed since 0.4.5, but I&apos;m not convinced that opkg is incorrect here.

Some arguments which would change my mind:

(1) If none of the packages which are being &apos;installed&apos; have a dependency on `base-files-dev`, then opkg shouldn&apos;t be complaining. Is that the case?

(2) If my interpretation of the `PACKAGE_EXCLUDE` BB variable is incongruous with the rest of the community, and everyone else reads it as: &quot;these are files which should be included in the package-solve, but not installed by opkg afterwards.&quot; (which could leave opkg in an invalid state; I don&apos;t like that.)

Thoughts?

---

[1] https://git.yoctoproject.org/opkg/commit/?id=4517d1bc87e9bfc0877d565230a4aeb42c474ba9
[2] https://docs.yoctoproject.org/current/ref-manual/variables.html?highlight=package_exclude#term-PACKAGE_EXCLUDE</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92587</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-02-17 21:41:25 +0000</bug_when>
    <thetext>Thanks for the explaination Alex.
I don&apos;t have time right now to develop an opinion.... Samuli?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92674</commentid>
    <comment_count>5</comment_count>
    <who name="Samuli Piippo">samuli.piippo</who>
    <bug_when>2022-02-25 13:14:17 +0000</bug_when>
    <thetext>Looks like this is user error after all.
When using the IMAGE_FEATURES globs, PACKAGE_EXCLUDE_COMPLEMENTARY should be used instead of PACKAGE_EXCLUDE.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>