Received: from mail-ob0-f175.google.com ([209.85.214.175]) by linuxtogo.org with esmtp (Exim 4.72) (envelope-from ) id 1S9kPW-0004JN-QB for bitbake-devel@lists.openembedded.org; Mon, 19 Mar 2012 22:46:39 +0100 Received: by obqv19 with SMTP id v19so1562724obq.6 for ; Mon, 19 Mar 2012 14:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type; bh=mIO0K98h8diCABDOwdFBDVy7e+SKfEif29ciTsoxI9s=; b=CZdIhedsBaWURhGuixg/0iIQqyP68hgbxB/OrcOmIz4HcACYk2vo1d0Z/o5Q82a4+e ykAJ2X26+MkS15jLOwYUvw1njTIyA9cvngfFhR7EOnak5vms4QH5Ld9mvdahe09lwdtY q6Kb24J49WqfvxDIcD5MfLpUfJXlw9JXhOSYosudAEF2Ol2G2x7dT2yVt6AQ3AxxAr3H nA/Q1N7hA4gjp/8FhkWnEpfJmkpztSdQ+eWeN7RQj7r8nhKRECBgjgmloGf9agg7G04q 30LPE7PUd1Ia842N5EtrsZtG8SfDC+ksbaS17OUVwtY4KpQMQj3Gi1IAi3m+lW1sGtgi iuwQ== Received: by 10.182.12.37 with SMTP id v5mr15331468obb.16.1332193066613; Mon, 19 Mar 2012 14:37:46 -0700 (PDT) Received: from frey.local (ip68-110-79-242.ph.ph.cox.net. [68.110.79.242]) by mx.google.com with ESMTPS id c2sm10976228oeb.13.2012.03.19.14.37.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Mar 2012 14:37:45 -0700 (PDT) Date: Mon, 19 Mar 2012 14:37:42 -0700 From: Christopher Larson To: Denys Dmytriyenko Message-ID: <9DB46E3A8C854D2595CB6F683FB6D1D0@gmail.com> In-Reply-To: <20120319203213.GC15554@denix.org> References: <4F605E85.7070904@windriver.com> <1331718176.18586.15.camel@ted> <4F61926D.1060709@windriver.com> <4F619CD4.4090103@windriver.com> <20120315080310.GC4973@jama.jama.net> <4F61B1D0.2080306@windriver.com> <20120315092122.GE4973@jama.jama.net> <20120315181844.GE30363@denix.org> <20120316064152.GA3855@jama.jama.net> <20120319203213.GC15554@denix.org> X-Mailer: sparrow 1.5 (build 1043.1) MIME-Version: 1.0 Cc: philb@gnu.org, Kang Kai , bitbake-devel@lists.openembedded.org, Martin Jansa Subject: Re: How to identify WORKDIR? X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2012 21:46:39 -0000 Content-Type: multipart/alternative; boundary="4f67a726_515f007c_aa0" --4f67a726_515f007c_aa0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline rm_old_work seems to do exactly what it sounds like. It removes *old* workdirs from previous versions of the recipe to keep it from bloating without bound if you retain the same tmpdir. -- Christopher Larson On Monday, March 19, 2012 at 1:32 PM, Denys Dmytriyenko wrote: > On Fri, Mar 16, 2012 at 07:41:52AM +0100, Martin Jansa wrote: > > On Thu, Mar 15, 2012 at 02:18:44PM -0400, Denys Dmytriyenko wrote: > > > On Thu, Mar 15, 2012 at 10:21:22AM +0100, Martin Jansa wrote: > > > > On Thu, Mar 15, 2012 at 05:09:36PM +0800, Kang Kai wrote: > > > > > On 2012???03???15??? 16:03, Martin Jansa wrote: > > > > > > On Thu, Mar 15, 2012 at 03:40:04PM +0800, Kang Kai wrote: > > > > > > > On 2012???03???15??? 14:55, Kang Kai wrote: > > > > > > > > On 2012???03???14??? 17:42, Richard Purdie wrote: > > > > > > > > > On Wed, 2012-03-14 at 17:01 +0800, Kang Kai wrote: > > > > > > > > > > Hi All, > > > > > > > > > > > > > > > > > > > > I write a script to clean up WORKDIR that remove the obsoleted > > > > > > > > > > packages' build directories. > > > > > > > > > > The script accept a argument as BUILDDIR and I use this clause to > > > > > > > > > > identify the WORKDIR: > > > > > > > > > > > > > > > > > > > > workdir = os.path.join(builddir, 'tmp/work') > > > > > > > > > > > > > > > > > > > > Then validate the workdir exists or not. It works for me but hardcode > > > > > > > > > > here as Richard point out. > > > > > > > > > > So is there a better way to get the WORKDIR here? Thanks. > > > > > > > > > > > > > > > > > > > > > > > > > > > > I was thinking of something like: > > > > > > > > > > > > > > > > > > bitbake -e | grep ^WORKDIR > > > > > > > And the result is something like that: > > > > > > > WORKDIR="/mnt/sda10/poky-all-platform/build-qemux86_64/tmp/work/x86_64-poky-linux/bblayers-1.0-r0" > > > > > > > > > > > > > > Is it ok to remove 2 items seperated by slash at the end of string? > > > > > > > Right now is: > > > > > > > "/mnt/sda10/poky-all-platform/build-qemux86_64/tmp/work/" > > > > > > > > > > > > > > > > > > > Aren't you looking for ^TMPDIR ? > > > > > > > > > > > > > > > > > > > > > If use WORKDIR = TMPDIR/"work", it is still hard coding. > > > > > > > > Assuming 2 items at the end won't work for people using rm_old_work: > > > > http://git.openembedded.org/meta-micro/commit/?id=fcf525654915edb9650f1a6c2852f336366f8b2f > > > > or slightly different version: > > > > http://git.shr-project.org/git/?p=meta-smartphone.git;a=blob;f=meta-shr/classes/rm_old_work.bbclass > > > > > > > > > > > > > Martin, > > > > > > Can you please point me to more details about this class - any background or > > > discussions... Thanks. > > > > > > > > > Hi, > > > > Well it works better then rm_work with sstate and the original class is > > from meta-micro (so maybe ask pb if you want more details, but the class > > is quite simple). I've just replaced last directory name because of this > > issue: > > > > http://git.shr-project.org/git/?p=meta-smartphone.git;a=commit;h=0d4c17de1ba7343d82bb10c311754e29d573c485 > > Martin, > > Hmm, my understanding those are slightly different classes - rm_work cleans > WORKDIR after the build to save space, while this rm_old_work seems to clean > up before the build. I tried searching for any previous discussions of this > class or any other rationale, but even the commit itself doesn't provide much > explanation for it... > > Phil, > > Do you mind giving a short description of this peculiar rm_old_work class? :) > Thanks. > > -- > Denys > > > > > > And I think more people have different "tmp/" part e.g. default would be > > > > "tmp-eglibc/" (thanks to TCLIBCAPPEND > > > > meta/conf/distro/defaultsetup.conf:TMPDIR .= "${TCLIBCAPPEND}"), but "work" is > > > > quite common. > > > > > > > > meta/conf/bitbake.conf: > > > > WORKDIR = "${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PF}" > > > > meta-shr/classes/rm_old_work.bbclass: > > > > WORKDIR = "${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${PF}" > > > > meta-micro/classes/rm_old_work.bbclass: > > > > WORKDIR = "${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}" > > > > > > > > Cheers, > > > > > > > > > > > > > > > > Regards, > > > > > > > Kai > > > > > > > > > > > > > > > If get WORKDIR in this way, I'll update the script with no argument > > > > > > > > because the argument is useless to identify the WORKDIR. > > > > > > > > > > > > > > > > Regards, > > > > > > > > Kai > > > > > > > > > since you already call into bitbake in the script in question. > > > > > > > > > > > > > > > > > > Cheers, > > > > > > > > > > > > > > > > > > Richard > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > bitbake-devel mailing list > > > > > > > > bitbake-devel@lists.openembedded.org (mailto:bitbake-devel@lists.openembedded.org) > > > > > > > > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > bitbake-devel mailing list > > > > > > > bitbake-devel@lists.openembedded.org (mailto:bitbake-devel@lists.openembedded.org) > > > > > > > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com (mailto:Martin.Jansa@gmail.com) > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > bitbake-devel mailing list > > > > bitbake-devel@lists.openembedded.org (mailto:bitbake-devel@lists.openembedded.org) > > > > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel > > > > > > > > > > > > > > > > -- > > Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com (mailto:Martin.Jansa@gmail.com) > > > > > > > _______________________________________________ > bitbake-devel mailing list > bitbake-devel@lists.openembedded.org (mailto:bitbake-devel@lists.openembedded.org) > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel > > --4f67a726_515f007c_aa0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
rm=5Fold=5Fwork seems to do exactly what it sounds like. It removes *= old* workdirs from previous versions of the recipe to keep it from bloati= ng without bound if you retain the same tmpdir.

