Commit Graph

117 Commits

Author SHA1 Message Date
Richard Purdie 72b452ecf2 bitbake/build.py: Allow FuncFailed error to have an optional message
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-17 23:54:28 +00:00
Richard Purdie 0388f0758f bitbake/build.py: Rename message field to avoid DeprecationWarning: BaseException.message warning
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-17 15:52:06 +00:00
Bernhard Reutner-Fischer bff1d2ba06 build: remove duplicate import of utils
(Bitbake rev: 86c6434f093ce5e55d1febfb424a8e595ffc2d17)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12 13:47:18 +00:00
Bernhard Reutner-Fischer 2ef204dcdd *: use utils.remove() some more
(Bitbake rev: d3489b141cac1197324661680fe38b8a88bc49b4)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12 13:47:14 +00:00
Richard Purdie 5da9747024 bitbake/build.py: Fix del_stamp work correctly after recent stamp function changes
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-07 14:03:27 +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 ec6e4793dc bitbake build.py: Stamp handling improvements
* Move stamp file deletion out of the internal stamp helper function
* Add a new function to return the path to a stamp for a given task

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 19:43:56 +00:00
Richard Purdie 4a10a5b438 bitbake build.py: Use localdata for stamp handling, not d
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 19:40:41 +00:00
Richard Purdie 51a2e8712a bitbake/build.py: Ditch the extract_stamp function as its just going to complicate improving the stamp handling functions
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 15:41:39 +00:00
Chris Larson e7febaa343 build: use logger.isEnabledFor, not getEffectiveLevel
I think this is less confusing, and avoids needing to know about the *range*
of logging levels, instead simply asking what we really want to know.

(Bitbake rev: dc2264387617586b5c0a61e126c75edde5e7abcd)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-06 10:46:54 +00:00
Richard Purdie 6ded4e0ae7 bitbake: build.py: Logging of None was losing the logs so force this to stdout so we can see function execution failures
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-05 18:57:07 +00:00
Richard Purdie 0f70631544 bitbake: Misc syncups with bitbake upstream, mostly whitespace and a missed line from the last UI commit
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-05 11:24:14 +00:00
Richard Purdie 25ac24e02e bitbake: build.py logging updates
python tasks calling shell functions using exec_func() would show the log
file as /dev/null. It makes most sense for all the task logging to be setup
centrally by exec_task(), at least with the current code base in Poky.

