diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2015-05-20 20:01:02 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-26 10:33:06 +0100 |
commit | 5ee122244ad2413b71c526d6d4576ae5b2f4ca7a (patch) | |
tree | 6e1a371b9a56bdf77a53e16271f98918b56c61c6 /bitbake/bin | |
parent | 70c1d222c08ba5bdca416c6f1c2bcb0f15c93126 (diff) | |
download | poky-5ee122244ad2413b71c526d6d4576ae5b2f4ca7a.tar.gz |
bitbake: bitbake-worker: Fix regression with unbuffered logs
I noticed that I was seeing loss of the log files when hitting
control-c while debugging a function in bitbake. In fact if you
take a recipe and replace its compile function as shown below let
it run for a few seconds and hit control-c, you will see first
hand that log data is not there.
do_compile () {
while [ 1 ] ; do
echo -n "Output date: "
date
sleep 1
done
}
It turns out there was a regression introduced by commit:
d0f0e5d9e69 which created the bitbake worker. Since the bitbake
worker is started in its own process space, it needs the exact
same code added from commit: 88429f018b where the problem was
fixed the first time around.
(Bitbake rev: 8d1748f75763b4a66516cc46d5457ee6404b1b68)
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake-worker | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index 8a24161250..96a4d4cdec 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker | |||
@@ -24,6 +24,15 @@ if sys.argv[1] == "decafbadbad": | |||
24 | except: | 24 | except: |
25 | import profile | 25 | import profile |
26 | 26 | ||
27 | # Unbuffer stdout to avoid log truncation in the event | ||
28 | # of an unorderly exit as well as to provide timely | ||
29 | # updates to log files for use with tail | ||
30 | try: | ||
31 | if sys.stdout.name == '<stdout>': | ||
32 | sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) | ||
33 | except: | ||
34 | pass | ||
35 | |||
27 | logger = logging.getLogger("BitBake") | 36 | logger = logging.getLogger("BitBake") |
28 | 37 | ||
29 | try: | 38 | try: |