All of lore.kernel.org
 help / color / mirror / Atom feed
* overriding tasks with EXPORT_FUNCTIONS
@ 2014-07-13 14:19 Robert P. J. Day
  2014-07-14  9:24 ` Paul Eggleton
  0 siblings, 1 reply; 13+ messages in thread
From: Robert P. J. Day @ 2014-07-13 14:19 UTC (permalink / raw)
  To: OpenEmbedded Development mailing list


  followup to last post -- all of the methods for "overriding" task
definitions in the last post can be used without predeclaring that
you're about to do that; you just go ahead and do it in either a class
file or a recipe file. on the other hand, EXPORT_FUNCTIONS allows you
to retain the base definition of a task (or non-task function, as i
read it), then define a more general enhanced version.

  (side note: i don't see a single mention of "EXPORT_FUNCTIONS" in
any of the numerous yocto docs -- i think this feature needs some
explanation *somewhere*. :-)

  first question -- as long as you're using any of the techniques
described in my last post, there is no need for EXPORT_FUNCTIONS,
correct? this feature is only necessary if you want to redefine a task
in terms of the underlying task definition that doesn't fall into one
of those earlier categories.

  i notice that base.bbclass does use this thusly:

EXPORT_FUNCTIONS do_fetch do_unpack do_configure do_compile do_install do_package

which now means that inheriting classes have access to the functions

 * base_do_fetch
 * base_do_unpack

and so on. and now, the questions.

  first, i can see that you can redefine a basic task in terms of the
underlying base task, as in eglibc_2.19.bb:

  do_compile () {
        # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
        unset LDFLAGS
        base_do_compile
        ... snip ...

at this point, you now have a new, overriding definition for the
"compile" task for this recipe, although that's the only recipe file
example for that i found in all of oe-core, so obviously it's not used
all that often. oh, and the fact that you've defined "do_compile"
above means that you've redefined the underlying name, so that any
other recipe that includes this one also picks up that new definition
for the compile task, yes?

  on the other hand, a second way to use this can be seen in
cmake.bbclass:

    cmake_do_compile()  {
        cd ${B}
        base_do_compile
    }

but this form does *not* override the base definition, it simply
defines a second, alternative form of compiling that inheriting
classes or recipes can invoke explicitly if they wish.

  here's an example from autotools.bbclass:

autotools_do_install() {
        oe_runmake 'DESTDIR=${D}' install
        # Info dir listing isn't interesting at this point so remove it if it exists.
        if [ -e "${D}${infodir}/dir" ]; then
                rm -f ${D}${infodir}/dir
        fi
}
... snip ...
EXPORT_FUNCTIONS do_configure do_install

  (i note that the cmake routine turns around and invokes
base_do_compile, while the autotools routine does not -- it simply
redefines the entire routine. both forms perfectly acceptable.)

  so as long as i understand this correctly, the above defines a new
task/function, autotools_do_install(), that inheriting classes *may*
invoke if they wish, but the base form (base_do_install) is also still
available and is, in fact, still the default install task.

  and here's the tail end of cmake.bbclass that shows this in action:

cmake_do_compile()  {
        cd ${B}
        base_do_compile
}

cmake_do_install() {
        cd ${B}
        autotools_do_install
}

EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file

  so, to sum up, the first form of taking advantage of
EXPORT_FUNCTIONS is the way eglibc does it as above:


  do_compile () {
        unset LDFLAGS
        base_do_compile
        ... snip ...

which overrides the underlying do_compile task with this new one, so
that *everyone* from here on who includes this recipe will pick up
this redefined compile task. and in a case like this, there is no need
to use EXPORT_FUNCTIONS further.

  the second form is to define additional, alternative forms of some
tasks, as is done in cmake.bbclass:

cmake_do_compile()  {
        cd ${B}
        base_do_compile
}

cmake_do_install() {
        cd ${B}
        autotools_do_install
}

EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file

  and in this case, the underlying "base_do*" tasks definitions are
still available and are the default behaviours, but you can now
*explicitly* call these alternatives if you so choose, and you would
need to use EXPORT_FUNCTIONS on them.

  am i missing anything?

rday

p.s. oh, terminology. there is no need for anything to be a "task" for
the above; these really are all just functions being exported for use,
it just so happens that some of them represent underlying tasks, but
that's not necessary.

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================


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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-13 14:19 overriding tasks with EXPORT_FUNCTIONS Robert P. J. Day
@ 2014-07-14  9:24 ` Paul Eggleton
  2014-07-14 10:18   ` Robert P. J. Day
  2014-07-14 12:20   ` Robert P. J. Day
  0 siblings, 2 replies; 13+ messages in thread
