Bug 4795 - PSEUDO_LOCALSTATEDIR _sometimes_ points to WORKDIR with wrong TARGET_OS
Summary: PSEUDO_LOCALSTATEDIR _sometimes_ points to WORKDIR with wrong TARGET_OS
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.5
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-07-01 17:31 UTC by Martin Jansa
Modified: 2013-09-07 08:48 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jansa 2013-07-01 17:31:31 UTC
allarch recipes leave behind pseudo directory even with rm_work
It's not bug in rm_work.bbclass but PSEUDO_LOCALSTATEDIR points to wrong WORKDIR (sometimes), but when I tried to reproduce it I failed:

bitbake.conf:
PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"

allarch.bbclass:
        # Set these to a common set of values, we shouldn't be using them other that for WORKDIR directory
        # naming anyway
        d.setVar("TARGET_ARCH", "allarch")
        d.setVar("TARGET_OS", "linux")

$ grep ^WORKDIR= packagegroup-core-ssh-dropbear.env
WORKDIR="/OE/oe-core/tmp-eglibc/work/all-oe-linux/packagegroup-core-ssh-dropbear/1.0-r1"

$ grep ^PSEUDO_LOCALSTATEDIR= packagegroup-core-ssh-dropbear.env
PSEUDO_LOCALSTATEDIR="/OE/oe-core/tmp-eglibc/work/all-oe-linux/packagegroup-core-ssh-dropbear/1.0-r1/pseudo/"

I was assuming that it happens only when setscene tasks are executed, but it doesn't look like it too:
$ bitbake -c cleansstate packagegroup-core-ssh-dropbear
$ rm -rf BUILD/work/*/packagegroup-core-ssh-dropbear
$ bitbake -c build packagegroup-core-ssh-dropbear
$ bitbake -c clean packagegroup-core-ssh-dropbear
$ bitbake -c build packagegroup-core-ssh-dropbear

$ ls tmp-eglibc/work/*/packagegroup-core-ssh-dropbear -d
tmp-eglibc/work/all-oe-linux/packagegroup-core-ssh-dropbear

And still when I build whole image, few pseudo directories are left in
tmp-eglibc/work/all-oe-linux-gnueabi/<recipe>/pseudo
and all other files of the same recipe are correctly in
tmp-eglibc/work/all-oe-linux-gnueabi/<recipe>/pseudo

Is anyone else seeing this?
Comment 1 Saul Wold 2013-09-03 23:36:29 UTC
Is there contents in those pseudo directories, when this issue occurs, if in 
which variation of TARGET_OS.  Which Machine was this a build for?
Comment 2 Saul Wold 2013-09-05 06:49:25 UTC
Ok, this is getting interesting!  I can reproduce this consistently now with a 
clean build.  I am using oe-core not poky, and qemuarm to get the gnueabi set 
in the ABIEXTENSION.

The all-oe-linux-gnueabi is showing up in more places than just the 
PSEUDO_LOCALSTATEDIR, it shows up in the PKGTRIPLETS which causes them to apear 
in the SHLIBDIRS and PKLGMLTRIPLETS, I think this is because of when these 
variables are finalized compared with when the recipe is read and allarch is 
inherited, since allarch is recipe specific. and these others are
more global.
Comment 3 Richard Purdie 2013-09-05 14:06:12 UTC
Just to clarify this bug, if you take oecore, or poky, and do "MACHINE=qemuarm bitbake update-rc.d" you will see two all* directories in workdir and the pseudo metadata ends up in the wrong place.
Comment 4 Richard Purdie 2013-09-05 14:16:10 UTC
and the problem is from devshell.bbclass which is playing with the pseudo environment :/
Comment 5 Richard Purdie 2013-09-05 14:17:19 UTC
from bitbake -e

# $PSEUDO_LOCALSTATEDIR [2 operations]
#   set? conf/bitbake.conf:606
#     "${WORKDIR}/pseudo/"
#   set __anon_27__media_build1_poky_meta_classes_devshell_bbclass:7 [__anon_27__media_build1_poky_meta_classes_devshell_bbclass]
#     "/media/build1/poky/build/tmp/work/all-poky-linux-gnueabi/update-rc.d/0.7-r5/pseudo/"
# computed:
#   "/media/build1/poky/build/tmp/work/all-poky-linux-gnueabi/update-rc.d/0.7-r5/pseudo/"
PSEUDO_LOCALSTATEDIR="/media/build1/poky/build/tmp/work/all-poky-linux-gnueabi/update-rc.d/0.7-r5/pseudo/"
Comment 6 Richard Purdie 2013-09-05 15:17:44 UTC
Patch out for review fixing this.