-- 
Christopher L= arson

=20

On Monday, March 19, 2= 012 at 1:32 PM, Denys Dmytriyenko wrote:

On =46ri, Mar 16, 2012 at 07:41:= 52AM +0100, Martin Jansa wrote:
<= div>On Thu, Mar 15, 2012 at 02:18:44PM -0400, Denys Dmytriyenko wrote:
On Thu, Mar 15, 2012 at 10:21:= 22AM +0100, Martin Jansa wrote:
<= div>On Thu, Mar 15, 2012 at 05:09:36PM +0800, Kang Kai wrote:
On 2012=3F=3F=3F03=3F=3F=3F15=3F=3F=3F = 16:03, Martin Jansa wrote:
O= n Thu, Mar 15, 2012 at 03:40:04PM +0800, Kang Kai wrote:
On 2012=3F=3F=3F03=3F=3F=3F15=3F=3F=3F 14:55= , Kang Kai wrote:
On 2012=3F= =3F=3F03=3F=3F=3F14=3F=3F=3F 17:42, Richard Purdie wrote:
On Wed, 2012-03-14 at 17:01 +0800, Kang Kai= wrote:
Hi All,
I write a script to clean up WORKDIR that remove the obsolet= ed
packages' build directories.
The script accept a a= rgument as BUILDDIR and I use this clause to
identify the WORKD= IR:

