All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] oe-buildenv-internal: Fix finding build directory
@ 2017-10-21 12:06 Richard Purdie
  2017-10-22 13:09 ` Otavio Salvador
  2017-10-31 23:16 ` Burton, Ross
  0 siblings, 2 replies; 7+ messages in thread
From: Richard Purdie @ 2017-10-21 12:06 UTC (permalink / raw)
  To: openembedded-core

The intent of the env setup scripts is to set BBPATH to point at the
build directory if not already set. This means if the user changes
directory, bitbake can still find the original build directory. The
default bblayers.conf files reset BBPATH to the correct components so
this is safe and restores the behaviour the script was intended to have.

[YOCTO #12163]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/oe-buildenv-internal | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index e6cd141..abc5aff 100755
--- a/scripts/oe-buildenv-internal
+++ b/scripts/oe-buildenv-internal
@@ -105,6 +105,11 @@ fi
 
 BITBAKEDIR=$(readlink -f "$BITBAKEDIR")
 BUILDDIR=$(readlink -f "$BUILDDIR")
+if [ -z "$BBPATH" ]; then
+    BBPATH=$BUILDDIR
+fi
+
+export BBPATH
 
 if [ ! -d "$BITBAKEDIR" ]; then
     echo >&2 "Error: The bitbake directory ($BITBAKEDIR) does not exist!  Please ensure a copy of bitbake exists at this location or specify an alternative path on the command line"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] oe-buildenv-internal: Fix finding build directory
  2017-10-21 12:06 [PATCH] oe-buildenv-internal: Fix finding build directory Richard Purdie
@ 2017-10-22 13:09 ` Otavio Salvador
  2017-10-31 23:16 ` Burton, Ross
  1 sibling, 0 replies; 7+ messages in thread
From: Otavio Salvador @ 2017-10-22 13:09 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

On Sat, Oct 21, 2017 at 10:06 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> The intent of the env setup scripts is to set BBPATH to point at the
> build directory if not already set. This means if the user changes
> directory, bitbake can still find the original build directory. The
> default bblayers.conf files reset BBPATH to the correct components so
> this is safe and restores the behaviour the script was intended to have.
>
> [YOCTO #12163]
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

A warning letting user know that it not going to be run would be good,
also printing the current value

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] oe-buildenv-internal: Fix finding build directory
  2017-10-21 12:06 [PATCH] oe-buildenv-internal: Fix finding build directory Richard Purdie
  2017-10-22 13:09 ` Otavio Salvador
@ 2017-10-31 23:16 ` Burton, Ross
  2017-10-31 23:25   ` Otavio Salvador
  1 sibling, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2017-10-31 23:16 UTC (permalink / raw)
  To: Richard Purdie; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

On 21 October 2017 at 13:06, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> The intent of the env setup scripts is to set BBPATH to point at the
> build directory if not already set. This means if the user changes
> directory, bitbake can still find the original build directory. The
> default bblayers.conf files reset BBPATH to the correct components so
> this is safe and restores the behaviour the script was intended to have.
>
> [YOCTO #12163]
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  scripts/oe-buildenv-internal | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
> index e6cd141..abc5aff 100755
> --- a/scripts/oe-buildenv-internal
> +++ b/scripts/oe-buildenv-internal
> @@ -105,6 +105,11 @@ fi
>
>  BITBAKEDIR=$(readlink -f "$BITBAKEDIR")
>  BUILDDIR=$(readlink -f "$BUILDDIR")
> +if [ -z "$BBPATH" ]; then
> +    BBPATH=$BUILDDIR
> +fi
> +
> +export BBPATH
>

This breaks the use-case of the user switching between build directories as
re-executing oe-init-build-env doesn't change BBPATH.

Ross

[-- Attachment #2: Type: text/html, Size: 1669 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] oe-buildenv-internal: Fix finding build directory
  2017-10-31 23:16 ` Burton, Ross
@ 2017-10-31 23:25   ` Otavio Salvador
  2017-11-01 22:04     ` Richard Purdie
  0 siblings, 1 reply; 7+ messages in thread