This commit will need discussion in relation to upstream bitbake and the
IO redirection could be better handled using a context manager (although
task contexts shouldn't ever nest).

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-05 00:58:24 +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
Chris Larson 7bbde5b149 build: fix FuncFailed for the no logfile case
(Bitbake rev: 3a4b5eb20e41bd3cecd9d7e8dff7d076d8a7bb9a)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:50 +00:00
Chris Larson 3d51fd2b7d build: ensure LogTee has a valid name property
(Bitbake rev: 0ebb46e25261cfc85aaef2790cba7c1ec057c306)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:50 +00:00
Chris Larson 6f80455777 build: fix -D with shell functions
(Bitbake rev: 1c8be64732fdf4f3a608c090b3dc92065d6058d6)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:48 +00:00
Chris Larson aaa55880ac build: send logging messages to the log file for python functions
(Bitbake rev: ee1cce6ab21ddda60a7a070d03e98ff8485a5e71)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:48 +00:00
Chris Larson e2363f3cdd build: use a contextmanager for locks
Also don't bother passing logfile to exec_func_python, at least until we start
adding the logfile as a file handler to the bitbake logger.

(Bitbake rev: f99ee4680c9f67b7ed13fc06044ba2382f9a782c)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:48 +00:00
Chris Larson b4eff9fcef build: use bb.process instead of os.system
(Bitbake rev: 53740977521bc81ffa37adfa7bbeb8f2a80ea165)

build: write logfiles per task, not per function
Based on d14f9bf6 from poky, reworked for master and other cleanup.

(Bitbake rev: beadff2eca1eb95f0411115dd72ddb4c3c44c604)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:48 +00:00
Chris Larson 666513982f Fix FuncFailed construction
(Bitbake rev: 085e66f9c14123ea2c0f1e34f7737cf77071f86d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:36 +00:00
Chris Larson 136a631b2e Restore FuncFailed argument compatibility
(Bitbake rev: c07cc08f7fd503ac3013ccc43c79198c4c3b7b29)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:36 +00:00
Chris Larson 311c9f5042 Only reference logfiles that exist
(Bitbake rev: 760f647ba044009150ee219869fc9dea171a7535)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:36 +00:00
Chris Larson c90bfa57f5 Fix bitbake -k issue introduced by build exception cleanup
A SystemExit from a python function wasn't being raised as a FuncFailed, which
resulted in it not being caught by the exception handlers in the runqueue for
the worker process, which resulted in a SystemExit exit, rather than os._exit,
which causes all manner of problems when used in a forked process.  This fixes
it by ensuring we raise a FuncFailed when seeing exceptions which aren't
instances of Exception.

(Bitbake rev: dafe92fe9f387450d9f9e9ff41c99388998b7495)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:36 +00:00
Chris Larson 9897d56861 Simplify build exception handling
- Drop EventException
- Use FuncFailed as the primary function failure exception, using TaskFailed
  for the event (leaving it up to the process running exec_{func,task} to
  display the more detailed information available in the exception).
- Switch InvalidTask to an exception rather than an event, as that's a
  critical issue.
- Reduce the number of messages shown to the user when a task fails -- they
  don't need to be told it fails 12 times.  Work remains in this area though.

(Bitbake rev: 06b742aae2b8013cbb269cc30554cff89e3a5667)

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
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
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 d14f9bf6c4 bitbake/build.py: Write logfiles on a per task basis, not per function
Per function logging made it hard to track down what was happening so
switch to logging on a per task basis.

[BUGID #383]

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-11 12:53:54 +01:00
Mark Hatle 8e429accb8 build.py: Add a symlink for the logging
[BUGID #375]

When configuring for the log file output, we generate a symlink to the
target filename.  This link uses the same file naming, but without the
active pid, making it easier to see which log file is the last one
generated.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-10-01 18:45:32 +01:00
Richard Purdie 89c7260931 bitbake/build.py: Set BB_FILENAME to represent the .bb file being built (including any virtual prefix)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-13 15:39:07 +01:00
Richard Purdie 332c33af18 bitbake/data.py: Add emit_func() and generate_dependencies() functions
These functions allow generation of dependency data between funcitons and
variables allowing moves to be made towards generating checksums and allowing
use of the dependency information in other parts of bitbake.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-31 12:47:41 +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 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 9ef9b5e1a7 bitbake/build.py: Note when calling functions that don't exist. Should probably error
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-12 14:44:07 +01:00
Richard Purdie dfd7e1f76b bitbake/build.py: Set the current taskname in the BB_CURRENTTASK variable
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-12 14:41:31 +01:00
Bernhard Reutner-Fischer 8105d4381f *: Fix typo in documentation
s/dictonary/dictionary/

(Bitbake rev: 0cc632761e75f66a8ce5ca2fe370f7551ccbfdf0)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-04 16:12:39 +01:00
Richard Purdie 0f516fe9a0 bitbake/build.py: Add support for pre and postfuncs for tasks
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-04 11:43:12 +01:00
Chris Larson 6be4fa575a Switch a fatal usage to SystemExit ("T" not set)
This failure is one the *user* needs to see, as it may have to do with their
setup, but where they don't need to see a traceback and all, since they're not
developers, so I think SystemExit is appropriate here.

(Bitbake rev: e3cc9bc7b6ef1a2eca78235790a051329bceb9a4)

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 562fd5f2a7 Drop unnecessarly duplicated messages wrt FuncFailed
(Bitbake rev: 9ec9c0e560d4fa6df74a90f598f9db92713525a2)

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 c3eae29efa Don't try to expand non-string values
(Bitbake rev: fe36a726b9f930bbd6fd758c0aee78559e95f02b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:34 +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
Chris Larson bcd9c57a96 Switch some references to moved functions
(Bitbake rev: ddea2978cb969cf1381cfee5c055de0c9e56a4e3)

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
Chris Larson 1c74fd768f Import fixups
(Bitbake rev: 4fa052f426e3205ebace713eaa22deddc0420e8a)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson 7acc132cac Formatting cleanups
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson 94b60d1247 Consolidate the exec/eval bits, switch anonfunc to better_exec, etc
The methodpool, ${@} expansions, anonymous python functions, event handlers
now all run with the same global context, ensuring a consistent environment
for them.  Added a bb.utils.better_eval function which does an eval() with the
same globals as better_exec.

(Bitbake rev: 424d7e267b009cc19b8503eadab782736d9597d0)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:31 +01:00
Joshua Lock 43f0d63237 bitbake: allow fakeroot functionality to be provided by an alternative program
If the variable FAKEROOT is set its value will be used, otherwise we default
to fakeroot.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-06-25 14:54:51 +01:00
Richard Purdie fdf134abfb bitbake/build.py: No need for this gross hack now
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-27 12:40:02 +00:00
Richard Purdie 22c29d8651 bitbake: Switch to bitbake-dev version (bitbake master upstream)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20 18:46:02 +00:00
Richard Purdie 1fd3265374 build.py: Fix zero size logfile problems
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:21 +00:00
Richard Purdie 44549775eb bitbake: Add bb and os to __builtins__, not the exec function global
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-10-13 08:38:13 +01:00
Richard Purdie d326382b5f bitbake/build.py: Remove zero sized log files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-09-24 18:57:09 +01:00
Richard Purdie 7b6f1b8aed build.py: Fix task override handling (breaks compatibility but it didn't work at all before)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4530 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-05-21 21:20:44 +00:00
Richard Purdie 167052a8c5 bitbake: build.py: Need to run expandKeys before launching tasks
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4467 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-05-13 11:45:48 +00:00
Richard Purdie ab191d21e2 bitbake: Update to bitbake 1.8 branch head
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3892 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-03-03 22:01:45 +00:00
Richard Purdie c0adbcbc1c bitbake: Add support for task specific lockfiles
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3232 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-11-25 14:25:59 +00:00
Richard Purdie e6fccbb463 bitbake: Sync with upstream, fix some typos, add selfstamp flag
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3227 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-11-25 13:54:43 +00:00
Richard Purdie 9c9fad5654 build.py: Add support for cleaning directories before a task in the form: do_taskname[cleandirs] = 'dir'
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2693 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-09-05 08:40:25 +00:00
Richard Purdie d8bfa5c6ef bitbake: Sync with 1.8.8 release
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2513 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-20 07:48:43 +00:00
Richard Purdie bfc70eb24e bitbake: Update along 1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2345 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-08-03 13:40:52 +00:00
Richard Purdie 119b1d5b09 build.py: Start to fix path quoting
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2125 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-07-06 12:42:16 +00:00
Richard Purdie bd0ca262c9 build.py: Sync with bitbake 1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1426 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-04-03 11:23:48 +00:00
Richard Purdie 7371e6323c bitbake: Update to 1.8.1 (inc. various bug fixes, epoch support)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1419 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-04-01 15:04:49 +00:00
Richard Purdie f5665d5bfc bitbake: Sync with upstream.
* File licence headers were sanitised causing most of the diff. 
 * cooker.py was created from bin/bitbake. 
 * cvs fetcher port option was added
 * The -f force option was fixed to work correctly
 * Multiple entries in rrecrdeps are now handled correctly
   (allows adding do_deploy to image depends)
 


git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1129 311d38ba-8fff-0310-9ca6-ca027cbcb966
2007-01-08 23:53:01 +00:00
Richard Purdie 306b7c7a97 bitbake: Upgrade from 1.4 -> 1.7.4ish
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@863 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-11-16 15:02:15 +00:00
Richard Purdie 27e6638adc bitbake build.py: Add interactive flag for tasks to allow i/o redirection to be disabled. Also fix NFS stamp error
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@681 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-08-30 21:26:07 +00:00
Richard Purdie b26a945734 Update to latest bitbake
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@309 311d38ba-8fff-0310-9ca6-ca027cbcb966
2006-03-20 17:45:11 +00:00
Richard Purdie f54da734eb Initial population
git-svn-id: https://svn.o-hand.com/repos/poky@2 311d38ba-8fff-0310-9ca6-ca027cbcb966
2005-08-31 10:47:56 +00:00