From: Paul Eggleton @ 2014-07-14  9:24 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: openembedded-devel

Hi Robert,

On Sunday 13 July 2014 10:19:08 Robert P. J. Day wrote:
>   followup to last post -- all of the methods for "overriding" task
> definitions in the last post can be used without predeclaring that
> you're about to do that; you just go ahead and do it in either a class
> file or a recipe file. on the other hand, EXPORT_FUNCTIONS allows you
> to retain the base definition of a task (or non-task function, as i
> read it), then define a more general enhanced version.
> 
>   (side note: i don't see a single mention of "EXPORT_FUNCTIONS" in
> any of the numerous yocto docs -- i think this feature needs some
> explanation *somewhere*. :-)

Did you try the new BitBake manual?

http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#flexible-inheritance-for-class-functions

Let me know if that doesn't answer your questions.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-14  9:24 ` Paul Eggleton
@ 2014-07-14 10:18   ` Robert P. J. Day
  2014-07-14 10:22     ` Paul Eggleton
  2014-07-14 12:20   ` Robert P. J. Day
  1 sibling, 1 reply; 13+ messages in thread
From: Robert P. J. Day @ 2014-07-14 10:18 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-devel

On Mon, 14 Jul 2014, Paul Eggleton wrote:

> Hi Robert,
>
> On Sunday 13 July 2014 10:19:08 Robert P. J. Day wrote:
> >   followup to last post -- all of the methods for "overriding" task
> > definitions in the last post can be used without predeclaring that
> > you're about to do that; you just go ahead and do it in either a class
> > file or a recipe file. on the other hand, EXPORT_FUNCTIONS allows you
> > to retain the base definition of a task (or non-task function, as i
> > read it), then define a more general enhanced version.
> >
> >   (side note: i don't see a single mention of "EXPORT_FUNCTIONS" in
> > any of the numerous yocto docs -- i think this feature needs some
> > explanation *somewhere*. :-)
>
> Did you try the new BitBake manual?
>
> http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#flexible-inheritance-for-class-functions
>
> Let me know if that doesn't answer your questions.

  actually, i worded the above *really* badly. i see it in the bitbake
user manual, i was referring to the "yocto-docs" layer, which contains
all of the yocto docs but not the bitbake manual, which might mislead
some people into not knowing that the bitbake user manual is even
there.

  i know bitbake is outside the scope of what belongs in the
yocto-docs layer, but perhaps there should be at least a pointer to it
in the yocto-docs README file?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================


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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-14 10:18   ` Robert P. J. Day
@ 2014-07-14 10:22     ` Paul Eggleton
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Eggleton @ 2014-07-14 10:22 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: openembedded-devel

On Monday 14 July 2014 06:18:58 Robert P. J. Day wrote:
> On Mon, 14 Jul 2014, Paul Eggleton wrote:
> > Hi Robert,
> > 
> > On Sunday 13 July 2014 10:19:08 Robert P. J. Day wrote:
> > >   followup to last post -- all of the methods for "overriding" task
> > > 
> > > definitions in the last post can be used without predeclaring that
> > > you're about to do that; you just go ahead and do it in either a class
> > > file or a recipe file. on the other hand, EXPORT_FUNCTIONS allows you
> > > to retain the base definition of a task (or non-task function, as i
> > > read it), then define a more general enhanced version.
> > > 
> > >   (side note: i don't see a single mention of "EXPORT_FUNCTIONS" in
> > > 
> > > any of the numerous yocto docs -- i think this feature needs some
> > > explanation *somewhere*. :-)
> > 
> > Did you try the new BitBake manual?
> > 
> > http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-> > manual.html#flexible-inheritance-for-class-functions
> > 
> > Let me know if that doesn't answer your questions.
> 
>   actually, i worded the above *really* badly. i see it in the bitbake
> user manual, i was referring to the "yocto-docs" layer, which contains
> all of the yocto docs but not the bitbake manual, which might mislead
> some people into not knowing that the bitbake user manual is even
> there.
> 
>   i know bitbake is outside the scope of what belongs in the
> yocto-docs layer, but perhaps there should be at least a pointer to it
> in the yocto-docs README file?

Yes I think that would be a good idea. In fact the BitBake manual being up-to-
date is a relatively new thing so we're probably missing pointers / links to 
it in a number of places.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-14  9:24 ` Paul Eggleton
  2014-07-14 10:18   ` Robert P. J. Day
@ 2014-07-14 12:20   ` Robert P. J. Day
  2014-07-14 12:26     ` Paul Eggleton
  2014-07-14 12:30     ` Burton, Ross
  1 sibling, 2 replies; 13+ messages in thread
