Subject: Failed to rebuild image after building it's SDK with MULTILIBS feature enabled #yocto To: poky@lists.yoctoproject.org From: ip.jango@gmail.com X-Originating-Location: Moscow, RU (80.87.144.137) X-Originating-Platform: Linux Chrome 83 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Tue, 14 Jul 2020 08:18:35 -0700 Message-ID: Content-Type: multipart/alternative; boundary="sxcu26yGtXBk7MnvsISP" --sxcu26yGtXBk7MnvsISP Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello everyone, found you a tricky bug:) I have a build with *MULTILIBS* enabled ( x86_64 + x86 , but aarch64 + arm= v7 have the save issue). When building an image everything is ok. Then I bu= ild SDK (with -c populate_sdk ) and after that build of the image itself br= eaks on do_rootfs task. MULTILIBS is important, because without this feature everything is ok - sa= me chain (build image, than SDK, than rebuild image) works. The problem is in *lib32-glibc-locale-en-gb*. When building image, lib32-g= libc-locale-en-gb doesn't appear as a dependency and is not built. But when= building the SDK of this image, it also builds a lib32-glibc-locale-en-gb = package and packs it into SDK. Than rebuilding the image issues an error: >=20 >=20 > WARNING : symway-image-docker-1.0-r0 do_rootfs: Unable to install packag= es. > Command > '/build-yocto/build/tmp/work/x86_64_docker-poky-linux/symway-image-docke= r/1.0-r0/recipe-sysroot-native/usr/bin/opkg > --volatile-cache -f /build-yocto > /build/tmp/work/x86_64_docker-poky-linux/symway-image-docker/1.0-r0/opkg= .conf > -t > /build-yocto/build/tmp/work/x86_64_docker-poky-linux/symway-image-docker= /1.0-r0/temp/ipktemp/ > -o /build-yocto/build/tmp/work/x86_64_docker-poky-linux/ > symway-image-docker/1.0-r0/rootfs =C2=A0--force_postinstall > --prefer-arch-to-version =C2=A0--add-exclude lib32-glibc-locale-en-gb > --force-maintainer --force-overwrite --add-exclude > lib32-glibc-locale-en-gb install avahi-locale-en-gb cups-loc > ale-en glibc-locale-en-gb lib32-glibc-locale-en-gb > lib32-libglib-2.0-locale-en-gb lib32-libpam-locale-en-gb > lib32-shared-mime-info-locale-en-gb libglib-2.0-locale-en-gb > libpam-locale-en-gb shared-mime-info-locale-en-gb wget-locale- > en-gb' returned 255: > Collected errors: > * opkg_prepare_url_for_install: Couldn't find anything to satisfy > 'lib32-glibc-locale-en-gb'. > WARNING : symway-image-docker-1.0-r0 do_rootfs: [log_check] > symway-image-docker: found 1 warning message in the logfile: > [log_check] WARNING: Unable to install packages. Command > '/build-yocto/build/tmp/work/x86_64_docker-poky-linux/symway-image-docke= r/1.0-r0/recipe-sysroot-native/usr/bin/opkg > --volatile-cache -f /build-yocto/build/tmp/work/x86_64_doc > ker-poky-linux/symway-image-docker/1.0-r0/opkg.conf -t > /build-yocto/build/tmp/work/x86_64_docker-poky-linux/symway-image-docker= /1.0-r0/temp/ipktemp/ > -o > /build-yocto/build/tmp/work/x86_64_docker-poky-linux/symway-image-docker= /1.0-r0 >=20 > /rootfs =C2=A0--force_postinstall --prefer-arch-to-version =C2=A0--add-e= xclude > lib32-glibc-locale-en-gb --force-maintainer --force-overwrite > --add-exclude lib32-glibc-locale-en-gb install avahi-locale-en-gb > cups-locale-en glibc-locale-en-gb > lib32-glibc-locale-en-gb lib32-libglib-2.0-locale-en-gb > lib32-libpam-locale-en-gb lib32-shared-mime-info-locale-en-gb > libglib-2.0-locale-en-gb libpam-locale-en-gb shared-mime-info-locale-en-= gb > wget-locale-en-gb' returned 255: >=20 > ERROR : symway-image-docker-1.0-r0 do_rootfs: [log_check] > symway-image-docker: found 1 error message in the logfile: > [log_check] Collected errors: >=20 >=20 *Build configuration* (using *dunfell 3.1* ) *:* >=20 > BB_VERSION =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =3D "1.46.0" > BUILD_SYS =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=3D "x86_64-linux" > NATIVELSBSTRING =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=3D "universal" > TARGET_SYS =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =3D "x86_64-poky-linux" > MACHINE =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=3D "x86-64-docker" > DISTRO =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=3D "symway" > DISTRO_VERSION =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=3D "3.1" > TUNE_FEATURES =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=3D "m64 core2" > TARGET_FPU =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =3D "" > meta-oe > meta-initramfs > meta-multimedia > meta-networking > meta-filesystems > meta-python =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=3D "H= EAD:a62ad77973b16daac1cbaa03cbda3c6b9b91f2ff" > meta > meta-poky > meta-yocto-bsp =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=3D "HEAD:5d47cdf448b= 6cff5bb7cc5b0ba0426b8235ec478" >=20 Looks like the problem is somewhere in *poky/meta/lib/oe/package_manager.p= y* and/or *poky/scripts/oe-pkgdata-util*. After building image itself there is no anything about package lib32-glibc= -locale-en-gb in build/tmp/pkgdata/. But after building SDK p= ackage lib32-glibc-locale-en-gb appears as: * *build/tmp/pkgdata//runtime-reverse/lib32-glibc-locale-en-= gb* * build/tmp/pkgdata//runtime/lib32-glibc-locale-en-gb * build/tmp/pkgdata//runtime/lib32-glibc-locale-en-gb.packag= ed Than during *re* building of the image *build/tmp/work/....//1= .0-r0/oe-rootfs-repo* is generated correctly - there is no anything about l= ib32-glibc-locale-en-gb ( no lib32-glibc-locale-en-gb....ipk ). PackageMana= ger:install_complementary method ( package_manager.py:554 ) generates packa= ges list from this directory correctly. But than oe-pkgdata-util:glob funct= ion ( oe-pkgdata-util:37 )=C2=A0uses another directory ( build/tmp/pkgdata/= ) for generating globbed complementary packages list; there = we have lib32-glibc-locale-en-gb. That's how lib32-glibc-locale-en-gb appea= rs in complementary packages list and is tried to be installed... and fails= as there is no lib32-glibc-locale-en-gb...ipk in build/tmp/work/....//1.0-r0/oe-rootfs-repo. My first attempt to workaround was variable *PACKAGE_EXCLUDE_COMPLEMENTARY= * , but it didn't work)) I tried to exclude directly package lib32-glibc-lo= cale-en-gb from complementary packages list, but function oe-pkgdata-util:g= lob uses the same correct package list from build/tmp/work/....//1.0-r0/oe-rootfs-repo for excluding and only after that analyses build/tm= p/pkgdata/ directory. Finally lib32-glibc-locale-en-gb appear= ed in complementary packages list by hitting search through PN (see oe-pkgd= ata-util:glob ). So finally my solution is to patch oe-pkgdata-util:glob so PACKAGE_EXCLUDE= _COMPLEMENTARY works correctly: >=20 >=20 > diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util > index 93220e3617..de60f38e1b 100755 > --- a/scripts/oe-pkgdata-util > +++ b/scripts/oe-pkgdata-util > @@ -45,8 +45,10 @@ def glob(args): > sys.exit(1) >=20 > skipval =3D > "-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-" > + =C2=A0=C2=A0=C2=A0postskipregex =3D None > if args.exclude: > skipval +=3D "|" + args.exclude > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0postskipregex =3D re.compile= (args.exclude) > skipregex =3D re.compile(skipval) >=20 > skippedpkgs =3D set() > @@ -137,8 +139,12 @@ def glob(args): > break >=20 > if mappedpkg: > - =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0logger.debug("%s (%s) -> %s" = % (pkg, g, mappedpkg)) > - =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0mappedpkgs.add(mappedpkg) > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if postskipregex and postskip= regex.search(mappedpkg): >=20 > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0skipp= edpkgs.add(mappedpkg) > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0logge= r.debug("%s -> !" % mappedpkg) > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0else: > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0logge= r.debug("%s (%s) -> %s" % (pkg, g, > mappedpkg)) > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0mappe= dpkgs.add(mappedpkg) > else: > logger.debug("%s (%s) -> ?" % (pkg, g)) >=20 And add package lib32-glibc-locale-en-gb to PACKAGE_EXCLUDE_COMPLEMENTARY: >=20 > PACKAGE_EXCLUDE_COMPLEMENTARY =3D "lib32-glibc-locale-.*" > PACKAGE_EXCLUDE_COMPLEMENTARY_class-nativesdk =3D "" The question is, how well this solution fits the Yocto concepts? Are there= any more graceful options? --sxcu26yGtXBk7MnvsISP Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello everyone, found you a tricky bug:)