From: Otavio Salvador @ 2017-10-31 23:25 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Tue, Oct 31, 2017 at 9:16 PM, Burton, Ross <ross.burton@intel.com> wrote:
> On 21 October 2017 at 13:06, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
>>
>> The intent of the env setup scripts is to set BBPATH to point at the
>> build directory if not already set. This means if the user changes
>> directory, bitbake can still find the original build directory. The
>> default bblayers.conf files reset BBPATH to the correct components so
>> this is safe and restores the behaviour the script was intended to have.
>>
>> [YOCTO #12163]
>>
>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>> ---
>>  scripts/oe-buildenv-internal | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
>> index e6cd141..abc5aff 100755
>> --- a/scripts/oe-buildenv-internal
>> +++ b/scripts/oe-buildenv-internal
>> @@ -105,6 +105,11 @@ fi
>>
>>  BITBAKEDIR=$(readlink -f "$BITBAKEDIR")
>>  BUILDDIR=$(readlink -f "$BUILDDIR")
>> +if [ -z "$BBPATH" ]; then
>> +    BBPATH=$BUILDDIR
>> +fi
>> +
>> +export BBPATH
>
>
> This breaks the use-case of the user switching between build directories as
> re-executing oe-init-build-env doesn't change BBPATH.

I know and that's why I asked for a warning! ;-)

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] oe-buildenv-internal: Fix finding build directory
  2017-10-31 23:25   ` Otavio Salvador
@ 2017-11-01 22:04     ` Richard Purdie
  2017-11-02  0:51       ` Burton, Ross
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2017-11-01 22:04 UTC (permalink / raw)
  To: Otavio Salvador, Burton, Ross, Chris Larson; +Cc: OE-core

On Tue, 2017-10-31 at 21:25 -0200, Otavio Salvador wrote:
> On Tue, Oct 31, 2017 at 9:16 PM, Burton, Ross <ross.burton@intel.com>
> wrote:
> > 
> > On 21 October 2017 at 13:06, Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > > 
> > > diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-
> > > internal
> > > index e6cd141..abc5aff 100755
> > > --- a/scripts/oe-buildenv-internal
> > > +++ b/scripts/oe-buildenv-internal
> > > @@ -105,6 +105,11 @@ fi
> > > 
> > >  BITBAKEDIR=$(readlink -f "$BITBAKEDIR")
> > >  BUILDDIR=$(readlink -f "$BUILDDIR")
> > > +if [ -z "$BBPATH" ]; then
> > > +    BBPATH=$BUILDDIR
> > > +fi
> > > +
> > > +export BBPATH
> > 
> > This breaks the use-case of the user switching between build
> > directories as
> > re-executing oe-init-build-env doesn't change BBPATH.
> I know and that's why I asked for a warning! ;-)

My patch as it stands clearly can't go in.

Our options are:

a) make that codepath unconditional (which may be no bad thing) and 
   use BBPATH
b) use a specific variable for bitbake, the script sets BUILDDIR
c) start allowing the external code to set TOPDIR directly

I think I'm leaning towards a) or possibly c). I don't really like b).
I tried c) locally and its behaving oddly. a) is known to work.

Chris, any thoughts on the original intentions or what we should do
here?

Cheers,

Richard


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] oe-buildenv-internal: Fix finding build directory
  2017-11-01 22:04     ` Richard Purdie
@ 2017-11-02  0:51       ` Burton, Ross
  2017-11-02 11:28         ` Otavio Salvador
  0 siblings, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2017-11-02  0:51 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Otavio Salvador, OE-core

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]

