[OE-core] [PATCH 1/6] scripts/bitbake: ensure user is in build directory
Andreas Oberritter
obi at opendreambox.org
Fri Mar 16 00:20:44 UTC 2012
On 16.03.2012 00:09, Paul Eggleton wrote:
> On Thursday 15 March 2012 01:30:31 Andreas Oberritter wrote:
>> On 14.03.2012 01:36, Paul Eggleton wrote:
>>> If the user is in any directory other than $BUILDDIR when the bitbake
>>> wrapper script is run, then show an error an exit.
>>
>> this patch broke my setup.
>
> Ah, sorry about that.
>
>> My $BUILDDIR points to tmp, so that pseudo doesn't get rebuilt for every
>> machine. I have a shared tmp for many machines.
>
> So a couple of things:
>
> 1) Unless I'm missing something you can share the same TMPDIR between multiple
> build directories to get the same result.
>
> 2) pseudo is a native package. It shouldn't be rebuilt when changing MACHINE.
> In fact I just verified by creating a different build directory with only
> MACHINE changed in the config, it is not rebuilt.
Sorry, I messed up some details. In fact, pseudo-native doesn't get
rebuilt, but bitbake pseudo-native still gets executed for every
machine, unless $BUILDDIR/pseudodone is present and contains
PSEUDOBINDIR. This just wastes time and confuses users who receive a
message saying "Pseudo is not present but is required, building this
first before the main build".
>> BUILDDIR doesn't seem to have any other use than pointing to the
>> 'pseudodone' file. I don't understand why it's required to run bitbake
>> from there.
>
> Well, it's required that bitbake is run from the build directory and when you
> use the setup script as intended that's where BUILDDIR points to. I hadn't
> anticipated that anyone would be changing BUILDDIR to point to anything other
> than the build dir, however I don't really think it's a good idea to support
> that.
That's because BUILDDIR has no meaning outside oe-core's setup scripts.
In scripts/bitbake, BUILDDIR would better be called PSEUDODONEDIR or
similar, because that's what the variable really means in this context
[1]. If I had a choice to override a more suitably named variable I
certainly would do that. ;-)
In order to verify that scripts/bitbake is called from the build
directory, you could as well just check whether $PWD/conf/local.conf exists.
I'm not using oe-core's scripts, because they make assumptions about the
directory layout that don't fit my project's needs. I think they are
overly complex and they display texts that seem to suit yocto's needs
but at least not mine.
Regards,
Andreas
[1]
$ grep BUILDDIR scripts/bitbake
if [ $needpseudo = "1" ] && [ -e "$BUILDDIR/pseudodone" ]; then
PSEUDOBINDIR=`cat $BUILDDIR/pseudodone`
echo $PSEUDOBINDIR > $BUILDDIR/pseudodone
PSEUDOBINDIR=`cat $BUILDDIR/pseudodone`
More information about the Openembedded-core
mailing list