From: Robert P. J. Day @ 2014-07-14 12:20 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-devel

On Mon, 14 Jul 2014, Paul Eggleton wrote:

> Hi Robert,
>
> On Sunday 13 July 2014 10:19:08 Robert P. J. Day wrote:
> >   followup to last post -- all of the methods for "overriding" task
> > definitions in the last post can be used without predeclaring that
> > you're about to do that; you just go ahead and do it in either a class
> > file or a recipe file. on the other hand, EXPORT_FUNCTIONS allows you
> > to retain the base definition of a task (or non-task function, as i
> > read it), then define a more general enhanced version.
> >
> >   (side note: i don't see a single mention of "EXPORT_FUNCTIONS" in
> > any of the numerous yocto docs -- i think this feature needs some
> > explanation *somewhere*. :-)
>
> Did you try the new BitBake manual?
>
> http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html#flexible-inheritance-for-class-functions
>
> Let me know if that doesn't answer your questions.

  i think that section could be extended a bit to offer more
information, so i might take a shot at it. first, i think it should
emphasize that it's primarily(?) used for enhancing the default
implementation of "base" functions. just using "foo" and "bar" here is
maddeningly vague. throwing in an (admittedly OE-related) example like
this from cmake.bbclass:

  cmake_do_compile()  {
        cd ${B}
        base_do_compile
  }

  cmake_do_install() {
        cd ${B}
        autotools_do_install
  }

would, i think, clarify the general power of this feature.

  and a question about a particular example. richard purdie replied to
my post a while back about package.bbclass and debian.bbclass, but i'm
still a bit confused. here's a snippet from package.bbclass:

  python package_package_name_hook() {
      """
      A package_name_hook function can be used to rewrite the package names by
      changing PKG.  For an example, see debian.bbclass.
      """
      pass
  }
  EXPORT_FUNCTIONS package_name_hook

so as i read it, the above defines the function
"package_package_name_hook" which doesn't do a whole lot, but is now
available to other classes that inherit this one, particularly
debian.bbclass that's specifically mentioned.

  but if one goes to debian.bbclass, one finds:

  python debian_package_name_hook () {
      import glob, copy, stat, errno, re
      ... snip ...
  }

  EXPORT_FUNCTIONS package_name_hook

but, as far as i can tell, that is the only class that requires a
package name hook, and it simply defines its own implementation -- it
does nothing with package.bbclass and makes no reference to the
exported function package_package_name_hook(). so am i just
misunderstanding something? what was the point of defining and
exporting that function in package.bbclass if no other class takes
advantage of it?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-14 12:20   ` Robert P. J. Day
@ 2014-07-14 12:26     ` Paul Eggleton
  2014-07-22 13:19       ` Trevor Woerner
  2014-07-14 12:30     ` Burton, Ross
  1 sibling, 1 reply; 13+ messages in thread
From: Paul Eggleton @ 2014-07-14 12:26 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: openembedded-devel

