Bug 1070

Summary: [deb] core-image-sato-sdk and meta-toolchain-gmae: can't build
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Dexuan Cui <dexuan.cui>
Component: coreAssignee: Dexuan Cui <dexuan.cui>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: liang.li2, liangliang.wang, lianhao.lu, meta.mr.watcher, meta.watcher, sgw, yi.zhao
Version: unspecified   
Target Milestone: 1.1   
Hardware: x86   
OS: Multiple   
Whiteboard: patch sent out for review (Sep 14, 2011)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Bug Depends on: 1298    
Bug Blocks: 1086    
Attachments:
Description Flags
sato-sdk.deb.log none

Description Dexuan Cui 2011-05-13 02:27:51 UTC
Created attachment 155 [details]
sato-sdk.deb.log

This is a deb-only issue. rpm and ipk are ok here.


| Reading package lists...
| Building dependency tree...
| Reading state information...
| You might want to run `apt-get -f install' to correct these:
| The following packages have unmet dependencies:
|   dpkg: Depends: update-alternatives-cworth but it is not going to be installed
|   task-core-boot: Depends: update-alternatives-cworth but it is not going to be installed
|   task-core-qt-demos: Depends: quicky but it is not going to be installed
|                       Depends: fotowall but it is not going to be installed
| E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
| ERROR: Function 'do_rootfs' failed (see /distro/dcui/110512/p1/build/tmp/work/qemuarm-poky-linux-gnueabi/core-image-sato-sdk-1.0-r0/temp/log.do_rootfs.27321 for further information)
| ERROR: Function 'do_rootfs' failed (see /distro/dcui/110512/p1/build/tmp/work/qemuarm-poky-linux-gnueabi/core-image-sato-sdk-1.0-r0/temp/log.do_rootfs.27321 for further information)
NOTE: package core-image-sato-sdk-1.0-r0: task do_rootfs: Failed

The log file is attached.
Comment 1 Wenzong.Fan 2011-08-09 00:46:09 UTC
I got the similar error messages:
---------------------
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  task-base-dev: Depends: task-base (= 1.0-r72) but it is not going to be installed
E: Broken packages
ERROR: Function 'do_rootfs' failed (see /home/wenzong/sdb2/builds/1070_2/tmp/work/qemuarm-poky-linux-gnueabi/core-image-sato-sdk-1.0-r0/temp/log.do_rootfs.8945 for further information)
-----------------------

I have added the 'task-base' to 'POKY_BASE_INSTALL':
POKY_BASE_INSTALL = '\
+    task-base \

and it also be included in the 'package_to_install', I don't know why it still not be installed?

Folks, do you have any ideas/suggestions about this?
Comment 2 Dongxiao Xu 2011-08-24 19:37:12 UTC
Dexuan should be the owner.
Comment 3 Dexuan Cui 2011-08-26 00:07:56 UTC
(In reply to comment #0)
> Created attachment 155 [details]
> sato-sdk.deb.log
> 
> This is a deb-only issue. rpm and ipk are ok here.
> 
> 
> | Reading package lists...
> | Building dependency tree...
> | Reading state information...
> | You might want to run `apt-get -f install' to correct these:
> | The following packages have unmet dependencies:
> |   dpkg: Depends: update-alternatives-cworth but it is not going to be
> installed
> |   task-core-boot: Depends: update-alternatives-cworth but it is not going to
> be installed
> |   task-core-qt-demos: Depends: quicky but it is not going to be installed
> |                       Depends: fotowall but it is not going to be installed
> | E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify
> a solution).
> | ERROR: Function 'do_rootfs' failed (see
> /distro/dcui/110512/p1/build/tmp/work/qemuarm-poky-linux-gnueabi/core-image-sato-sdk-1.0-r0/temp/log.do_rootfs.27321
> for further information)
> | ERROR: Function 'do_rootfs' failed (see
> /distro/dcui/110512/p1/build/tmp/work/qemuarm-poky-linux-gnueabi/core-image-sato-sdk-1.0-r0/temp/log.do_rootfs.27321
> for further information)
> NOTE: package core-image-sato-sdk-1.0-r0: task do_rootfs: Failed
> 
> The log file is attached.

