Commit Graph

293 Commits

Author SHA1 Message Date
Richard Purdie 3051f36444 bitbake: runqueue.py: Fix recursive task pruning to only prune self referencing tasks
(Bitbake rev: 4962a59793504b26b06cf058dda600a07fbbd951)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-04 17:40:38 +01:00
Richard Purdie 3488966926 bitbake: runqueue.py: Allow recrdeptasks that have self references
In some cases we want to pull in DEPENDS and RDEPENDS of recrdeptask
dependencies but we need a way to trigger or avoid this behaviour
depending on context. The logical syntax to trigger such behaviour
would be a self referencing recrdeptask:

do_a[recrdeptask] = "do_a do_b"

The dependency chains already recurse this kind of expression correctly, the
missing piece is to avoid any circular reference errors. Since the dependencies
have already been recursively resolved, simply removing any recrdeptask
references is enough to break the circular references.

This patch therefore removes any circular references using the set
difference_update() operator. There will be metadata tweaks required to
add any references needed to the extra taskname.

(Bitbake rev: a5324da9b8a0c9307a6c511ea9009f34be70c92b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-04 14:48:14 +01:00
Richard Purdie 4129d5dc7c bitbake: runqueue.py: Handle multiple rdeptask entries
I'm not sure why we don't currently allow multiple entries in rdeptask when
we do in deptask. This makes the handling match between the two since
its trivial to fix.

(Bitbake rev: 19c84fe8854639768c874cc1449963a9867ad397)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-28 16:32:57 +01:00
Richard Purdie 5fa6036d49 bitbake: runqueue: Reimplement recrdepends so it works more correctly
Currently, recrdepends is extremely greedy. For example:

do_foo[rdepends] = "somedep:sometask"
addtask foo

which adds foo with *no* dependencies, will suddenly start appearing
as a dependency in every task which uses recrdepends. So far this has
been mildy annoying but we now have use cases where this makes no sense
at all.

This reworks the recrdepends code to avoid this problem. To do this we
can no longer collapse things into lists just based on file ID. The problem
is this code is extremely performance sensitive. The "preparing runqueue"
phase spends a lot of time in these recursive dependency calculations so any
change here could negatively impact the user experience.

As such, this code has been carefully tested on convoluted dependency trees
with operations like "time bitbake world -g". The net result of this change
and the preceeding changes combined is a net speed up of these operations in
all cases measured.

Tests were made comparing "bitbake world -g" task-depends.dot before and after
this patch. There *are* differences for example -nativesdk do_build dependencies
on -native recipes are no longer present. All removed dependencies appear to
be sensible improvements to the system. The "rdepends" cross contamination
issue above is also fixed.

(Bitbake rev: 82d73423c57569b984ee0ae3d93e3c3bd5dc5216)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-28 16:32:57 +01:00
Richard Purdie be22b92627 bitbake: runqueue.py: Convert depends variable to use sets
This gives some small performance gains and sets the scene for other
improvements by removing the need for duplicate detection code.

(Bitbake rev: 6fd723479e8d49227fd58040b3485c1d5afc4bc5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-28 16:32:57 +01:00
Richard Purdie edfb2ba32c bitbake: taskdata: Add gettask_id_fromfnid helper function
This is like gettask_id but doesn't require translation of fnid -> fn
first which the function then translates back. This gives a sizeable
performance improvement since a significant number of lookups are avoided.

(Bitbake rev: 3190cb83e2af195a464f669c5aa8aedbf795160e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-28 16:32:57 +01:00
Richard Purdie 15a31a93ba bitbake: taskdata.py: Add support for rdepends task flag
Currently its not possible to add arbitrary RDEPENDS to a specific task.
This can be useful and this patch adds functionality equivalent to the
'depends' task flag.

(Bitbake rev: db65080a6199baecc5c422294a4c4a9fd12dc29e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-25 14:57:16 +01:00
Richard Purdie be98c1fc29 bitbake: utils.py: Add function to set nonblocking operation on a file descriptor
(Bitbake rev: ab6d71ebfcfb7bedc064b25f84647c8815096e5a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-25 14:57:16 +01:00
Paul Eggleton c072fa8400 bitbake: bitbake: add -C option to invalidate a task and rebuild the target
This new command line option forces the specified task and all dependent
tasks up to the default task to re-run. This means that the following
single step:

bitbake -C compile somerecipe

is equivalent to the following two steps (with the recent change to -f):

bitbake -c compile -f somerecipe
bitbake somerecipe

Note that to work this option needs full hashing enabled (i.e.
BB_SIGNATURE_HANDLER must be set to a signature handler that inherits
from BasicHash). If this is not the case, -C effectively does nothing.

Based on a previous implementation of this option by Jason Wessel
<jason.wessel@windriver.com>.

Implements [YOCTO #2615].

(Bitbake rev: 2530e0faada5775897cfd1b93aba6925826dca73)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-21 13:10:32 +01:00
Paul Eggleton 5bd11a9bf3 bitbake: bitbake: ensure -f causes dependent tasks to be re-run
If -f is specified, force dependent tasks to be re-run next time. This
works by changing the force behaviour so that instead of deleting the
task's stamp, we write a "taint" file into the stamps directory, which
will alter the taskhash randomly and thus trigger the task to re-run
next time we evaluate whether or not that should be done as well as
influencing the taskhashes of any dependent tasks so that they are
similarly re-triggered. As a bonus because we write this file as
<stamp file name>.taskname.taint, the existing code which deletes the
stamp files in OE's do_clean will already handle removing it.

This means you can now do the following:

bitbake somepackage
[ change the source code in the package's WORKDIR ]
bitbake -c compile -f somepackage
bitbake somepackage

and the result will be that all of the tasks that depend on do_compile
(do_install, do_package, etc.) will be re-run in the last step.

Note that to operate in the manner described above you need full hashing
enabled (i.e. BB_SIGNATURE_HANDLER must be set to a signature handler
that inherits from BasicHash). If this is not the case, -f will just
delete the stamp for the specified task as it did before.

This fix is required for [YOCTO #2615] and [YOCTO #2256].

(Bitbake rev: f7b55a94226f9acd985f87946e26d01bd86a35bb)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-21 13:10:32 +01:00
Richard Purdie 59ca57cd23 bitbake/runqueue: Drop check_stamp_fn, it's obsolete and should not be used
This function was used by old code such as packaged staging but is thankfully
obsolete now and replaced with better mechanisms. Its time to remove it and
the horrible internal only variables associated with it.

(Bitbake rev: 2995b8d551e0532eca20f8862730acd062c608ad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-11 11:54:27 +01:00
Richard Purdie be4f8e368c bitbake/runqueue: Drop check_stamps function, it is obsolete and unused
This was originally used to check the consistency of the stamps in one function
call. This turns out to be inefficient, unnecessary and if it were necessary,
check_stamp_task() could be called in a loop. The function has been unmodified
for a while and likely contains bugs. Its best simply removed.

(Bitbake rev: 728ffde1bd69b880d48fe8523b1616956d13616e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-11 11:54:26 +01:00
Richard Purdie d48d8aa1e7 bitbake/runqueue: Fix 'full' stamp checking to be more efficient and cache results
This should fix issues where bitbake would seemingly lock up when checking
certain configurations of stampfiles.

The cache is kept within the runqueue since that feels like the right
place to associate this cache data.

(Bitbake rev: e95755c4931b26d9f8102ed3652dff969145cfc9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-11 11:54:26 +01:00
Christopher Larson 4a2147f54f runqueue: drop unnecessary keys() in runqueue_process_waitpid
(Bitbake rev: d03dc07dea2f4e594fdbe4abe618670fe628a7c9)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-11 11:54:26 +01:00
Christopher Larson e2c58b40d1 runqueue: handle task exit due to signal/stop
- for a normal exit, use WEXITSTATUS, rather than manually shifting
- for exit via signal, set the exit code to 128+N, per shell convention
- if a process was stopped, return and don't handle it, as the process can yet
  be continued

This should fix the case where bitbake says a task failed with an exit code of
0 (we assumed failure based on the overall status, but didn't pass all the
information along to task_fail).

(Bitbake rev: 84ea614bc56d35a414eb5bf5658891b340bfc569)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-11 11:54:26 +01:00
Shane Wang 984c23f7d7 runqueue: wait and deal with those <defunct> sub-processes as soon as they are os.killed() when "Force stop"
When "Force stop" is performed during the build stage, after os.kill() kills the build sub-processes, there are many <defunct> python processes in the system. In Hob, when the user initiates a new build, os.waitpid() in runqueue_process_waitpid() will be called, and the pids of those <defunct> processes will be returned as result[0], then self.build_pids[result[0]] will throw KeyError exception because now for the new build self.build_pids is empty.

This patch is to address the above issue to collect the results and handle the sub-processes as soon as they are killed.

[Yocto #2186]

(Bitbake rev: e9f4ca467e795bbc520d12b0e7a5985b6ff0a20e)

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-30 17:20:21 +01:00
Robert P. J. Day 8b206d38c7 Typo: "nonexistant" -> "non-existent"
(Bitbake rev: c4c8df0e1e77f99f3ee0b07e1748116fc362819f)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-20 15:21:32 +00:00
Richard Purdie 4ca7075b09 runqueue.py: When checking whether stamps are valid for setscene, recurse
Currently the code checking whether stamps are valid only traverses one step
of the dependency graph. This works fine in the normal cases where we've already
validated dependencies but for the setscene code, it doesn't work well. A typical
problem usecase is something like:

bitbake gcc-cross -c unpack -f
bitbake gcc-cross

which will ignore any sstate files already cached which could be used to speed
up the gcc-cross build. This becomes particularly problematic with multiple gcc
builds where only one should rebuild yet they all do.

This patch teaches the stamp code to be able to recurse within a given fn
which gives the behaviour people would expect from the code and allows
bitbake to make better use of prebuild sstate objects.

(Bitbake rev: e68814cb2e8da523d4ddf05e8ceddfaa19244851)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-16 10:51:17 +00:00
Richard Purdie ff73b02a72 meta/classes: Convert to use appendVar and appendVarFlags
(From OE-Core rev: 3b57de68e70e77dbc03c0616a83a29a2e99e40b4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:36:53 -08:00
Paul Eggleton 8078553d7b bitbake/runqueue: fix python error on scenequeue task failure
Fixes a regression introduced in commit
e8a3499c95a6d4f2b8fed002fb9504733c5be3c6 which resulted in a
backtrace on setscene task failure due to trying to dereference
the setscene task ID twice.

(Bitbake rev: 8b846a92a58b5c20d7cfd2efd32b763e95c3c2fd)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-01 15:51:36 +00:00
Dongxiao Xu ba8538b3a9 runqueue.py: initialize rqexe at RunQueue's init function
Sometimes user stops the build before runqueue is established,
for example, at the stage of running add_unresolved() function. This
will cause RunQueue to use rqexe field in finish_runqeue() before
initialized. This will cause endless print of "Running idle function"
if use process server.

This commit initialize rqexe variable in RunQueue's init function,
and add a judgement in finish_runqueue().

(Bitbake rev: 59f817723172092a87738c79f555e605f55ea375)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-01 15:51:36 +00:00
Paul Eggleton ce0ecf5d84 bitbake: fix setscene task start/failure handling
* When a setscene task starts, print out that it's starting in the UI
  (ensuring we get the correct task name)
* When a setscene task fails, ensure we remove it from the list of
  running tasks so that if you break out any time afterwards it
  is not still listed.

(Bitbake rev: e8a3499c95a6d4f2b8fed002fb9504733c5be3c6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-28 12:27:22 +00:00
Paul Eggleton e7952c1883 bitbake/runqueue: make dry-run do everything except execute
Make dry-run do everything except executing the task, instead of
cutting it off earlier. This fully tests the code path for running the
child task (parsing and fakeroot), as well as enabling future
functionality such as using dry-run to produce signature files.

(Bitbake rev: bf1d7739618dabf3872a868230c0112b9ad2a2c0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-28 12:27:21 +00:00
Robert Yang 9674ea28ff V5 Disk space monitoring
Monitor disk availability and take action when the free disk space or
amount of free inode is running low, it is enabled when BB_DISKMON_DIRS
is set.

* Variable meanings(from meta-yocto/conf/local.conf.sample):

  # Set the directories to monitor for disk usage, if more than one
  # directories are mounted in the same device, then only one directory
  # would be monitored since the monitor is based on the device.
  # The format is:
  # "action,directory,minimum_space,minimum_free_inode"
  #
  # The "action" must be set and should be one of:
  # ABORT: Immediately abort
  # STOPTASKS: The new tasks can't be executed any more, will stop the build
  #           when the running tasks have been done.
  # WARN: show warnings (see BB_DISKMON_WARNINTERVAL for more information)
  #
  # The "directory" must be set, any directory is OK.
  #
  # Either "minimum_space" or "minimum_free_inode" (or both of them)
  # should be set, otherwise the monitor would not be enabled,
  # the unit can be G, M, K or none, but do NOT use GB, MB or KB
  # (B is not needed).
  #BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},1G,100K WARN,${SSTATE_DIR},1G,100K"
  #
  # Set disk space and inode interval (only works when the action is "WARN",
  # the unit can be G, M, or K, but do NOT use the GB, MB or KB
  # (B is not needed), the format is:
  # "disk_space_interval, disk_inode_interval",  the default value is
  # "50M,5K" which means that it would warn when the free space is
  # lower than the minimum space(or inode), and would repeat the action
  # when the disk space reduces 50M (or the amount of inode reduces 5k)
  # again.
  #BB_DISKMON_WARNINTERVAL = "50M,5K"

[YOCTO #1589]
(Bitbake rev: 4d173d441d2beb8e6492b6b1842682f8cf32e6cc)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-26 11:05:27 +00:00
Richard Purdie aac45679fb bitbake/runqueue: Ensure finish_now() sets the runqueue state consistently
If we call finish_now(True), rq.state is not updated to match. This
makes the behaviour of finish_now(False) and finish_now(True) consistent
so both leave rq.state consistently.

(Bitbake rev: 9079ae0ab74f9232b7e9853b2013b051d4fcf623)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-26 11:04:38 +00:00
Dongxiao Xu 656f9a0758 Hob: A new implemetation (v2)
This commit implements a new design for hob
Some of the new features:
 - Friendly new designed GUI. Quick response to user actions.
 - Two step builds support package generation and image generation.
 - Support running GUI seprarately from bitbake server.
 - Recipe/package selection and deselection.
 - Accurate customization for image contents and size.
 - Progress bars showing the parsing and build status.
 - Load/save user configurations from/into templates.

(Bitbake rev: 4dacd29f9c957d20f4583330b51e5420f9c3338d)

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Liming An <limingx.l.an@intel.com>
Signed-off-by: Fengxia Hua <fengxia.hua@intel.com>
Designed-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24 18:04:27 +00:00
Dongxiao Xu d02f7b4649 runqueue: fire sceneQueueTaskStarted event when a setscene queue starts
The current code prints a log when a setscene task starts, therefore
the progressbar in hob will not receive it. Use a sceneQueueTaskStarted
event instead.

Besides, change the sceneQueueTaskFailed event to inherit runQueueEvent
directly to avoid confusion to event receiver.

(Bitbake rev: 7c07cc93d6558d7d9c3144b13493901b7ebae050)

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24 16:11:24 +00:00
Paul Eggleton 5210cc40db bitbake: show appropriate warnings for universe target
When building the universe target:
* Show a warning about universe likely producing errors
* Multiprovider errors are now shown as warnings

Also remove an unused "error" variable in runqueue.py.

Fixes [YOCTO #1936]

(Bitbake rev: 293c796e8a3d1f74ca1e51017b6dede261612281)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-22 20:25:30 +00:00
Richard Purdie de7a6ab1ba runqueue.py: Add inter setscene task dependency handling
This is being added to resolve setscene race issues where we do have
particular dependencies required between setscene tasks. This allows
specific dependencies to be specified. This allows us to fix the races
in sstate with the useradd class in OE-Core.

Any tasks being depended upon have their reverse dependencies cleared to
ensure we don't have circular references.

(Bitbake rev: e1b157d26374a70e6274edcb4c0b9f3bc48f765c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-27 09:40:06 +00:00
Richard Purdie 9aeb38a5b8 runqueue.py: Fix missing setscene dependencies
When constructing the setscene inter-dependencies, we need to account for all task,
not just the last one found. This patch corrects this oversight and ensures all
dependencies are added, not just the first one found.

(Bitbake rev: b9b5b5129d066e1ff7d3effda116afc3c6657beb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-27 09:40:05 +00:00
Richard Purdie 2a361cdb39 data/runqueue.py: Fix commented out test code after variable name changes
(Bitbake rev: 175c5c8a5e51365aa127562e8598e84f5cd36495)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-27 09:40:05 +00:00
Paul Eggleton 42645b0965 bitbake/runqueue: always log tasks summary
It's unclear from the history but at some point we stopped logging the
"Tasks Summary" NOTE when tasks failed. Reinstate this for failure, and
also make the count of attempted tasks include the failed task.

(Bitbake rev: e44d5be98fc5d2589cd929ce143638395936b936)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-20 16:47:39 +00:00
Paul Eggleton 4e8085ccfa bitbake/runqueue: avoid "failed" in task summary if nothing did
Seeing the word "failed" alone without reading the whole context has
occasionally triggered an automatic assumption on the part of some users
(myself included) that something has gone wrong, even when this message
is telling you that "0 [tasks] failed". To avoid this let's just say
"all succeeded" in this case instead.

As a bonus this means you can now search the output for "fail" and not
find anything if all went well.

(Bitbake rev: b6f067af12d4661758a78788f1db472684b9aba8)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-15 10:06:21 +00:00
Richard Purdie 7f837eb05f bitbake/runqueue: Improve the setscene logging
When debugging setscene problems it was found that some extra debug messages were useful.
This patch adds them.

(Bitbake rev: cff2c258b77fde01d530a5923e553e6111b15eb5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-05 13:04:19 +00:00
Richard Purdie 4cd9671078 bitbake: Update users of getVar/setVar to use the data store functions directly
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27 10:35:30 +00:00
Richard Purdie ddd3f56ded runqueue.py: Fix debug message to reference the correct task
(Bitbake rev: 035c673c463ca450245acf824e7b7e8f889bdc89)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-24 22:11:44 +00:00
Richard Purdie 319ea222ee runqueue.py: Ensure we fully process the covered list
The existing looping code can mask an existing "found = True"
by forcing it to False each time. This can lead to dependency
lists not being fully searched and results in dependency errors.

An exmaple of this was the autobuilder building linux-yocto from
sstate but then rebuilding some of the recipe's tasks for no
apparent reason. Separating the logic into two variables solves this
problem since any "found = True" value is now always preserved.

(Bitbake rev: 61017fc5d30b7a13308d038872ec92efc1a84cef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-23 23:40:06 +00:00
Richard Purdie 54217ee467 runqueue.py: Ensure setscene tasks don't break dependency order
If A depends upon B which depends upon C and the setscene for B
succeeds but C is going to get rebuilt, we should wait for C to
try and build A but currently we don't.

This is due to the timing of when we run the task_skip() as this
triggers other tasks to become buildable. This patch moves the timing
of that call to a more appropriate place allowing dependencies to
behave as expected.

(Bitbake rev: b7114d8e5d9b0720339bd5d24d243c0f2a7c1f3b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-23 12:45:30 +00:00
Richard Purdie d43175e747 bitbake/runqueue.py: Add BB_SETSCENE_VERIFY_FUNCTION hook
The OE metadata has cases where it needs to prevent some setscene
functions from running. An example of this is where we know a task
is going to run do_configure (which would clean out do_populate_sysroot)
and hence we don't want do_populate_sysroot_setscene to run.

This change adds in a hook so that the metadata can allow any
such policy decision to filter back up to bitbake.

It removes the existing code which attempted to do this in a generic
way but failed.

(Bitbake rev: 2f6d987d9957a5d713ce119c24c2e87540611f53)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-22 13:07:07 +00:00
Richard Purdie 9320b76a97 bitbake/runqueue.py: Sort the list of skipped tasks as it makes searching the list easier when debugging
(From Poky rev: 5de8a495fba657e1febc616bbc737a8136cc88f9)

(Bitbake rev: 110f6cccbcc5907e15262c05d5c47da101e1a47d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-21 16:55:11 +00:00
Richard Purdie 14fbf3eab4 bitbake/runqueue.py: Fix incorrect task number reference in debug message
(From Poky rev: 45887bbd5479041be05b914668f14de6ec9b9831)

(Bitbake rev: dc4439ca8c7db7ceee78bd0552f65ceddcff17a7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-21 16:55:11 +00:00
Paul Eggleton 97a40ff05e lib/bb/runqueue: avoid marking runtime dependencies as covered
The code which populates setscene_covered list was adding a task to the
covered list if all of the tasks that depend upon it were also covered;
however, this means that tasks that would have installed "runtime"
dependencies were being marked as covered also, e.g. gmp-native and
mpfr-native are needed by gcc-cross at runtime since they are shared
libraries that gcc links to, but their do_populate_sysroot tasks were
being marked as covered, resulting in failures later on if gcc-cross was
available from sstate but mpfr-native and gmp-native weren't.

Since we currently have no real way to handle runtime dependencies for
native packages, add a workaround which avoids marking tasks as covered
if one or more of their revdeps are from a different recipe.

Fixes [YOCTO #1536].

(Bitbake rev: e492eb4dc9016cd0bed194377c6f2b85cf0ad113)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-15 12:05:24 +00:00
Richard Purdie 12c6bcbf49 Add FAKEROOTNOENV variable
Add a FAKEROOTNOENV which does the opposite of the FAKEROOTENV variable
and is data loaded into the environment for tasks without the fakeroot
flag.

The intent here is to provide a way to control the environment when we
aren't needing fakeroot context which allows us to unload the preload
from memory entirely and gain a valuable speedup.

I'm not 100% happy with needing this at the bitbake level, particularly
with the cache hit but it does give a valuable speedup.

(Bitbake rev: 05c29ab0b2ad3c521414cabb6a92bca15c6e919c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:11 +00:00
Richard Purdie 20dbf00243 runqueue.py: Ensure fakeroot variables are reflected in the datastore
Without this, variables can be set to one thing in one part of the environment and something
different in another part. This change ensures the datastore and the environment
are consistent.

(Bitbake rev: 459addf13721a6847406f215650fa1882fb83ea9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-09 19:08:54 +01:00
Richard Purdie fa071627ad runqueue: Ensure task environment is correct
This fixes two problems:

a) Variables which were in the parent environment but not set as "export"
   variables in the datastore could end up in the task environment

b) oe.environ.update() can't cope with the generator returned by
   bb.data.exported_vars()

Whilst the updated code isn't as neat, it does do the expected thing,
sets the environment correctly and stops unwanted values leaking into
the task environment.

(Bitbake rev: 67e5e23034c5ec2b9efcca935242830306c0048d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-09 18:39:25 +01:00
Richard Purdie a21ff559e7 Fixup remaining bb.msg.domain users
(Bitbake rev: d5abdacaf9ac604ef8d8c1bafb9b30617827cb4f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-15 17:31:52 +01:00
Robert Yang 671e580111 bitbake: Add task specific stamp file support
This patch, based on proof of concept code from Richard adds code to
bitbake to allow individual tasks to optionally specify their stamp
file using the stamp-base flag. This takes the same form as the STAMP
variable but can be specified on a per task basis.

Code is also added to runqueue to ensure that if two tasks share the
same stamp file, only one will be executed at once.

A significant usecase for this code is to share source code (${S})
between recipes where separate build directories (${B}) are used.

(Bitbake rev: 41bef02bef8379590ba012319aebe05068a8081e)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-28 13:44:38 +01:00
Mark Hatle a1f79a7896 runqueue.py: Add umask task control
The umask for a task can now be set as:

task[umask] = 022
task[umask] = '022'

If specified as a text string, it must be octal.  (This is due to
recipe parsing where it's always set to a string.)

[RP tweaked to use None instead of -1]
(Bitbake rev: a5caaaaba8f0db1af5d8f2e610021d6d4b56894e)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-24 12:23:12 +01:00
Scott Garman 62d538fbe6 make exception handling syntax consistent
Update exception handling syntax to use the modern style:
except ExcType as localvar

(Bitbake rev: dbf5f42b06bef81749b13aa99945cc1292a6676d)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-15 11:13:13 +01:00
Richard Purdie c7f76a1bc9 bitbake/data/runqueue: Sync up with upstream to clean up environment variable handling
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 20:38:28 +01:00
Richard Purdie fe967227dd runqueue.py: Wrap parsing with exception trapping
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 20:38:28 +01:00
Richard Purdie 355338c40c bitbake/cooker.py: Misc sync with upstream
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 20:38:27 +01:00
Richard Purdie 24f8f691cf bitbake/runqueue.py: Move BB_WORKERCONTEXT to a place where anonymous python can see it
Signed-off-by: Richard  Purdie <richard.purdie@linuxfoundation.org>
2011-05-31 09:01:59 +01:00
Richard Purdie c373727bd0 bitbake/runqueue.py: Ensure existing setscene stamp files are taken into account
JaMa reported issues where bitbake would rebuild things instead of using the
existing built tasks. This was tracked to a case where:

a) rm_work is uses
b) A depends on B
c) B has a version change (e.g. PR bump)

and A *and* B would then rebuild.

It turns out that rm_work was correctly turning stamp files into the correct
_setscene varients but bitbake was then ignoring them during setscene processing.
If the correct sstate checksumed files didn't exist, everything would seemingly
rebuild.

The fix is to check for existing *_setscene stamps and if present, honour them.
If "basichash" is enabled, the hash is included with the stamps so everything
should then function as intended.

(Bitbake rev: 0a4d857aabc86b973170ba9ce32b6b449a4e2165)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-27 17:55:51 +01:00
Richard Purdie 8b32d40896 bitbake/runqueue.py: Remove old log file handling remnants
These lines date from earlier code and are no longer required.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-05 15:52:24 +01:00
Richard Purdie 2b70d0cdd1 bitbake/runqueue.py: Ensure fakeroot env variables make it to the child process
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-31 17:21:44 +01:00
Chris Larson c564fb0909 runqueue: simplify fakeroot environment handling
(Bitbake rev: 88f0d1db88bdba95e488fba34f40dc0b72a85c33)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-31 12:26:40 +01:00
Chris Larson 67fac77e10 Fix more incorrect usages of 'is'
(Bitbake rev: a26a2f548419af0e971ad21ec0a29e5245fe307f)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-31 12:23:23 +01:00
Paul Eggleton b4268c08c3 bitbake/runqueue: fix clash when setscene & real tasks done in same build
If a build causes a real task to be run when the setscene task has already
run then it was possible for dependent packages to be rebuilding at the same
time as a rebuild of the packages they depended on, resulting in failures
when files were missing. This change looks in the setscene covered list and
removes anything where a dependency of the real task is going to be run (e.g.
do_install is going to be run even though the setscene equivalent of
do_populate_sysroot has already been run).

As an additional safeguard we also delete the stamp file for the setscene
task under these circumstances.

Fixes [YOCTO #792]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2011-03-29 14:01:56 +01:00
Richard Purdie e41671ea1d Revert "bitbake/gcc: Enable a shared common source tree"
This reverts commit 12b163dbd8 as it
was an unintended change for master
2011-03-29 00:34:11 +01:00
Richard Purdie 12b163dbd8 bitbake/gcc: Enable a shared common source tree
This patch is a quick proof of concept to show how source code could
be shared between recipes which use ${B} to have a separate build
directory compared to source directory ${S}.

Issues:

a) gcc uses sed and creates config files against ${S} which means
the directory should not be shared. Need to change the way that works.

b) Could be extended to cover eglibc except there is a patch applied
against nativesdk versions which again makes the source incompatible.

c) Need to clean up the layout in work-shared and make a directory level deeper
to ensure patch separation.

d) clean task does not remove stamps

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-28 15:09:50 +01:00
Paul Eggleton 9d9c68e353 bitbake/runqueue: show correct task name for setscene task failure
If a setscene task failed previously it was showing an incorrect task
name in the error line. This patch ensures we show the correct name, also
including the "_setscene" suffix.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2011-03-15 13:18:47 +00:00
Richard Purdie 1b08a7eb8b bitbake/cache/runqueue.py: Move workload for recipe parsing to the child process
Parsing the recipe in the parent before forking off the child worker
can mean the parent doesn't hit the idle loop and becomes a bottleneck
when lauching many short lived processes.

The reason we need this in the parent is to figure out the fakeroot
environmental options. To address this, add the fakeroot variables
to the cache and move recipe loadData into the child task.

For a poky-image-sato build this results in about a 2 minute speedup
(1.8%).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-28 20:48:08 +00:00
Richard Purdie 4b6de47e73 bitbake/runqueue: Drop PATH override. This was needed for the exec() change but not now we use fork()
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-21 17:26:18 +00:00
Chris Larson 5f73918d99 runqueue: simplify RunQueueStats.copy
(Bitbake rev: 778571f155139fcf43d0e30e875c39d6592ae03f)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-21 13:48:52 +00:00
Chris Larson 0f42f6b640 runqueue: pass a copy of the RunQueueStats to events
This avoids cases where the stats are modified after the event is fired but
before it's dispatched to the UI.

(Bitbake rev: 1954f182687a0bd429175dda87f05d8a94bb403a)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-21 13:48:39 +00:00
Richard Purdie 359a4d8bf7 bitbake/runqueue.py: Move SIGCHLD handler to wrap none server sleep call
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-18 11:54:28 +00:00
Richard Purdie 7e4c694c9f bitbake/runqueue.py: Ensure child has the default SIGCHLD handler restored
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-16 12:33:40 +00:00
Richard Purdie 974ea1a190 bitbake/runqueue: When we successfully fork off a task and there are more processes we can start do so immediately
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-15 23:20:54 +00:00
Richard Purdie 5a178b547b bitbake/runqueue: When we have successfully collected a pid value return True to ensure we don't sleep in the main loop
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-15 23:20:20 +00:00
Richard Purdie 03d40a4a7b bitbake/runqueue: Add a SIGCHLD handler to ensure we wake from sleeps for SIGCHLD events
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-15 23:19:43 +00:00
Richard Purdie 06c6db7929 bitbake/runqueue.py: Avoid starvation of events to the server
The server UI was reading 1024 bytes, then sleeping for 0.25 seconds. Since
most new LogRecord events are larger than this it leads to a build up of data
which is only processed slowly, leading to a bottleneck and a slow down of
all bitbake processes.

Thanks to Dongxiao Xu <dongxiao.xu@intel.com> for the great work in debugging
this. A large value has been left in for the read() command just to ensure some
fairness amongst process handling if a task tries to log truly huge amounts of
data to the server, or goes crazy and ensures the main loop doesn't stall.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-28 10:21:41 +00:00
Dongxiao Xu 80cf3e405c bitbake: Introduce stamp-extra-info task flag into stamp filenames
For certain tasks, we need additional information in build stamp file
other than the task name and file name. stamp-extra-info is introduced as
a task flag which is appended to the stamp file name.

[Code simplifcations/tweaks from Richard]

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-18 12:50:04 +00:00
Richard Purdie 4b055ed937 runqueue.py: Renable check_stamp_fn() for now since we still fork for task execution (as per bitbake-upstream)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 22:36:23 +00:00
Richard Purdie 0b3d443fc1 bitbake/runqueue.py: Simplify hashdata storage since we're not using an external script for tasks anymore, in line with bitbake-upstream
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 22:32:46 +00:00
Richard Purdie 48e567bb47 bitbake/runqueue.py: Fix del_stamp calls and -f option to bitbake with the BasicHash siggen code
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 21:59:34 +00:00
Richard Purdie cd382f9546 runqueue.py: Drop unneeded import and improve quieterrors handling as per upstream bitbake
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:04 +00:00
Richard Purdie 2c2d160c88 bitbake: Update event queue handling to match upstream bitbake
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:04 +00:00
Richard Purdie 9336ba1fd2 bitbake/runqueue.py: Sync with changes in upstream bitbake
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:04 +00:00
Richard Purdie 5c69fab405 bitbake/runqueue.py: Remove duplicate TaskStarted event fire()
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07 16:23:29 +00:00
Richard Purdie df8569b4d8 bitbake/runqueue.py: Fix a bug where do_setscene dependencies would be ignored
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 19:48:47 +00:00
Richard Purdie 66c6200ff3 bitbake build/siggen/runqueue: Fix stampfile parameters
The current parameters are not useful to the stampfile generator function
as they can't uniquely define a task. This updated things so the
parameters can identify unique tasks.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 19:47:03 +00:00
Richard Purdie 0090a798eb bitbake: Sync a load of whitespace and other non-functionality changes with bitbake uptream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:54 +00:00
Bernhard Reutner-Fischer 1949d4f5e8 runqueue: fix typo in documentation of calculate_task_weights
(Bitbake rev: 5cde120003af97a5cf5c6eff2a02bb1480f9414b)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:53 +00:00
Bernhard Reutner-Fischer 4d4d1355d0 runqueue: use fewer newlines in error path
(Bitbake rev: 7498466f0e42beea6f5f411209a892b636c7783c)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:53 +00:00
Chris Larson 4a6d4d258c logger usage cleanup
(Bitbake rev: 976e4f84a8147ad762442df7ff4820611a21d227)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:53 +00:00
Chris Larson 93e20c51c4 Use os.devnull, not /dev/null
(Bitbake rev: ce5ab0fc524a1c2c48c4c39d6fc8aae23019207b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:52 +00:00
Richard Purdie 2b7c2a8420 bitbake: Transfer noexec runqueue messages to the UI
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:49 +00:00
Chris Larson fcba92f354 Move the runq task start/failed messages to the UI
(Bitbake rev: ab831e867f09b47001cb8da2f8f060e04febf237)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:49 +00:00
Chris Larson 739bb5a2d1 cooker: stop loading the cache for -b
Previously, the cache was actually being loaded from disk twice whenever using
-b or -e -b.  This also moves the bb_cache instance into the CookerParser, as
it's not needed by the cooker itself at all.

(Bitbake rev: dd0ec2f7b18e2a9ab06c499b775670516bd06ac8)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:43 +00:00
Bob Foerster c6328564de Prefer xrange over range for small performance gain.
range() allocates an actual list when called.  xrange() is just an iterator
and creates the next range item on demand.  This provides a slight
performance increase.

In python 3, range will do what xrange does currently, but the upgrade will
be handled by the 2to3 tool.

(Bitbake rev: 73b40f06444cb877a5960b2aa66abf7dacbd88f0)

Signed-off-by: Bob Foerster <robert@erafx.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:42 +00:00
Chris Larson 7afe34e2c2 Fix exit code display for task failure
Per the python documentation, os.waitpid returns the exitcode shifted up by 8
bits, and we weren't compensating, resulting in a display of 'failed with 256'
when a worker process exits with a code of 1.

(Bitbake rev: 90c2b6cb24dc9c82f0a9aa9d23f2d1ed2e6ff301)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:35 +00:00
Richard Purdie 7011ae3f78 FIXUP: runqueue bb.debug refs
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:35 +00:00
Chris Larson ecc68fa4fb Switch bitbake internals to use logging directly rather than bb.msg
We use a custom Logger subclass for our loggers

This logger provides:
- 'debug' method which accepts a debug level
- 'plain' method which bypasses log formatting
- 'verbose' method which is more detail than info, but less than debug

(Bitbake rev: 3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:33 +00:00
Chris Larson d3a45c7d41 Use logging in the knotty ui, and pass the log record across directly
This kills firing of Msg* events in favor of just passing along LogRecord
objects.  These objects hold more than just level and message, but can also
have exception information, so the UI can decide what to do with that.

As an aside, when using the 'none' server, this results in the log messages in
the server being displayed directly via the logging module and the UI's
handler, rather than going through the server's event queue.  As a result of
doing it this way, we have to override the event handlers of the base logger
when spawning a worker process, to ensure they log via events rather than
directly.

(Bitbake rev: c23c015cf8af1868faf293b19b80a5faf7e736a5)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:33 +00:00
Chris Larson ebe3850bee Split out 'find next buildable task' into a separate generator function
It needs to be a generator, so scheduler subclasses have the option to skip
buildable tasks and return a later one.

(Bitbake rev: a8c61e41bc6277222e4cde667ad0b24bd1597aa0)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:32 +00:00
Chris Larson 0d1034d2ea Let the RunQueueScheduler control the number of active tasks
(Bitbake rev: 1387423e747f59866fd1cb99a7d90605e668823f)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:32 +00:00
Chris Larson 384c5cc8ac Add the ability to use runqueue schedulers from the metadata
If you create a runqueue scheduler class in a python module, available in the
usual python search path, you can now make it available to bitbake via the
BB_SCHEDULERS variable, and the user can then select it as they select any
other scheduler.

Example usage:

    In a test.py I placed appropriately:

        import bb.runqueue

        class TestScheduler(bb.runqueue.RunQueueScheduler):
            name = "myscheduler"

    In local.conf, to make it available and select it:

        BB_SCHEDULERS = "test.TestScheduler"
        BB_SCHEDULER = "myscheduler"

(Bitbake rev: 4dd38d5cfb80f9bb72bc41a629c3320b38f7314d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:32 +00:00
Chris Larson 36318110da Fix IndexError encountered when a 'depends' flag references a nonexistant task
(Bitbake rev: 4b0fd70539e73d99282fa89d47ad2d5f642ca4f4)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:36:54 +00:00
Chris Larson 96e7518472 When shutting down, send SIGTERM, not SIGINT
SIGINT should be from the user, not a script.  It also doesn't work as
reliably to shut down processes, as it's not always interpreted as a
termination request.  In addition, it causes KeyboardInterrupt exceptions in
the worker processes, which can interfere with our exception handling.

(Bitbake rev: e5f6e0e9de4c6d1dfdd269d2bf7f83c00c415a27)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-31 10:34:08 +00:00
Kevin Tian 05963b0a1b runqueue.py: set BB_TASKHASH approriately after moving to fork()
In previous exec() model, cooker is re-initialized from scratch with environmental
variable exported accordingly. Now in fork() model, environmental variables are
not exported again, and thus original method to export BB_TASKHASH doesn't apply
now which breaks all sstate packages. Now we can set data variable directly instead.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2010-12-21 08:48:17 +00:00
Richard Purdie 52aada2eaf bitbake/runqueue.py: Somehow the python environment mapping is failing so do it manually
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-21 00:51:24 +00:00
Richard Purdie 1f3e313fd5 bitbake Revert bitbake exec() and go back to fork() for performace wins (first draft)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-17 18:25:06 +00:00
Richard Purdie a86f960f65 bitbake/runqueue: Revert previous setscene noexec changes and ensure setscene stamp exists for setscene noexec tasks
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-17 10:47:02 +00:00
Richard Purdie 56ef2a01be bitbake/runqueue: Clean up message log levels
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-17 10:47:02 +00:00
Richard Purdie ace52b0da3 bitbake/runqueue.py: We should just failoutright in scenequeue for noexec tasks, not skip them so stamps are created
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-16 15:14:13 +00:00
Kevin Tian bb783afd4d runqueue.py: use correct task ID when checking validity of setscene tasks
sstate hash validation is done at initialization of RunQueueExecuteScenequeue.
However the index of 'valid' list returned from the validation doesn't
correspond to setscene task ID. It's just an intermediate namespace between
runqueue and sstate hash func. Use it as setscene task ID fully mess the flow.
Previously this doesn't cause trouble because all setscene tasks are passed. Commit
58396a5d24 add 'noexec' concept to setscene
tasks which grabs some tasks out of the list and thus trigger this problem

Without this fix there're ~50 recipes (gzip-native, glib, ...) rebuilt weirdly
with a minimal build, even though existing sstate packages could accelerate them.

there's another typo using wrong task ID in a debug message which further hide
this issue

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2010-12-14 22:40:16 +00:00
Richard Purdie 0ba9a9fffe bitbake: Overhaul environment handling
Currently, anything whitelisted in the environment makes it into the worker
processes. This is undesireable and the worker environment should be as
clean as possible. This patch adapts bitbake sosme variables are loaded into
bitbake's datastore but not exported by default. Any variable can be exported
by setting its export flag.

Currently, this code only finalises the environment in he worker as doing so
in the server means variables are unavailable in the worker. If we switch
back to fork() calls instead of exec() this code will need revisting.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-09 13:16:14 +00:00
Richard Purdie 58396a5d24 bitbake/runqueue: Teach scenequeue about noexec tasks (since they don't do anything we can assume they're always successful
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-28 13:54:32 -08:00
Richard Purdie a39f335f59 bitbake/runqueue.py: Fix stamp handling for noexec tasks
This means the noexec messages are only shown once as the stamp files are now
correctly created.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-28 12:10:17 +00:00
Richard Purdie 5ae5a145dd bitbake.runqueue.py: Fix no exec task handling to correct counter housekeeping
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-07 20:33:12 +00:00
Richard Purdie b80a8d28f8 bitbake: Add support for 'noexec' tasks
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-06 14:33:05 +00:00
Richard Purdie a59935fb3a bitbake/siggen: Allow siggen code to control final stampfile format
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-06 12:20:33 +00:00
Richard Purdie 36f1ae42fe pseudo/fakeroot: Move the pseudo directory creation into bitbake
If sstate was used to accelerate a build, the pseudo directory might not have
been created leading to subsequent task failures.

Also, sstate packages were not being installed under pseudo context meaning
file permissions could have been lost.

Fix these problems by creating a FAKEROOTDIRS variable which bitbake ensures
exists before running tasks and running the appropriate setscene tasks under
fakeroot context.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-22 13:00:40 +01:00
Richard Purdie 229b6630af bitbake-runtask: Ensure logging settings take effect in the worker process (and pass verbose setting)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-14 20:07:15 +01:00
Joshua Lock 812f8835d2 bitbake/runqueue: make the runtask program configurable
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-10-12 13:32:27 +01:00
Richard Purdie ff539b11ac bitbake-runtask: Ensure logging options are inherited from the parent
[BUGID #291]

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-11 12:52:57 +01:00
Richard Purdie bee7c21f6e bitbake/runqueue.py: Fix invalid variable reference fixing the -f option with setscene tasks
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-07 15:45:02 +01:00
Richard Purdie 35d095c282 bitbake/sstate: Implement a lookup function to speed up setscene processing
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-05 22:26:33 +01:00
Richard Purdie ec4d6b989a bitbake: Pass task hash information to subprocesses
Pass task has informaiton to work processes, allowing full manipulation of
the hash data in the task context allowing checksums to be usable.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-28 15:34:27 +01:00
Richard Purdie fe0f86e15c bitbake/runqueue: Remove now unneeded indentation
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-13 21:00:10 +01:00
Richard Purdie 474c2a2817 bitbake/runqueue.py: Optimise delay values to avoid unneeded delays
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-13 16:57:13 +01:00
Joshua Lock 3e7db72216 bitbake: save the initial PATH for use when starting a subprocess
It was possible for bitbake-runtime to be run against a semi-installed
python-native resulting in tracebacks with ImportError's.

To prevent this we stash the initial PATH in the BBConfiguration when bitbake
is started and then set this in the env when launching bitbake-runtask through
subprocesses Popen() call.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-09-08 19:22:37 +01:00
Richard Purdie 43595fabbe bitbake: Implement signatures
Includes functionality to find out what changes between two different singature data dumps.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-03 16:08:32 +01:00
Richard Purdie 53ff069611 bitbake/runqueue.py: Ensure rqexe always exists and that empty task lists cause a graceful exit
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-25 00:59:13 +01:00
Richard Purdie 616e75523b bitbake: Correctly route events from the worker to the server
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-20 12:26:19 +01:00
Richard Purdie 4a8fe7fc99 bitbake/runqueue.py: Ensure the flush happens as late as possible to avoid data mixups
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 23:39:19 +01:00
Richard Purdie 6739a629e9 bitbake/runqueue.py: Fix runqueue UI issues
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 22:36:26 +01:00
Richard Purdie b6bfe14205 bitbake: Switch to use subprocess for forking tasks and FAKEROOTENV to run shell and python under a fakeroot environment
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 22:36:25 +01:00
Richard Purdie 787c1cf811 bitbake: Initial scenequeue implementation (needs major fixes)
bitbake: scenequeue: Skip setscene if the underlying task already ran
bitbake/setscene: Make sure uneeded dependencies are removed recursively

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 20:06:25 +01:00
Richard Purdie 3ce480de27 bitbake/runqueue.py: Factor task skipping code into a function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 11:41:44 +01:00
Richard Purdie 65b068a5f8 bitbake/runqueue.py: Create RunQueueExecute and RunQueueExecuteTasks classes, further splitting up runqueue
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 11:41:44 +01:00
Richard Purdie 96ec9f8a60 bitbake/cooker.py: Allow idle handlers to pass through a true value
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 11:41:44 +01:00
Richard Purdie 1db9ee5e8d bitbake/runqueue.py: Drop duplicated class
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-19 11:39:59 +01:00
Richard Purdie 5d9f37873d bitbake: Split Runqueue into two classes, a data processor and the execution part
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-18 11:49:58 +01:00
Bernhard Reutner-Fischer 0e3fc6dff2 *: cosmetic whitespace removal
(Bitbake rev: 2ed36a3d57de25e1af31d657a7b0b14857e5056a)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-03 14:06:40 +01:00
Chris Larson e6b6767369 Let the runqueue find the user selected scheduler dynamically
Searches the module (bb.runqueue) for any new style classes which are
instances of RunQueueScheduler, and uses the one whose 'name' attribute
matches the value of BB_SCHEDULER.

(Bitbake rev: 6497cedf9cfc03201250af816995dd2bd85c36ef)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-03 14:03:41 +01:00
Richard Purdie 63e6ba8567 bitbake: Add support for .bbappend files (see mailing lists for detais)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 15:10:40 +01:00
Richard Purdie 6598f98ba8 bitbake: runqueue: Allow passing of success/failure handlers to runqueue_process_waitpid()
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 12:31:20 +01:00
Richard Purdie 8c23850453 bitbake: runqueue: Allow taskname to be passed to check_stamp_task()
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 12:31:20 +01:00
Richard Purdie 009343b2a2 bitbake: runqueue: Make child process error scary so user is less likely to ignore
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 12:31:20 +01:00
Richard Purdie 2d263840b0 bitbake: runqueue: Fix number of running tasks accounting (include failed tasks)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 12:31:20 +01:00
Richard Purdie 3cd042f505 bitbake: runqueue: Remove unneeded exception catching from fork_off_task()
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 12:31:19 +01:00
Richard Purdie 5c44f9a78d bitbake: runqueue: Separate out task forking code into a new function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 12:31:19 +01:00
Richard Purdie 8a5b5080a2 bitbake: runqueue: Combine the waitpid result handling code into a function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 12:31:19 +01:00
Richard Purdie 90db9f3074 bitbake: Remove two layers of unnecessary functions from task execution
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 12:31:19 +01:00
Chris Larson ef1de9ecaf Apply some 2to3 refactorings
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:37 +01:00
Chris Larson 88a257634a Show a traceback when a task fails due to an exception
(Bitbake rev: 5bb24832761bd518cb0249125f67939e0cbd0998)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:36 +01:00
Chris Larson 4fac507dfb Don't tell the user we're sending SIGINT to the remaining 0 tasks
(Bitbake rev: 0b963e52eca0447d5bbfc87d826ad662fe940381)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:35 +01:00
Chris Larson 1180bab54e Apply some 2to3 transforms that don't cause issues in 2.6
(Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00