Bug 10095

Summary: Suggested documentation for the currently undocumented *_task-foo override syntax
Product: [Documentation] BitBake User Manual Reporter: ulfalizer
Component: bitbake-manualAssignee: Scott Rifenbark <srifenbark>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: bluelightning, richard.purdie, srifenbark
Version: 2.2   
Target Milestone: 2.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard: 10 April 2017: RESOLVED
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Done (doc changes complete)

Description ulfalizer 2016-08-05 02:49:47 UTC
There's a FOO_task-mytask override syntax that sets a variable just for the
duration of a single task, but it's currently undocumented. I suggest adding a
new entry to the end of '3.2.1. Conditional Metadata':

  * Setting a variable for a single task: BitBake supports setting a variable
    just for the duration of a single task. Here is an example:

        FOO_task-configure = "val 1"
        FOO_task-compile = "val 2"

    In this example, FOO will have the value "val 1" while the do_configure
    task is executed, and the value "val 2" while the do_compile task is
    executed.
    
    Internally, this is implemented by prepending e.g. "task-compile:" to the
    value of OVERRIDES for the local datastore of the do_compile task.

    This syntax can also be combined with e.g. "_prepend", as in the following
    example:

        EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "


Cheers,
Ulf
Comment 1 Scott Rifenbark 2016-08-08 16:40:31 UTC
Ulf, 

See http://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#conditional-metadata for the new item in that list.

Scott
Comment 2 ulfalizer 2016-08-08 19:27:43 UTC
One nit: The "e.g." before "_prepend" got lost in

  This syntax can also be combined with "_prepend"

Without it, it sounds like it can only be combined with "_prepend" and not e.g. "_append".

Cheers,
Ulf
Comment 3 Scott Rifenbark 2016-08-08 20:51:46 UTC
(In reply to comment #2)
> One nit: The "e.g." before "_prepend" got lost in
> 
>   This syntax can also be combined with "_prepend"
> 
> Without it, it sounds like it can only be combined with "_prepend" and not
> e.g. "_append".

Look at this version - http://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#conditional-metadata.  I didn't like the way it originally read.  Will this work?

> 
> Cheers,
> Ulf
Comment 4 ulfalizer 2016-08-08 20:55:14 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > One nit: The "e.g." before "_prepend" got lost in
> > 
> >   This syntax can also be combined with "_prepend"
> > 
> > Without it, it sounds like it can only be combined with "_prepend" and not
> > e.g. "_append".
> 
> Look at this version -
> http://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.
> html#conditional-metadata.  I didn't like the way it originally read.  Will
> this work?

Looks good to me. I agree that "this syntax can also be combined with for example..." sounds a bit sloppy. :)

Cheers,
Ulf
Comment 5 Paul Eggleton 2016-08-18 15:59:42 UTC
Great, I was just about to file this.

One note to make is that if the task name contains underscores then they need to be replaced with hyphens when specifying the override e.g.

VARNAME_task-populate-sysroot = "somevalue"
Comment 6 Scott Rifenbark 2016-10-25 20:12:03 UTC
Moving to 2.3 M2
Comment 7 Scott Rifenbark 2017-03-20 18:19:07 UTC
Setting to 2.3 M4.

Paul - See http://www.yoctoproject.org/docs/2.3/bitbake-user-manual/bitbake-user-manual.html#conditional-metadata and the "Setting a Variable for a Single Task" item in the list.  I added a new note.  Tell me if this is okay. 

Thanks,
Scott
Comment 8 Scott Rifenbark 2017-04-10 18:17:22 UTC
Hi,

No review since March 20th... assuming okay.  Setting to RESOLVED and marking the doc flag "done."

Scott