Commit Graph

94 Commits

Author SHA1 Message Date
Joshua Lock e58b3a4804 bitbake/bitbake-layers: fix to run with recent changes
This patch marks the bitbake-layers script as executable and fixes the
instantiation of the BBCooker to match recent changes in the BitBake
libraries.

I've also added a brief header which demonstrates the intent and usage
as taken from Chris Larson's original commit message.

Note: this fix is not upstreamable, it's only required in Poky because of an
outstanding difference between BitBake master and Poky's BitBake.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2011-03-14 20:48:27 +00:00
Chris Larson 05d1ac23aa bitbake-layers: drop 2.6 from #!, per Joshua Lock
(Bitbake rev: 898f557cbd443cdeff137fd926aac06f2aaee6c4)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-03 22:51:35 +00:00
Khem Raj 54e10127c4 fetch, fetch2: Get rid of DeprecationWarning notice
* This patch fixes a cosmetic issue currently we get with master

WARNING: /home/kraj/work/bitbake/lib/bb/fetch2/__init__.py:733:
DeprecationWarning: Call to deprecated function bb.mkdirhier: Please use bb.utils.mkdirhier instead.  bb.mkdirhier("%s/%s" % (rootdir, destdir))

(Bitbake rev: 36fe59ce314c295d239b76de34c8714def2c32d5)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-03 22:51:33 +00:00
Chris Larson afdbb02693 bitbake-layers: fix bug with env vars leaking in
I forgot that bin/bitbake is what does the environment filtering based upon
BB_ENV_WHITELIST, etc.

(Bitbake rev: 2cc6b6951bd17832866ec710029d119d2df31ba4)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:34:24 +00:00
Chris Larson 68bd406962 Add initial bitbake-layers script
This script has subcommands which operate against your bitbake layers, either
displaying useful information, or acting against them.  Currently, it only
provides a show_appends command, which shows you what bbappends are in effect,
and warns you if you have appends which are not being utilized.

Currently, a bug exists when using this due to the DataContext stuff, but I'm
not certain as to the root cause, it appears to be the bb package relying
implicitly on the way the bitbake script does things.  A fix for that issue
will be forthcoming, as will further subcommands.

(Bitbake rev: 78b6d4cb26cec3321f8eec9889205a6b93b2ee18)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:33:43 +00:00
Richard Purdie 296866c38e image-swab: Convert to attach strace to the process to obtain the required swabber data
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 11:51:48 +00:00
Bob Foerster 2e0ef25a50 Resurrect alternative UIs
The various alternative UIs have been updated to once again be functional
with the latest bitbake internals.  Each of the UIs still have much room for
functional improvement.

In particular, they have been updated to:
 - interact with the new process based server
 - handle the current set of events and notifications fired from the server
   and its associated subsystems

(Bitbake rev: b947e7aa405966262c0614cae02e7978ec637095)

Signed-off-by: Bob Foerster <robert@erafx.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-05 11:13:48 +00:00
Chris Larson 9260c08e1d Ensure that the invalid UI error goes to stderr
(Bitbake rev: 76aeea2c23a518046d0b26f1a6fc43287a180a9d)

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 23735bb765 Silence python 2.7 nested context manager warning
(Bitbake rev: 1c38f19fb8da2e6c55394162d0142e7146387e54)

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 3d3af810fa Kill the uncaught exception handler
We now wrap the main() in a try/except, ensuring that both the main portion of
bin/bitbake and the UI raising an exception will be shown to the user.  For
the server and workers, we can ensure in the server itself that exceptions are
handled correctly.

(Bitbake rev: 240d4a7ae80a6636c302ae84266ddfed7a7fcedd)

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 c8d2dad049 Rename the ui 'init' method to 'main'
As these may run the UI in a blocking fashion and then return the exit code,
'init' was an inappropriate name, and 'main' is more appropriate.

(Bitbake rev: 4d081a0ed759bd526ab01849d650bd9e8d80ddd1)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:47 +00:00
Chris Larson 1e3b83f96b Error more pleasantly when trying to use python2.4
(Bitbake rev: 57402ee727c8c1d8f5017534fb0f5e0b20aaaa5b)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:46 +00:00
Chris Larson 7481c11e34 Don't show a traceback for a python version error
(Bitbake rev: 44c325306e55336b7b416fd88b39874012a3f603)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:46 +00:00
Chris Larson 6810622484 Use __file__, not sys.argv[0]
(Bitbake rev: 97e92abe49663eee189c89c1dc91fe69891faf73)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:45 +00:00
Chris Larson 0533a8465b Don't show uncaught exception message for KeyboardInterrupt
(Bitbake rev: 29634acd262b06fd14f6ef1e134346f274cf448f)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:34 +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 4855548ffb Use the python logging module under the hood for bb.msg
(Bitbake rev: 47ca82397bc395b598c6b68b24cdee9e0d8a76d8)

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 5c50d43cfa Ignore python warnings that come from places we don't care about
Only shows warnings that come from bb, oe, or <string>