On Monday 14 July 2014 08:20:59 Robert P. J. Day wrote:
> On Mon, 14 Jul 2014, Paul Eggleton wrote:
> > Hi Robert,
> > 
> > On Sunday 13 July 2014 10:19:08 Robert P. J. Day wrote:
> > >   followup to last post -- all of the methods for "overriding" task
> > > 
> > > definitions in the last post can be used without predeclaring that
> > > you're about to do that; you just go ahead and do it in either a class
> > > file or a recipe file. on the other hand, EXPORT_FUNCTIONS allows you
> > > to retain the base definition of a task (or non-task function, as i
> > > read it), then define a more general enhanced version.
> > > 
> > >   (side note: i don't see a single mention of "EXPORT_FUNCTIONS" in
> > > 
> > > any of the numerous yocto docs -- i think this feature needs some
> > > explanation *somewhere*. :-)
> > 
> > Did you try the new BitBake manual?
> > 
> > http://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-> > manual.html#flexible-inheritance-for-class-functions
> > 
> > Let me know if that doesn't answer your questions.
> 
>   i think that section could be extended a bit to offer more
> information, so i might take a shot at it. first, i think it should
> emphasize that it's primarily(?) used for enhancing the default
> implementation of "base" functions. just using "foo" and "bar" here is
> maddeningly vague. throwing in an (admittedly OE-related) example like
> this from cmake.bbclass:
> 
>   cmake_do_compile()  {
>         cd ${B}
>         base_do_compile
>   }
> 
>   cmake_do_install() {
>         cd ${B}
>         autotools_do_install
>   }
> 
> would, i think, clarify the general power of this feature.

Unfortunately as far as the BitBake manual is concerned, it pretty much has to 
be abstract. Remember that there are no base implementations of any task 
functions in BitBake itself; the ones you refer to are in OE's base.bbclass.

>   and a question about a particular example. richard purdie replied to
> my post a while back about package.bbclass and debian.bbclass, but i'm
> still a bit confused. here's a snippet from package.bbclass:
> 
>   python package_package_name_hook() {
>       """
>       A package_name_hook function can be used to rewrite the package names
> by changing PKG.  For an example, see debian.bbclass.
>       """
>       pass
>   }
>   EXPORT_FUNCTIONS package_name_hook
> 
> so as i read it, the above defines the function
> "package_package_name_hook" which doesn't do a whole lot, but is now
> available to other classes that inherit this one, particularly
> debian.bbclass that's specifically mentioned.
> 
>   but if one goes to debian.bbclass, one finds:
> 
>   python debian_package_name_hook () {
>       import glob, copy, stat, errno, re
>       ... snip ...
>   }
> 
>   EXPORT_FUNCTIONS package_name_hook
> 
> but, as far as i can tell, that is the only class that requires a
> package name hook, and it simply defines its own implementation -- it
> does nothing with package.bbclass and makes no reference to the
> exported function package_package_name_hook(). so am i just
> misunderstanding something? what was the point of defining and
> exporting that function in package.bbclass if no other class takes
> advantage of it?

Right, the debian.bbclass implementation probably doesn't need to be 
implemented in that way, AFAICT.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-14 12:20   ` Robert P. J. Day
  2014-07-14 12:26     ` Paul Eggleton
@ 2014-07-14 12:30     ` Burton, Ross
  2014-07-14 13:33       ` Robert P. J. Day
  1 sibling, 1 reply; 13+ messages in thread
From: Burton, Ross @ 2014-07-14 12:30 UTC (permalink / raw)
  To: OE-devel; +Cc: Paul Eggleton

On 14 July 2014 13:20, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> but, as far as i can tell, that is the only class that requires a
> package name hook, and it simply defines its own implementation -- it
> does nothing with package.bbclass and makes no reference to the
> exported function package_package_name_hook(). so am i just
> misunderstanding something? what was the point of defining and
> exporting that function in package.bbclass if no other class takes
> advantage of it?

So there needs to be an empty implementation and EXPORT_FUNCTION for
package_package_name_hook so that you don't get "cannot find function
package_name_hook" when you don't have the debian.bbclass enabled.

In cleaning that up I proposed removing the EXPORT_FUNCTION entirely
for the hook, but Richard recalled there being something out there
that did use the ability to chain up into debian.bbclass's
implementation, so I kept it.

