Commit Graph

158 Commits

Author SHA1 Message Date
Richard Purdie 94c8d01eba 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>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2012-05-31 13:16:41 -07:00
Richard Purdie e1e0dd932b 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>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2012-05-31 13:16:41 -07:00
Richard Purdie f38e44bbb2 runqueue.py: Fix debug message to reference the correct task
(Bitbake rev: 035c673c463ca450245acf824e7b7e8f889bdc89)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-30 16:16:12 +00:00
Richard Purdie 1a46002fad 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>
2012-01-30 16:16:12 +00:00
Richard Purdie 2747b2003e 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>
2012-01-30 16:16:12 +00:00
Richard Purdie 375297ea28 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>
2012-01-30 16:16:11 +00:00
Richard Purdie c2662a5095 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>
2012-01-30 16:16:11 +00:00
Paul Eggleton 6e1105e1e8 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>
2012-01-30 16:16: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