I have a build with MULTILIBS enabled (x86_64 + x86, but aarch64 + a= rmv7 have the save issue). When building an image everything is ok. Th= en I build SDK (with -c populate_sdk) and after that build of the = image itself breaks on do_rootfs task. 

MULTIL= IBS is important, because without this feature everything is ok - same= chain (build image, than SDK, than rebuild image) works.

The pr= oblem is in lib32-glibc-locale-en-gb. When building image,= lib32-glibc-locale-en-gb doesn't appear as a dependency and is no= t built. But when building the SDK of this image, it also builds a lib3= 2-glibc-locale-en-gb package and packs it into SDK. Than rebuilding th= e image issues an error:
WARNING= : symway-image-docker-1.0-r0 do_root= fs: Unable to install packages. Command '/build-yocto/build/tmp/work/x86_64= _docker-poky-linux/symway-image-docker/1.0-r0/recipe-sysroot-native/usr/bin= /opkg --volatile-cache -f /build-yocto
/build/tmp/work/x86_64_d= ocker-poky-linux/symway-image-docker/1.0-r0/opkg.conf -t /build-yocto/build= /tmp/work/x86_64_docker-poky-linux/symway-image-docker/1.0-r0/temp/ipktemp/= -o /build-yocto/build/tmp/work/x86_64_docker-poky-linux/
symway-image= -docker/1.0-r0/rootfs  --force_postinstall --prefer-arch-to-version &n= bsp;--add-exclude lib32-glibc-locale-en-gb --force-maintainer --force-overw= rite --add-exclude lib32-glibc-locale-en-gb install avahi-locale-en-gb cups= -loc
ale-en glibc-locale-en-gb lib32-glibc-locale-en-gb lib32-libglib-= 2.0-locale-en-gb lib32-libpam-locale-en-gb lib32-shared-mime-info-locale-en= -gb libglib-2.0-locale-en-gb libpam-locale-en-gb shared-mime-info-locale-en= -gb wget-locale-
en-gb' returned 255:         = ;                     &nb= sp;                     &= nbsp;                    =                     &nbs= p;                     &n= bsp;                     =                 
Collected errors:         =                     &nbs= p;                     &n= bsp;                     =                      = ;                     &nb= sp;                     &= nbsp;                 <= br /> * opkg_prepare_url_for_install: Could= n't find anything to satisfy 'lib32-glibc-locale-en-gb'.    =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =              &nbs= p;                     &n= bsp;                     =    
WARNING
: symway-image-dock= er-1.0-r0 do_rootfs: [log_check] symway-image-docker: found 1 warning messa= ge in the logfile:
[log_check] WARNING: Unable to install packages= . Command '/build-yocto/build/tmp/work/x86_64_docker-poky-linux/symway-imag= e-docker/1.0-r0/recipe-sysroot-native/usr/bin/opkg --volatile-cache -f /bui= ld-yocto/build/tmp/work/x86_64_doc
ker-poky-linux/symway-image-= docker/1.0-r0/opkg.conf -t /build-yocto/build/tmp/work/x86_64_docker-poky-l= inux/symway-image-docker/1.0-r0/temp/ipktemp/ -o /build-yocto/build/tmp/wor= k/x86_64_docker-poky-linux/symway-image-docker/1.0-r0
/rootfs  --= force_postinstall --prefer-arch-to-version  --add-exclude lib32-glibc-= locale-en-gb --force-maintainer --force-overwrite --add-exclude lib32-glibc= -locale-en-gb install avahi-locale-en-gb cups-locale-en glibc-locale-en-gb =
lib32-glibc-locale-en-gb lib32-libglib-2.0-locale-en-gb lib32-libpam-= locale-en-gb lib32-shared-mime-info-locale-en-gb libglib-2.0-locale-en-gb l= ibpam-locale-en-gb shared-mime-info-locale-en-gb wget-locale-en-gb' returne= d 255:       =
     = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ; 