Ross


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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-14 12:30     ` Burton, Ross
@ 2014-07-14 13:33       ` Robert P. J. Day
  2014-07-14 15:19         ` Paul Eggleton
  0 siblings, 1 reply; 13+ messages in thread
From: Robert P. J. Day @ 2014-07-14 13:33 UTC (permalink / raw)
  To: OE-devel; +Cc: Paul Eggleton

On Mon, 14 Jul 2014, Burton, Ross wrote:

> On 14 July 2014 13:20, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> > but, as far as i can tell, that is the only class that requires a
> > package name hook, and it simply defines its own implementation -- it
> > does nothing with package.bbclass and makes no reference to the
> > exported function package_package_name_hook(). so am i just
> > misunderstanding something? what was the point of defining and
> > exporting that function in package.bbclass if no other class takes
> > advantage of it?
>
> So there needs to be an empty implementation and EXPORT_FUNCTION for
> package_package_name_hook so that you don't get "cannot find
> function package_name_hook" when you don't have the debian.bbclass
> enabled.
>
> In cleaning that up I proposed removing the EXPORT_FUNCTION entirely
> for the hook, but Richard recalled there being something out there
> that did use the ability to chain up into debian.bbclass's
> implementation, so I kept it.

  uh oh ... now i'm a bit confused again so let me back up a bit
because i really want to understand this. my apologies for the tedium.

  as i read it, the only purpose of EXPORT_FUNCTIONS is to support the
idea of being able to qualify a function with its class name so that
you can (effectively) have access to more than one function with the
same "name" at the same time. first, let's see where this is *not*
necessary.

  as an example, base.bbclass defines the routine:

oe_runmake() {
        oe_runmake_call "$@" || die "oe_runmake failed"
}

now, since every class automatically inherits base.bbclass, all of
those classes can call oe_runmake(), right? that routine is in their
namespace, there is no need to export it, and they will all get that
function as it's defined in base.bbclass.

  in addition, even if a class inherits base.bbclass, it has the right
to totally override that routine by redefining a new oe_runmake(),
yes? (or possibly _appending or _prepending to it.) in any event, at
any time, there is only one definition of a function called
oe_runmake() in scope. so far, so good?

  what EXPORT_FUNCTIONS appears to do is simply allow you access to
more than one function with the same "name", so let's look at
base.bbclass and, say, the do_fetch() routine:

python base_do_fetch() {
    ... snip code ...
}
...
EXPORT_FUNCTIONS do_fetch

what does the above do? it now allows you to define, say,
derived.bbclass, and define a new do_fetch() in terms of the base
do_fetch(), as in:

do_fetch() {
    ...
    base_do_fetch()
    ...
}

however, if i created a new class that had no interest in redefining
do_fetch() and i was happy with the base definition, i could simply
continue to use the name do_fetch(), correct? the fact that that
function was exported in base.bbclass is not relevant to me if i am
not trying to redefine the name. (i suspect i could also refer to it
by the name base_do_fetch() if i wanted, but that's unnecessary.)

  that's why i was confused by ross' earlier paragraph about
package_name_hook being defined in package.bbclass -- unless some
other class is going to try to access two functions called
"package_naem_hook" at the same time, i currently see no need to
export it in package.bbclass. however, if there was something else
going on somewhere that needed this as richard purdie suggested, then
i'd be interested in knowing what that is just to understand the whole
picture.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================




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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-14 13:33       ` Robert P. J. Day
@ 2014-07-14 15:19         ` Paul Eggleton
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Eggleton @ 2014-07-14 15:19 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: OE-devel

On Monday 14 July 2014 09:33:25 Robert P. J. Day wrote:
> On Mon, 14 Jul 2014, Burton, Ross wrote:
> > On 14 July 2014 13:20, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> > > but, as far as i can tell, that is the only class that requires a
> > > package name hook, and it simply defines its own implementation -- it
> > > does nothing with package.bbclass and makes no reference to the
> > > exported function package_package_name_hook(). so am i just
> > > misunderstanding something? what was the point of defining and
> > > exporting that function in package.bbclass if no other class takes
> > > advantage of it?
> > 
> > So there needs to be an empty implementation and EXPORT_FUNCTION for
> > package_package_name_hook so that you don't get "cannot find
> > function package_name_hook" when you don't have the debian.bbclass
> > enabled.
> > 
> > In cleaning that up I proposed removing the EXPORT_FUNCTION entirely
> > for the hook, but Richard recalled there being something out there
> > that did use the ability to chain up into debian.bbclass's
> > implementation, so I kept it.
> 
>   uh oh ... now i'm a bit confused again so let me back up a bit
> because i really want to understand this. my apologies for the tedium.
> 
>   as i read it, the only purpose of EXPORT_FUNCTIONS is to support the
> idea of being able to qualify a function with its class name so that
> you can (effectively) have access to more than one function with the
> same "name" at the same time. first, let's see where this is *not*
> necessary.
> 
>   as an example, base.bbclass defines the routine:
> 
> oe_runmake() {
>         oe_runmake_call "$@" || die "oe_runmake failed"
> }
> 
> now, since every class automatically inherits base.bbclass, all of
> those classes can call oe_runmake(), right? that routine is in their
> namespace, there is no need to export it, and they will all get that
> function as it's defined in base.bbclass.
> 
>   in addition, even if a class inherits base.bbclass, it has the right
> to totally override that routine by redefining a new oe_runmake(),
> yes? (or possibly _appending or _prepending to it.) in any event, at
> any time, there is only one definition of a function called
> oe_runmake() in scope. so far, so good?

Yes.

>   what EXPORT_FUNCTIONS appears to do is simply allow you access to
> more than one function with the same "name", so let's look at
> base.bbclass and, say, the do_fetch() routine:
> 
> python base_do_fetch() {
>     ... snip code ...
> }
> ...
> EXPORT_FUNCTIONS do_fetch
> 
> what does the above do? it now allows you to define, say,
> derived.bbclass, and define a new do_fetch() in terms of the base
> do_fetch(), as in:
> 
> do_fetch() {
>     ...
>     base_do_fetch()
>     ...
> }
> 
> however, if i created a new class that had no interest in redefining
> do_fetch() and i was happy with the base definition, i could simply
> continue to use the name do_fetch(), correct? the fact that that
> function was exported in base.bbclass is not relevant to me if i am
> not trying to redefine the name. (i suspect i could also refer to it
> by the name base_do_fetch() if i wanted, but that's unnecessary.)

Yes.

>   that's why i was confused by ross' earlier paragraph about
> package_name_hook being defined in package.bbclass -- unless some
> other class is going to try to access two functions called
> "package_naem_hook" at the same time, i currently see no need to
> export it in package.bbclass. however, if there was something else
> going on somewhere that needed this as richard purdie suggested, then
> i'd be interested in knowing what that is just to understand the whole
> picture.

I'm not sure what that example was I'm afraid, but maybe Richard can fill in 
the blanks.

Cheers,
Paul;

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-14 12:26     ` Paul Eggleton
@ 2014-07-22 13:19       ` Trevor Woerner
  2014-07-22 13:22         ` Robert P. J. Day
  2014-07-22 13:40         ` Paul Eggleton
  0 siblings, 2 replies; 13+ messages in thread
From: Trevor Woerner @ 2014-07-22 13:19 UTC (permalink / raw)
  To: openembedded-devel, Paul Eggleton

On 07/14/14 08:26, Paul Eggleton wrote:
> Unfortunately as far as the BitBake manual is concerned, it pretty
> much has to be abstract. Remember that there are no base
> implementations of any task functions in BitBake itself; the ones you
> refer to are in OE's base.bbclass.

In reality there are only about 2 people on the whole planet for whom
that distinction is important :-)

For the rest of us, it would be nice if there was some middle ground
from which a document could be written that treated these two entities
as one; at least up until such a time as some other project comes along
and uses bitbake for something other than OE/Yocto :-D


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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-22 13:19       ` Trevor Woerner
@ 2014-07-22 13:22         ` Robert P. J. Day
  2014-07-22 13:42           ` Trevor Woerner
  2014-07-22 13:40         ` Paul Eggleton
  1 sibling, 1 reply; 13+ messages in thread
From: Robert P. J. Day @ 2014-07-22 13:22 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Paul Eggleton

On Tue, 22 Jul 2014, Trevor Woerner wrote:

> On 07/14/14 08:26, Paul Eggleton wrote:
> > Unfortunately as far as the BitBake manual is concerned, it pretty
> > much has to be abstract. Remember that there are no base
> > implementations of any task functions in BitBake itself; the ones
> > you refer to are in OE's base.bbclass.
>
> In reality there are only about 2 people on the whole planet for
> whom that distinction is important :-)

  i should point out that fetching is defined in bitbake, while
everything else is in oe-core. just being difficult. :-)

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-22 13:19       ` Trevor Woerner
  2014-07-22 13:22         ` Robert P. J. Day
@ 2014-07-22 13:40         ` Paul Eggleton
  1 sibling, 0 replies; 13+ messages in thread
