diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-20 12:25:19 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-20 12:26:19 +0100 |
commit | 616e75523b0b1bbe730631dba70224b55cfaaa57 (patch) | |
tree | 2fd396d58386217135976c1747ddfde94b84e9f8 /bitbake/lib | |
parent | 9708f9cba7923fa0b5a620e032ab3d9e085385a7 (diff) | |
download | poky-616e75523b0b1bbe730631dba70224b55cfaaa57.tar.gz |
bitbake: Correctly route events from the worker to the server
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/build.py | 8 | ||||
-rw-r--r-- | bitbake/lib/bb/event.py | 1 | ||||
-rw-r--r-- | bitbake/lib/bb/msg.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 2 |
4 files changed, 12 insertions, 3 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 77af92abee..f49b2836b6 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
@@ -152,6 +152,9 @@ def exec_func(func, d, dirs = None): | |||
152 | os.dup2(so.fileno(), oso[1]) | 152 | os.dup2(so.fileno(), oso[1]) |
153 | os.dup2(se.fileno(), ose[1]) | 153 | os.dup2(se.fileno(), ose[1]) |
154 | 154 | ||
155 | # Since we've remapped stdout and stderr, its safe for log messages to be printed there now | ||
156 | # exec_func can nest so we have to save state | ||
157 | origstdout = bb.event.useStdout | ||
155 | bb.event.useStdout = True | 158 | bb.event.useStdout = True |
156 | 159 | ||
157 | locks = [] | 160 | locks = [] |
@@ -179,7 +182,10 @@ def exec_func(func, d, dirs = None): | |||
179 | for lock in locks: | 182 | for lock in locks: |
180 | bb.utils.unlockfile(lock) | 183 | bb.utils.unlockfile(lock) |
181 | 184 | ||
182 | bb.event.useStdout = False | 185 | sys.stdout.flush() |
186 | sys.stderr.flush() | ||
187 | |||
188 | bb.event.useStdout = origstdout | ||
183 | 189 | ||
184 | # Restore the backup fds | 190 | # Restore the backup fds |
185 | os.dup2(osi[0], osi[1]) | 191 | os.dup2(osi[0], osi[1]) |
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index f5ba6eab3c..45458c2d63 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -110,6 +110,7 @@ def fire_from_worker(event, d): | |||
110 | if not event.startswith("<event>") or not event.endswith("</event>"): | 110 | if not event.startswith("<event>") or not event.endswith("</event>"): |
111 | print("Error, not an event %s" % event) | 111 | print("Error, not an event %s" % event) |
112 | return | 112 | return |
113 | #print "Got event %s" % event | ||
113 | event = pickle.loads(event[7:-8]) | 114 | event = pickle.loads(event[7:-8]) |
114 | fire_ui_handlers(event, d) | 115 | fire_ui_handlers(event, d) |
115 | 116 | ||
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py index 5bb30e8dd3..21692d930d 100644 --- a/bitbake/lib/bb/msg.py +++ b/bitbake/lib/bb/msg.py | |||
@@ -133,7 +133,9 @@ def error(msgdomain, msg, fn = None): | |||
133 | 133 | ||
134 | def fatal(msgdomain, msg, fn = None): | 134 | def fatal(msgdomain, msg, fn = None): |
135 | bb.event.fire(MsgFatal(msg), None) | 135 | bb.event.fire(MsgFatal(msg), None) |
136 | print('FATAL: %s' % (msg)) | 136 | |
137 | if bb.event.useStdout: | ||
138 | print('FATAL: %s' % (msg)) | ||
137 | sys.exit(1) | 139 | sys.exit(1) |
138 | 140 | ||
139 | def plain(msg, fn = None): | 141 | def plain(msg, fn = None): |
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 67f265bc80..ef5256f14c 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1467,5 +1467,5 @@ class runQueuePipe(): | |||
1467 | while self.read(): | 1467 | while self.read(): |
1468 | continue | 1468 | continue |
1469 | if len(self.queue) > 0: | 1469 | if len(self.queue) > 0: |
1470 | print("Warning, worker left partial message") | 1470 | print("Warning, worker left partial message: %s" % self.queue) |
1471 | self.fd.close() | 1471 | self.fd.close() |