On 1 November 2017 at 22:04, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Tue, 2017-10-31 at 21:25 -0200, Otavio Salvador wrote:
> > On Tue, Oct 31, 2017 at 9:16 PM, Burton, Ross <ross.burton@intel.com>
> > wrote:
> > >
> > > On 21 October 2017 at 13:06, Richard Purdie
> > > <richard.purdie@linuxfoundation.org> wrote:
> > > >
> > > > diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-
> > > > internal
> > > > index e6cd141..abc5aff 100755
> > > > --- a/scripts/oe-buildenv-internal
> > > > +++ b/scripts/oe-buildenv-internal
> > > > @@ -105,6 +105,11 @@ fi
> > > >
> > > >  BITBAKEDIR=$(readlink -f "$BITBAKEDIR")
> > > >  BUILDDIR=$(readlink -f "$BUILDDIR")
> > > > +if [ -z "$BBPATH" ]; then
> > > > +    BBPATH=$BUILDDIR
> > > > +fi
> > > > +
> > > > +export BBPATH
> > >
> > > This breaks the use-case of the user switching between build
> > > directories as
> > > re-executing oe-init-build-env doesn't change BBPATH.
> > I know and that's why I asked for a warning! ;-)
>
> My patch as it stands clearly can't go in.
>
> Our options are:
>
> a) make that codepath unconditional (which may be no bad thing) and
>    use BBPATH
> b) use a specific variable for bitbake, the script sets BUILDDIR
> c) start allowing the external code to set TOPDIR directly
>
> I think I'm leaning towards a) or possibly c). I don't really like b).
> I tried c) locally and its behaving oddly. a) is known to work.
>

(a) seems like the right fix here.  At least, that's what I expected to
happen...

Ross

[-- Attachment #2: Type: text/html, Size: 2409 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] oe-buildenv-internal: Fix finding build directory
  2017-11-02  0:51       ` Burton, Ross
@ 2017-11-02 11:28         ` Otavio Salvador
  0 siblings, 0 replies; 7+ messages in thread
From: Otavio Salvador @ 2017-11-02 11:28 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Wed, Nov 1, 2017 at 10:51 PM, Burton, Ross <ross.burton@intel.com> wrote:
> On 1 November 2017 at 22:04, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
>>
>> On Tue, 2017-10-31 at 21:25 -0200, Otavio Salvador wrote:
>> > On Tue, Oct 31, 2017 at 9:16 PM, Burton, Ross <ross.burton@intel.com>
>> > wrote:
>> > >
>> > > On 21 October 2017 at 13:06, Richard Purdie
>> > > <richard.purdie@linuxfoundation.org> wrote:
>> > > >
>> > > > diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-
>> > > > internal
>> > > > index e6cd141..abc5aff 100755
>> > > > --- a/scripts/oe-buildenv-internal
>> > > > +++ b/scripts/oe-buildenv-internal
>> > > > @@ -105,6 +105,11 @@ fi
>> > > >
>> > > >  BITBAKEDIR=$(readlink -f "$BITBAKEDIR")
>> > > >  BUILDDIR=$(readlink -f "$BUILDDIR")
>> > > > +if [ -z "$BBPATH" ]; then
>> > > > +    BBPATH=$BUILDDIR
>> > > > +fi
>> > > > +
>> > > > +export BBPATH
>> > >
>> > > This breaks the use-case of the user switching between build
>> > > directories as
>> > > re-executing oe-init-build-env doesn't change BBPATH.
>> > I know and that's why I asked for a warning! ;-)
>>
>> My patch as it stands clearly can't go in.
>>
>> Our options are:
>>
>> a) make that codepath unconditional (which may be no bad thing) and
>>    use BBPATH
>> b) use a specific variable for bitbake, the script sets BUILDDIR
>> c) start allowing the external code to set TOPDIR directly
>>
>> I think I'm leaning towards a) or possibly c). I don't really like b).
>> I tried c) locally and its behaving oddly. a) is known to work.
>
>
> (a) seems like the right fix here.  At least, that's what I expected to
> happen...

+1


-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-02 11:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-21 12:06 [PATCH] oe-buildenv-internal: Fix finding build directory Richard Purdie
2017-10-22 13:09 ` Otavio Salvador
2017-10-31 23:16 ` Burton, Ross
2017-10-31 23:25   ` Otavio Salvador
2017-11-01 22:04     ` Richard Purdie
2017-11-02  0:51       ` Burton, Ross
2017-11-02 11:28         ` Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.