workdir =3D os.path.join(builddir, 't= mp/work')

Then validate the workdir exists or no= t. It works for me but hardcode
here as Richard point out.
So is there a better way to get the WORKDIR here=3F Thanks.
<= /div>
I was thinking of something like:

bitbake -e =7C grep =5EWORKDIR
And the result is something like that:
WORKDIR=3D= =22/mnt/sda10/poky-all-platform/build-qemux86=5F64/tmp/work/x86=5F64-poky= -linux/bblayers-1.0-r0=22

Is it ok to remove 2 i= tems seperated by slash at the end of string=3F
Right now is:
=22/mnt/sda10/poky-all-platform/build-qemux86=5F64/tmp/work/=22<= /div>
Aren't you looking for =5ETMPDIR =3F

If use WORKDIR =3D TMPDIR/=22work=22= , it is still hard coding.


Martin,

<= div>Can you please point me to more details about this class - any backgr= ound or
discussions... Thanks.
Hi,

Well it works better then rm=5F= work with sstate and the original class is
from meta-micro (so = maybe ask pb if you want more details, but the class
is quite s= imple). I've just replaced last directory name because of this
= issue:

<= /blockquote>

Martin,

Hmm, my = understanding those are slightly different classes - rm=5Fwork cleans
WORKDIR after the build to save space, while this rm=5Fold=5Fwork= seems to clean
up before the build. I tried searching for any= previous discussions of this
class or any other rationale, bu= t even the commit itself doesn't provide much
explanation for = it...

Phil,

Do you mind= giving a short description of this peculiar rm=5Fold=5Fwork class=3F :) =
Thanks.

--
Denys


And I thin= k more people have different =22tmp/=22 part e.g. default would be
<= div>=22tmp-eglibc/=22 (thanks to TCLIBCAPPEND
meta/conf/distro/= defaultsetup.conf:TMPDIR .=3D =22=24=7BTCLIBCAPPEND=7D=22), but =22work=22= is
quite common.

meta/conf/bitbake.c= onf:
WORKDIR =3D =22=24=7BTMPDIR=7D/work/=24=7BMULTIMACH=5FTARG= ET=5FSYS=7D/=24=7BP=46=7D=22
meta-shr/classes/rm=5Fold=5Fwork.b= bclass:
WORKDIR =3D =22=24=7BTMPDIR=7D/work/=24=7BMULTIMACH=5FT= ARGET=5FSYS=7D/=24=7BPN=7D/=24=7BP=46=7D=22
meta-micro/classes/= rm=5Fold=5Fwork.bbclass:
WORKDIR =3D =22=24=7BTMPDIR=7D/work/=24= =7BMULTIMACH=5FTARGET=5FSYS=7D/=24=7BPN=7D/=24=7BEXTENDPE=7D=24=7BPV=7D-=24= =7BPR=7D=22

Cheers,


<= blockquote type=3D=22cite=22>
Regards,
Kai
<= br>
If get WORKDIR in this w= ay, I'll update the script with no argument
because the argumen= t is useless to identify the WORKDIR.

Regards,
Kai
since you alrea= dy call into bitbake in the script in question.

= Cheers,

Richard
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F
bitbake-devel mailing list

=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
bitbake-devel mailing list
=
--
Martin 'JaMa' Jansa jabber: Martin.Jansa=40gmail.com



=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F
bitbake-devel mailing list

--
Martin 'JaMa' Jansa jabb= er: Martin.Jansa=40gmail.= com



=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
bitbake-devel mailing list
=20 =20 =20 =20 =20

--4f67a726_515f007c_aa0--