cooker: Add option of specifying indvidual tasks for targets

Currently its near enough impossible to tell bitbake to run target X,
task Y and target A, task B. We could hack various parts of the API
around but it would mean incompatibilities.

An alternative is to accept the syntax "<target>:do_<task>" as a target
name. The default task would be used where the task is unspecified.

This has the advantage that its neat/clean code and works from all
current APIs including the commandline.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: change error_msg for CommandFailed event

When a bb.command.CommandFailed event is received by Hob, the error
message is stored inside event.error.
This information tells exactly why bitbake failed, so Hob should display
it instead of the current composed message.

Signed-off-by: Irina Patru <irina.patru@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake: hob: check if parser has attribute 'shutdown'

It must be checked first if parser has the attribute 'shutdown' when
user hits Stop button and the forceshutdown state is given.

[HOB #5579]

Signed-off-by: Irina Patru <irina.patru@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: unsetting busy cursor after hitting Stop button

The busy cursor would never change after pressing Stop button.
It should be set after the possible return inside machine_combo_changed_cb()
method.

Signed-off-by: Irina Patru <irina.patru@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: don't display interruptions as fails

When Hob receives a bb.command.CommandFailed event, it should check if
it's a log kind of information.
"Forced shutdown" and "Stopped build" are messages that show when a build
is not complete, but Hob considered them error.

[HOB #5609]

Signed-off-by: Irina Patru <irina.patru@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: Don't always save proxy values in conf file

If enable_proxy is not activated, Hob should not save the proxy values
in the conf file when user hits save button.

[ HOB #5308 ]

Signed-off-by: Irina Patru <irina.patru@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: No need for enable_proxy and same_proxy in conf file

Hob doesn't read these variable from file and bitbake doesn't use them,
so they shouldn't be set in conf file.

Signed-off-by: Irina Patru <irina.patru@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
runqueue: Simplify pointless len() usage

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
siggen.py: fix the SignatureGenerator()

If we set:

BB_SIGNATURE_HANDLER = "noop"

Then we would get the following errors:

[snip]
File "runqueue.py", line 876, in RunQueue._start_worker(fakeroot=False, rqexec=None):
                "fakerootnoenv" : self.rqdata.dataCache.fakerootnoenv,
   >            "hashes" : bb.parse.siggen.taskhash,
                "hash_deps" : bb.parse.siggen.runtaskdeps,
AttributeError: 'SignatureGenerator' object has no attribute 'taskhash'
[snip]

This patch fixes the problem.

[YOCTO #5741]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Revert "usermanual: Updated CC License to version 3.0"

This reverts commit 0546bc19557de9263b448ceb1707884543d2de56.

This change was not discussed with the copyright holders so the license
needs to remain at version 2.5.
user-manual: Fix issue with previous revert

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
runqueue: Fix race against tasks sharing stamp files

Shared work directories work by assuming bitbake will not run
more than one task with a specific stamp name. Recent runqueue optimisations
accidentally broke this meaning there could be races. This fixes the code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
data: Account for pre/postfunc functions when calculating dependencies

pre/postfuncs were not being added to checksums. This meant that when reconfiguration
occurred, tasks were not always being rerun when they should. This include
sstate functions as well as systemd's do_install function in the OE metadata.

With the addition of postfuncs, its possible a shell task can have a python
pre/postfunc so we have to guard against this when generating shell output
in emit_func.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake: build.py: create separate function for shell trap creation code

Currently, the shell trap code was created in exec_func_shell(). Split
the function so that we can create the code separately.

Also, some whitespaces were automatically deleted by my editor. Since
this is not necessarily a bad thing, leave these changes too.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
runqueue: Fix setscene hard dependency problems

Commit c54e738e2b5dc0d8e6fd8e93b284ed96e7a83051 added in the idea of hard dependencies
such as the case a setscene has a hard dependency on pseudo-native and that
dependency wasn't available from sstate for some reason.

Unfortunately the implementation was a bit too enthusiastic, causing rebuilds
of things when it wasn't necessary. A test case was:

bitbake quilt-native
bitbake quilt-native -c clean
bitbake <some-image>

and then you'd watch quilt-native get rebuilt for no good reason.

The clue to the problem is in the for loop where it never depends on
the item being iterated over.

The fix is to include the exact list of hard dependencies rather than
guessing. With these changes, the use case above works, the one in
the original commit also works.

This patch also adds in or cleans up various pieces of logging to
allow issues like this to be more easily debugged in future.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
user-manual-ref-variables.xml: Added BB* variables to glossary.

BB_STRICT_CHECKSUM
BB_WORKERCONTEXT
BB_SIGNATURE_EXCLUDE_FLAGS
BB_HASHBASE_WHITELIST
BB_INVALIDCONF
BB_LOGFMT
BB_RUNFMT
BB_RUNTASK
BB_HASHBASE_WHITELIST
BB_STAMP_POLICY
BB_STAMP_WHITELIST
BB_SCHEDULER
BB_SCHEDULERS
BB_SETSCENE_DEPVALID
BB_SETSCENE_VERIFY_FUNCTION
BB_SIGNATURE_HANDLER
BB_SRCREV_POLICY
BB_VERBOSE_LOGS

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
user-manual-ref-variables.xml: Added FAKEROOT* variables to glossary.

FAKEROOT
FAKEROOTCMD
FAKEROOTBASEENV
FAKEROOTDIRS
FAKEROOTENV
FAKEROOTNOENV

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
user-manual-ref-variables.xml: Added PREFERRED_PROVIDERS to glossary.

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
user-manual-ref-variables.xml: Edits to PREFERRED_PROVIDER.

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
user-manual-ref-variables.xml: Added 6 new variables to glossary:

MULTI_PROVIDER_WHITELIST
CACHE
PERSISTENT_DIR
FETCHCMD
FILE
FILESDIR

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>