ERROR: symway-image-docker-1.0-r0 do_= rootfs: [log_check] symway-image-docker: found 1 error message in the logfi= le:
[log_check] Collected errors:

Build configuration (using dunfell 3.1)<= strong>:
BB_VERSION          =  =3D "1.46.0"
BUILD_SYS      &nb= sp;     =3D "x86_64-linux"
NATIVELSBSTRING &= nbsp;    =3D "universal"
TARGET_SYS   &= nbsp;       =3D "x86_64-poky-linux"
MACHINE            = ;  =3D "x86-64-docker"
DISTRO      = ;         =3D "symway"
D= ISTRO_VERSION       =3D "3.1"
TUNE_FEAT= URES        =3D "m64 core2"
TARGET= _FPU           =3D "" meta-oe           &nbs= p;   
meta-initramfs      &nbs= p; 
meta-multimedia       
met= a-networking       
meta-filesystems &nb= sp;    
meta-python      =     =3D "HEAD:a62ad77973b16daac1cbaa03cbda3c6b9b91f2ff"=
meta           &nb= sp;      
meta-poky    &n= bsp;        
meta-yocto-bsp &n= bsp;     =3D "HEAD:5d47cdf448b6cff5bb7cc5b0ba0426b= 8235ec478"

Looks like the problem is somewhere in poky/meta/lib/oe/pack= age_manager.py and/or poky/scripts/oe-pkgdata-util.