(Bitbake rev: 57018687f60b222ab220dd904c4bf870780171e9)

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 151c4a7a33 Drop the 'ui failed to start' message, as the ui_init does more in knotty
(Bitbake rev: 39087138ffd5d427f07ecaa580a40885c5ffaff3)

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
Richard Purdie c47cfc56c7 bitbake/bitbake-runtask: Since the parent has set the environment up cleanly we don't need to filter this ourselves anymore
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-10 12:40:23 +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
Joshua Lock 9545130576 bitbake-runtask-strace: simple shell script to wrap tasks in a strace call
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-11-14 21:08:27 -08:00
Richard Purdie 05ba6fc7cb bitbake: Rewrite profiling code so its functional for both none and xmlrpc backends
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-13 21:23:54 +08: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
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 1d52fa5269 bitbake/bitbake-sigdiff: Extend to handle dumping single state siginfo files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-30 18:02:35 +01:00
Richard Purdie 624924bdcd bitbake/bitbake-runtask: Signatures are needed in task context and have little overhead so enable in worker context
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-29 12:12:26 +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 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
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 7b580b488c bitbake/bitbake-runtask: Ensure signals to the parent don't pass to the children directly
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-07 23:54:15 +01:00
Richard Purdie 8d764de25f bitbake: Add missing signature files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-03 16:11:45 +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 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
Bernhard Reutner-Fischer c4fde248b1 *: use print() as a function
to make python3 happy

(Bitbake rev: c82926ccdd4ec4e3ad6e78a381dacb96adf9b409)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-16 15:10:40 +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 b9f8af16f4 Until the interactive mode is fixed, kill it from the valid options, to avoid confusion
(Bitbake rev: 65a51bb20677148a29b9e472f6d9d0a97798f024)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:37 +01:00
Chris Larson 526837e1c1 Move serverConnection.terminate() back into the finally
(Bitbake rev: 58e1b0a5dbd0f1ca137ad7ed1bd7ad9975a20fb7)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:37 +01:00
Chris Larson 2f0a485bd4 Limit the traceback length in the default exception handler
(Bitbake rev: 2b9dc5b55e24b4946ff03bf30ca52a48547caaad)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:37 +01:00
Chris Larson ce42c24d70 Resurrect the excepthook, this time just sending the info with bb.fatal
(Bitbake rev: 07757a1bf1129cc6a967a7cf1815d3d46a6bbdcf)

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
Cliff Brake 6c338660e8 remove return in finally statement
causes exceptions to not be handled after the finally statement

(Bitbake rev: 1a04610dea376340b9ea4c109f64995b4fd6ad02)

Signed-off-by: Cliff Brake <cbrake@bec-systems.com>
Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:36 +01:00
Chris Larson 77a6052e39 Drop the non-debug traceback suppressor, at this point I think it does more harm than good
(Bitbake rev: 2c66ddc2713061ba31363ea69c24944f4a7cd3a8)

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 75d49840cf Reorganize the main exception handling so an attribute exception raised in the ui isn't misinterpreted
(Bitbake rev: 49b8bab706c59e93287f8540187b62ba3ece0a11)

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 0405011734 Adjust the exception handling based on Cliff Brake's patch
Rather than printing the exception ourselves, might as well re-raise and let
the default exception handler do it for us.

(Bitbake rev: acca7eb8450cbe30d65b5b266f1a642e7965df8a)

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 6f52061844 Fix the debug level check in print_exception
(Bitbake rev: 9cb52edf9198fe6db735abbb61d0c4026c97a8d9)

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 214d1f7433 Move the python version check into the python package
This ensures the check is run for anyone using the package, including
setup.py, though it's sad that it's necessary, since all it really wants is
__version__.

Ideally, we'd avoid the version check entirely in favor of checking for
functionality, but that's rather difficult with language constructs like
context managers, so this'll do for now.

(Bitbake rev: f936f1c0edf70860ea0f39ec1a500ba43b56f289)

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 231d3a534c Drop an unnecessary second python version check and use the less ugly sys.version_info
(Bitbake rev: 8f4b7b10f8740a41c085beeca5105f15204b0979)

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 bdbeaf4760 Bump version to 1.11.0
(Bitbake rev: 6c89c332664a7789d02a701e7e530838ab778264)

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