diff mbox series

[1/3] dummy-sdk-package.inc: Filter packages which are marked for installation

Message ID 20231004161318.576312-1-pavel@zhukoff.net
State New
Headers show
Series [1/3] dummy-sdk-package.inc: Filter packages which are marked for installation | expand

Commit Message

Pavel Zhukov Oct. 4, 2023, 4:13 p.m. UTC
if packages is provided by dummysdk and in the same time marked for
installation with IMAGE_INSTALL it causes conflict in apt because virtual providers are
not taken into account if package is asked to be installed explicitly.
Filter such packages from provides/conflicts to workaround this problem.
This workaround brakes RPM usecase because of file conlicts with
DUMMYPROVIDES, use DUMMYPROVIDES_PACKAGES_MULTILIB instead (which
doesn't include file based conflicts).
While this is needed for the case of package_deb only adding it for all
package managers to not complicate the code.

Fixes: [Yocto #13338] [Yocto #14066]

Fixes:
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 target-sdk-provides-dummy : Conflicts: bash
E: Unable to correct problems, you have held broken packages.

Signed-off-by: Pavel Zhukov <pavel@zhukoff.net>
---
 meta/recipes-core/meta/dummy-sdk-package.inc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Alexandre Belloni Oct. 5, 2023, 7:28 p.m. UTC | #1
Hello,

This series causes the following failure:

https://autobuilder.yoctoproject.org/typhoon/#/builders/20/builds/8312/steps/12/logs/stdio

| Can't locate Text/Tabs.pm in @INC (you may need to install the Text::Tabs module) (@INC entries checked: /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/bitbake-build-2946y_hb/tmp/work/x86_64-linux/automake-native/1.16.5/build/lib/ /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/bitbake-build-2946y_hb/tmp/work/x86_64-linux/automake-native/1.16.5/build/../automake-1.16.5/lib/ /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/../..//usr/lib/perl5/site_perl/5.38.0/x86_64-linux /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/../..//usr/lib/perl5/site_perl/5.38.0 /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/../..//usr/lib/perl5/vendor_perl/5.38.0 /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/../..//usr/lib/perl5/5.38.0/x86_64-linux /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/../..//usr/lib/perl5/5.38.0 /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/site_perl/5.38.0/x86_64-linux /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/site_perl/5.38.0 /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/vendor_perl/5.38.0/x86_64-linux /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/vendor_perl/5.38.0 /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/5.38.0/x86_64-linux /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/5.38.0) at ../automake-1.16.5/doc/help2man line 28.
| BEGIN failed--compilation aborted at ../automake-1.16.5/doc/help2man line 28.
| make: *** [Makefile:3741: doc/aclocal-1.16.1] Error 2
| make: *** Waiting for unfinished jobs....
| if LC_ALL=C grep '@[a-zA-Z0-9_][a-zA-Z0-9_]*@' runtest-t; then echo "runtest contains unexpanded substitution (see lines above)"; exit 1; fi; chmod a-w runtest-t && mv -f runtest-t runtest
| Can't locate Text/Tabs.pm in @INC (you may need to install the Text::Tabs module) (@INC entries checked: /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/bitbake-build-2946y_hb/tmp/work/x86_64-linux/automake-native/1.16.5/build/lib/ /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/bitbake-build-2946y_hb/tmp/work/x86_64-linux/automake-native/1.16.5/build/../automake-1.16.5/lib/ /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/../..//usr/lib/perl5/site_perl/5.38.0/x86_64-linux /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/../..//usr/lib/perl5/site_perl/5.38.0 /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/../..//usr/lib/perl5/vendor_perl/5.38.0 /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/../..//usr/lib/perl5/5.38.0/x86_64-linux /home/pokybuild/yocto-worker/buildtools/build/build/tmp/work/x86_64-nativesdk-pokysdk-linux/buildtools-extended-tarball/1.0/testimage-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/../..//usr/lib/perl5/5.38.0 /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/site_perl/5.38.0/x86_64-linux /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/site_perl/5.38.0 /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/vendor_perl/5.38.0/x86_64-linux /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/vendor_perl/5.38.0 /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/5.38.0/x86_64-linux /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/perl5/5.38.0) at ../automake-1.16.5/doc/help2man line 28.
| BEGIN failed--compilation aborted at ../automake-1.16.5/doc/help2man line 28.
| make: *** [Makefile:3743: doc/automake-1.16.1] Error 2
| if LC_ALL=C grep '@[a-zA-Z0-9_][a-zA-Z0-9_]*@' t/ax/shell-no-trail-bslash-t; then echo "t/ax/shell-no-trail-bslash contains unexpanded substitution (see lines above)"; exit 1; fi; chmod a-w t/ax/shell-no-trail-bslash-t && mv -f t/ax/shell-no-trail-bslash-t t/ax/shell-no-trail-bslash
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.

On 04/10/2023 18:13:16+0200, Pavel Zhukov wrote:
> if packages is provided by dummysdk and in the same time marked for
> installation with IMAGE_INSTALL it causes conflict in apt because virtual providers are
> not taken into account if package is asked to be installed explicitly.
> Filter such packages from provides/conflicts to workaround this problem.
> This workaround brakes RPM usecase because of file conlicts with
> DUMMYPROVIDES, use DUMMYPROVIDES_PACKAGES_MULTILIB instead (which
> doesn't include file based conflicts).
> While this is needed for the case of package_deb only adding it for all
> package managers to not complicate the code.
> 
> Fixes: [Yocto #13338] [Yocto #14066]
> 
> Fixes:
> The following information may help to resolve the situation:
> 
> The following packages have unmet dependencies:
>  target-sdk-provides-dummy : Conflicts: bash
> E: Unable to correct problems, you have held broken packages.
> 
> Signed-off-by: Pavel Zhukov <pavel@zhukoff.net>
> ---
>  meta/recipes-core/meta/dummy-sdk-package.inc | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-core/meta/dummy-sdk-package.inc b/meta/recipes-core/meta/dummy-sdk-package.inc
> index bd26e39ad3..6ccafbf8bc 100644
> --- a/meta/recipes-core/meta/dummy-sdk-package.inc
> +++ b/meta/recipes-core/meta/dummy-sdk-package.inc
> @@ -19,13 +19,14 @@ PR[vardeps] += "DUMMYPROVIDES"
>  PR[vardeps] += "DUMMYPROVIDES_PACKAGES"
>  
>  DUMMYPROVIDES_PACKAGES ??= ""
> -DUMMYPROVIDES_PACKAGES_MULTILIB = "${@' '.join([multilib_pkg_extend(d, pkg) for pkg in d.getVar('DUMMYPROVIDES_PACKAGES').split()])}"
> +DUMMYPROVIDES_PACKAGES_FILTERED = "${@' '.join([pkg for pkg in d.getVar('DUMMYPROVIDES_PACKAGES').split() if d.getVar('IMAGE_INSTALL') is not None and pkg not in d.getVar('IMAGE_INSTALL').split()])}"
> +DUMMYPROVIDES_PACKAGES_MULTILIB = "${@' '.join([multilib_pkg_extend(d, pkg) for pkg in d.getVar('DUMMYPROVIDES_PACKAGES_FILTERED').split()])}"
>  DUMMYPROVIDES += "${DUMMYPROVIDES_PACKAGES_MULTILIB}"
>  
>  python populate_packages:prepend() {
>      p = d.getVar("PN")
>      d.appendVar("RPROVIDES:%s" % p, "${DUMMYPROVIDES}")
> -    d.appendVar("RCONFLICTS:%s" % p, "${DUMMYPROVIDES}")
> +    d.appendVar("RCONFLICTS:%s" % p, "${DUMMYPROVIDES_PACKAGES_MULTILIB}")
>      d.appendVar("RREPLACES:%s" % p, "${DUMMYPROVIDES_PACKAGES_MULTILIB}")
>  }
>  
> -- 
> 2.41.0
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#188690): https://lists.openembedded.org/g/openembedded-core/message/188690
> Mute This Topic: https://lists.openembedded.org/mt/101758725/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Pavel Zhukov Oct. 6, 2023, 6:37 a.m. UTC | #2
Hi Alex,

Thank you for heads up. Interesting breakage... Reproduced locally.
diff mbox series

Patch

diff --git a/meta/recipes-core/meta/dummy-sdk-package.inc b/meta/recipes-core/meta/dummy-sdk-package.inc
index bd26e39ad3..6ccafbf8bc 100644
--- a/meta/recipes-core/meta/dummy-sdk-package.inc
+++ b/meta/recipes-core/meta/dummy-sdk-package.inc
@@ -19,13 +19,14 @@  PR[vardeps] += "DUMMYPROVIDES"
 PR[vardeps] += "DUMMYPROVIDES_PACKAGES"
 
 DUMMYPROVIDES_PACKAGES ??= ""
-DUMMYPROVIDES_PACKAGES_MULTILIB = "${@' '.join([multilib_pkg_extend(d, pkg) for pkg in d.getVar('DUMMYPROVIDES_PACKAGES').split()])}"
+DUMMYPROVIDES_PACKAGES_FILTERED = "${@' '.join([pkg for pkg in d.getVar('DUMMYPROVIDES_PACKAGES').split() if d.getVar('IMAGE_INSTALL') is not None and pkg not in d.getVar('IMAGE_INSTALL').split()])}"
+DUMMYPROVIDES_PACKAGES_MULTILIB = "${@' '.join([multilib_pkg_extend(d, pkg) for pkg in d.getVar('DUMMYPROVIDES_PACKAGES_FILTERED').split()])}"
 DUMMYPROVIDES += "${DUMMYPROVIDES_PACKAGES_MULTILIB}"
 
 python populate_packages:prepend() {
     p = d.getVar("PN")
     d.appendVar("RPROVIDES:%s" % p, "${DUMMYPROVIDES}")
-    d.appendVar("RCONFLICTS:%s" % p, "${DUMMYPROVIDES}")
+    d.appendVar("RCONFLICTS:%s" % p, "${DUMMYPROVIDES_PACKAGES_MULTILIB}")
     d.appendVar("RREPLACES:%s" % p, "${DUMMYPROVIDES_PACKAGES_MULTILIB}")
 }