From: Paul Eggleton @ 2014-07-22 13:40 UTC (permalink / raw)
  To: Trevor Woerner; +Cc: openembedded-devel

Hi Trevor,

On Tuesday 22 July 2014 09:19:05 Trevor Woerner wrote:
> On 07/14/14 08:26, Paul Eggleton wrote:
> > Unfortunately as far as the BitBake manual is concerned, it pretty
> > much has to be abstract. Remember that there are no base
> > implementations of any task functions in BitBake itself; the ones you
> > refer to are in OE's base.bbclass.
> 
> In reality there are only about 2 people on the whole planet for whom
> that distinction is important :-)

I see where you're coming from, but we want BitBake to remain usable 
independently, and that means it affects anyone who works on BitBake not just 
the few that do use it independently. That also means that the documentation 
should stand on its own - it *can* use examples from the OE metadata, but it 
has to be clear that it is an example from OE, and it should describe the 
example fully - it can't blur the lines between OE and BitBake; if you start 
assuming OE functionality when documenting BitBake, that's exactly what you'll 
be doing.

> For the rest of us, it would be nice if there was some middle ground
> from which a document could be written that treated these two entities
> as one; 

That's exactly what the Yocto Project manuals do. They refer to the BitBake 
manual where we want to describe some syntax or other fundamental BitBake 
concept in more detail. However, it's OK to have duplication between the 
BitBake manual and the Yocto Project manuals where we can add more relevant 
detail on the Yocto Project side - but I'd rather not see complete 
duplication.