After building image itself there is no anything about packag= e lib32-glibc-locale-en-gb in build/tmp/pkgdata/<machi= ne_name>. But after building SDK package lib32-glibc-= locale-en-gb appears as: 
  • build/tmp/pkgdata/<machine_name>/runtime-reverse/lib32-g= libc-locale-en-gb
  • build/tmp/pkgdata/<machine_name&= gt;/runtime/lib32-glibc-locale-en-gb
  • build/tmp/pkgdata/<machine_name&= gt;/runtime/lib32-glibc-locale-en-gb.packaged
Than during rebuilding of the image build/tm= p/work/..../<image_name>/1.0-r0/oe-rootfs-repo is generated = correctly - there is no anything about lib32-glibc-locale-en-gb (<= /em>no lib32-glibc-locale-en-gb....ipk). Pa= ckageManager:install_complementary method (package_manager.py:554<= /em>) generates packages list from this directory correctly. But than o= e-pkgdata-util:glob function (oe-pkgdata-util:37) u= ses another directory (build/tmp/pkgdata/<machine_name>) for= generating globbed complementary packages list; there we have lib= 32-glibc-locale-en-gb. That's how lib32-glibc-locale-en-gb&nb= sp;appears in complementary packages list and is tried to be installed= ... and fails as there is no lib32-glibc-locale-en-gb...ipk i= n build/tmp/work/..../<image_name>/1.0-r0/oe-rootfs-repo.
My first attempt to workaround was variable PACKAGE_E= XCLUDE_COMPLEMENTARY, but it didn't work)) I tried to exclude dire= ctly package lib32-glibc-locale-en-gb from complementary pack= ages list, but function oe-pkgdata-util:glob uses the same co= rrect package list from build/tmp/work/..../<image_name>/1.0-r0/o= e-rootfs-repo for excluding and only after that analyses buil= d/tmp/pkgdata/<machine_name> directory. Finally li= b32-glibc-locale-en-gb appeared in complementary packages list by hitt= ing search through PN (see oe-pkgdata-util:glob).

= So finally my solution is to patch oe-pkgdata-util:glob so PACKAGE_EXCLUDE_COMPLEMENTARY
works correctly:
diff --git a/scripts/oe-pkgdata-util b/scripts= /oe-pkgdata-util
index 93220e3617..de60f38e1b 1= 00755
--- a/scripts/oe-pkgdata-util

+++ b/scripts/oe-pkgdata-util
@@ -45,8 +45,10 @@<= /span> def glob(args):
 &= nbsp;      sys.exit(1)
 
&nbs= p;   skipval =3D "-locale-|^locale-base-|-dev$|-doc$|-dbg$|-= staticdev$|^kernel-module-"
+  &= nbsp; postskipregex =3D None
    if args.exclude:
   = ;     skipval +=3D "|" + args.exclude
+        posts= kipregex =3D re.compile(args.exclude)
    skipregex =3D re.compile(skipval)  
    skippedpkgs =3D set()
@@ -137,8 +139,12 @@ def glob(args):
      =             &nb= sp;     break
 
   =             &nb= sp;if mappedpkg:
-    =             &nb= sp;   logger.debug("%s (%s) -> %s" % (pkg, g, mappedpkg))=
-           &nb= sp;        mappedpkgs.add(mappedpkg= )
+           &n= bsp;        if postskipregex and po= stskipregex.search(mappedpkg):
+      &nb= sp;            =      skippedpkgs.add(mappedpkg)
+  = ;            &n= bsp;         logger.debug("%s = -> !" % mappedpkg)
<= span style=3D"color: #18b218;">+        =             els= e:

+           &= nbsp;           &nbs= p;logger.debug("%s (%s) -> %s" % (pkg, g, mappedpkg))
+  = ;            &n= bsp;         mappedpkgs.add(ma= ppedpkg)
  &n= bsp;            = ; else:
         &n= bsp;          logger.debu= g("%s (%s) -> ?" % (pkg, g))

And add package lib32-glibc-locale-en-gb to P= ACKAGE_EXCLUDE_COMPLEMENTARY:

PACKAGE_EXCLUDE_COMPLEMENTARY =3D "lib32-glibc-locale-.*"
PACKAGE_EXCLUDE_COMPLEMENTARY_class-nativesdk =3D ""
The question is, how well this solution fits the Yocto concepts? Are there= any more graceful options? --sxcu26yGtXBk7MnvsISP--