I think for DEB packaging, we should use update-alternatives-dpkg rather than update-alternatives-cworth:
diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
index d51ac64..d4ade0b 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -6,7 +6,7 @@ PREFERRED_PROVIDER_virtual/db-native ?= "db-native"
 PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xf86"
 PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xf86-dri-lite"
 PREFERRED_PROVIDER_virtual/libgl ?= "mesa-xlib"
-PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives-cworth"
+PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives-dpkg"
 PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "opkg-native"
 PREFERRED_PROVIDER_virtual/libx11 ?= "libx11-trim"
 PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
@@ -14,7 +14,7 @@ PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
 #
 # Default virtual runtime providers
 #
-VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-cworth"
+VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-dpkg"

I'm trying to do more tests and will update later.
Comment 4 Lianhao Lu 2011-08-26 00:11:48 UTC
(In reply to comment #3)

> I think for DEB packaging, we should use update-alternatives-dpkg rather than
> update-alternatives-cworth:
> diff --git a/meta/conf/distro/include/default-providers.inc
> b/meta/conf/distro/include/default-providers.inc
> index d51ac64..d4ade0b 100644
> --- a/meta/conf/distro/include/default-providers.inc
> +++ b/meta/conf/distro/include/default-providers.inc
> @@ -6,7 +6,7 @@ PREFERRED_PROVIDER_virtual/db-native ?= "db-native"
>  PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xf86"
>  PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xf86-dri-lite"
>  PREFERRED_PROVIDER_virtual/libgl ?= "mesa-xlib"
> -PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives-cworth"
> +PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives-dpkg"
>  PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "opkg-native"
>  PREFERRED_PROVIDER_virtual/libx11 ?= "libx11-trim"
>  PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
> @@ -14,7 +14,7 @@ PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
>  #
>  # Default virtual runtime providers
>  #
> -VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-cworth"
> +VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-dpkg"
> 

Does this means using update-alternatives-dpkg for ipk? opkg can NOT use update-alternatives-dpkg.
Comment 5 Dexuan Cui 2011-08-26 00:25:27 UTC
(In reply to comment #4)
> (In reply to comment #3)
> 
> > I think for DEB packaging, we should use update-alternatives-dpkg rather than
> > update-alternatives-cworth:
> > diff --git a/meta/conf/distro/include/default-providers.inc
> > b/meta/conf/distro/include/default-providers.inc
> > index d51ac64..d4ade0b 100644
> > --- a/meta/conf/distro/include/default-providers.inc
> > +++ b/meta/conf/distro/include/default-providers.inc
> > @@ -6,7 +6,7 @@ PREFERRED_PROVIDER_virtual/db-native ?= "db-native"
> >  PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xf86"
> >  PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xf86-dri-lite"
> >  PREFERRED_PROVIDER_virtual/libgl ?= "mesa-xlib"
> > -PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives-cworth"
> > +PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives-dpkg"
> >  PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "opkg-native"
> >  PREFERRED_PROVIDER_virtual/libx11 ?= "libx11-trim"
> >  PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
> > @@ -14,7 +14,7 @@ PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
> >  #
> >  # Default virtual runtime providers
> >  #
> > -VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-cworth"
> > +VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-dpkg"
> > 
> 
> Does this means using update-alternatives-dpkg for ipk? opkg can NOT use
> update-alternatives-dpkg.
Thanks for the reminder! So the right fix should be: in general we use the -cworth one, and for deb we use the -dpkg one.

Below is an improved patch I'm testing:

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 48aa232..f24c70b 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -14,6 +14,9 @@ DPKG_ARCH_i586 ?= "i386"
 DPKG_ARCH_i686 ?= "i386"
 DPKG_ARCH_pentium ?= "i386"

+PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives-dpkg"
+VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-dpkg"
+
 PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"

 python package_deb_fn () {
diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
index d51ac64..1619101 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -6,7 +6,7 @@ PREFERRED_PROVIDER_virtual/db-native ?= "db-native"
 PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xf86"
 PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xf86-dri-lite"
 PREFERRED_PROVIDER_virtual/libgl ?= "mesa-xlib"
-PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives-cworth"
+PREFERRED_PROVIDER_virtual/update-alternatives ??= "update-alternatives-cworth"
 PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "opkg-native"
 PREFERRED_PROVIDER_virtual/libx11 ?= "libx11-trim"
 PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
@@ -14,7 +14,7 @@ PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
 #
 # Default virtual runtime providers
 #
-VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-cworth"
+VIRTUAL-RUNTIME_update-alternatives ??= "update-alternatives-cworth"

 #
 # Default recipe providers
Comment 6 Dexuan Cui 2011-08-26 00:29:17 UTC
(In reply to comment #5)
> So the right fix should be: in general we use the
> -cworth one, and for deb we use the -dpkg one.
> 
> Below is an improved patch I'm testing:
> 
> diff --git a/meta/classes/package_deb.bbclass
> b/meta/classes/package_deb.bbclass
> index 48aa232..f24c70b 100644
> --- a/meta/classes/package_deb.bbclass
> +++ b/meta/classes/package_deb.bbclass
> @@ -14,6 +14,9 @@ DPKG_ARCH_i586 ?= "i386"
>  DPKG_ARCH_i686 ?= "i386"
>  DPKG_ARCH_pentium ?= "i386"
> 
> +PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives-dpkg"
> +VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-dpkg"
> +
We can make here clearer: the ?= can be = here.

>  PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
> 
>  python package_deb_fn () {
> diff --git a/meta/conf/distro/include/default-providers.inc
> b/meta/conf/distro/include/default-providers.inc
> index d51ac64..1619101 100644
> --- a/meta/conf/distro/include/default-providers.inc
> +++ b/meta/conf/distro/include/default-providers.inc
> @@ -6,7 +6,7 @@ PREFERRED_PROVIDER_virtual/db-native ?= "db-native"
>  PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xf86"
>  PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xf86-dri-lite"
>  PREFERRED_PROVIDER_virtual/libgl ?= "mesa-xlib"
> -PREFERRED_PROVIDER_virtual/update-alternatives ?= "update-alternatives-cworth"
> +PREFERRED_PROVIDER_virtual/update-alternatives ??=
> "update-alternatives-cworth"
>  PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "opkg-native"
>  PREFERRED_PROVIDER_virtual/libx11 ?= "libx11-trim"
>  PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
> @@ -14,7 +14,7 @@ PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
>  #
>  # Default virtual runtime providers
>  #
> -VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-cworth"
> +VIRTUAL-RUNTIME_update-alternatives ??= "update-alternatives-cworth"
> 
>  #
>  # Default recipe providers
Comment 7 Dexuan Cui 2011-08-26 00:32:18 UTC
I'm testing and this may need several hours.
After the bug is fixed, I'll also try bug 1086.
Comment 8 Dexuan Cui 2011-08-30 02:50:27 UTC
(In reply to comment #7)
> I'm testing and this may need several hours.
> After the bug is fixed, I'll also try bug 1086.

Later I found 2 more issues:
1) we should skip the log_check  for the spurious error msgs for packages in package_attemptonly;
2) meta/recipes-devtools/dpkg/dpkg.inc's pkg_postinst_dpkg seems buggy, I think it should be do_install_append (like that in OE)

After fixing the 2 issues, core-image-sato-sdk can build fine.

I'm refining the patches and doing tests and I'll plan to send the patches out tomorrow.
Comment 9 Dexuan Cui 2011-09-13 05:50:11 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > I'm testing and this may need several hours.
> > After the bug is fixed, I'll also try bug 1086.
> 
> Later I found 2 more issues:
> 1) we should skip the log_check  for the spurious error msgs for packages in
> package_attemptonly;
> 2) meta/recipes-devtools/dpkg/dpkg.inc's pkg_postinst_dpkg seems buggy, I think
> it should be do_install_append (like that in OE)
> 
> After fixing the 2 issues, core-image-sato-sdk can build fine.
> 
> I'm refining the patches and doing tests and I'll plan to send the patches out
> tomorrow.

Per RP's suggestion, update-alternatives-cworth should also be OK in deb packaging.
So I debugged more to find the real issue:
Actually both dpkg and update-alternatives-cworth supply /usr/bin/update-alternatives and this causes conflict:

| Unpacking dpkg (from ..././dpkg_1.15.8.7-r6.0_i386.deb) ...
| dpkg: warning: overriding problem because --force enabled:
|  trying to overwrite '/usr/bin/update-alternatives', which is also in package update-alternatives-cworth 1:0.1.8+svnr625-r2
| (Noting disappearance of update-alternatives-cworth, which has been completely replaced.)
| dpkg: warning: overriding problem because --force enabled:
|  package architecture (i386) does not match system (amd64)
| Selecting previously deselected package apt.
| Unpacking apt (from .../i586/./apt_0.7.14-r7_i386.deb) ...
| + '[' 0 -ne 0 ']'
| + for i in '${package_to_install}'
| + apt-get install task-core-sdk --force-yes --allow-unauthenticated
| Reading package lists...
| Building dependency tree...
| Reading state information...
| You might want to run `apt-get -f install' to correct these:
| The following packages have unmet dependencies:
| dpkg: Depends: update-alternatives-cworth but it is not going to be installed
| task-core-boot: Depends: update-alternatives-cworth but it is not going to be installed

I think the fix can be: we let dpkg not supply the binary:


--- a/meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb
+++ b/meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb
@@ -20,6 +20,6 @@ EXTRA_OECONF = "--without-static-progs \

 BBCLASSEXTEND = "native"

-do_install_append_virtclass-native () {
+do_install_append() {
    rm ${D}${bindir}/update-alternatives
 }

I've done some tests and this works.
I will send the patch out soon.
Comment 10 Dexuan Cui 2011-09-14 07:57:51 UTC
Actually, currently with deb packaging, we have 2 more issues when running
"bitbake meta-toolchain-gmae".

1) when MACHINE="qemux86", SDKMACHINE="i686", INSTALL_BASEARCH_DEB is "i686",
too. This causes the following ERROR:
| E: Couldn't find package task-sdk-host-nativesdk
NOTE: package meta-toolchain-gmae-1.0-r6: task do_populate_sdk: Failed

This is becasue: due to the DPKG_ARCH mapping, we create such a deb package
tmp/deploy/deb/i686-nativesdk/task-sdk-host-nativesdk_1.0-r10_i386.deb; dpkg
can't recoginze the package. We need to map INSTALL_BASEARCH_DEB in the same
way.

2) when MACHINE="qemux86", SDKMACHINE="x86_64", INSTALL_BASEARCH_DEB is
"x86_64", too.
We get such an ERROR:
| E: Couldn't find package task-cross-canadian-i586
NOTE: package meta-toolchain-gmae-1.0-r6: task do_populate_sdk: Failed

This is because: dpkg can't recognize the generated package
tmp/deploy/deb/x86_64-nativesdk/task-cross-canadian-i586_1.0-r0_i386.deb
Here the "i386" suffix is incorrect and should be "x86_64" -- the i386
comes from the line
DPKG_ARCH_i586 ?= "i386" in package_deb.bbclass.
However, for canadian package, actually here the overriding of DPKG (from
"x86-64" to "i386") should not happen -- it accidently happens just because
TARGET_ARCH exists in OVERRIDES. We can move the overriding logic to the
anonymous python function to work this around.


I've sent the patch out just now.