> at least up until such a time as some other project comes along
> and uses bitbake for something other than OE/Yocto :-D

FWIW I think there are other projects already. We don't hear about them a lot, 
but they have come up from time to time.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: overriding tasks with EXPORT_FUNCTIONS
  2014-07-22 13:22         ` Robert P. J. Day
@ 2014-07-22 13:42           ` Trevor Woerner
  0 siblings, 0 replies; 13+ messages in thread
From: Trevor Woerner @ 2014-07-22 13:42 UTC (permalink / raw)
  To: openembedded-devel

On 07/22/14 09:22, Robert P. J. Day wrote:
> On Tue, 22 Jul 2014, Trevor Woerner wrote:
>
>> On 07/14/14 08:26, Paul Eggleton wrote:
>>> Unfortunately as far as the BitBake manual is concerned, it pretty
>>> much has to be abstract. Remember that there are no base
>>> implementations of any task functions in BitBake itself; the ones
>>> you refer to are in OE's base.bbclass.
>> In reality there are only about 2 people on the whole planet for
>> whom that distinction is important :-)
>   i should point out that fetching is defined in bitbake, while
> everything else is in oe-core. just being difficult. :-)

And (if I'm not mistaken) kergoth (?) is working on separating the
fetching process from bitbake too :-)


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

end of thread, other threads:[~2014-07-22 13:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-13 14:19 overriding tasks with EXPORT_FUNCTIONS Robert P. J. Day
2014-07-14  9:24 ` Paul Eggleton
2014-07-14 10:18   ` Robert P. J. Day
2014-07-14 10:22     ` Paul Eggleton
2014-07-14 12:20   ` Robert P. J. Day
2014-07-14 12:26     ` Paul Eggleton
2014-07-22 13:19       ` Trevor Woerner
2014-07-22 13:22         ` Robert P. J. Day
2014-07-22 13:42           ` Trevor Woerner
2014-07-22 13:40         ` Paul Eggleton
2014-07-14 12:30     ` Burton, Ross
2014-07-14 13:33       ` Robert P. J. Day
2014-07-14 15:19         ` Paul Eggleton

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.