[bitbake-devel] ui/toasterui: Fix startup faults from incorrect event sequencing

Submitted by Richard Purdie on Oct. 16, 2020, 12:34 p.m. | Patch ID: 177531

Details

Message ID 2020-10-28T09:23:42.471233-<20201016123420.3531477-1-richard.purdie@linuxfoundation.org
State New
Headers show

Commit Message

Richard Purdie Oct. 16, 2020, 12:34 p.m.
Toaster has been failing to start correctly when in interactive mode. The
issue is due to setEventMask being called (which triggers parsing) before
the environment has been sent from the UI over to the server. This means
PATH isn't setup, which causes the sanity checks on HOSTTOOLS to fail
in base.bbclass.

The fix is to ensure the environment is sent to the server before
other commands are run.

The pain in debugging this highlights other improvements to the logging
are needed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

---
 lib/bb/ui/toasterui.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11757): https://lists.openembedded.org/g/bitbake-devel/message/11757
Mute This Topic: https://lists.openembedded.org/mt/77549310/1003190
Group Owner: bitbake-devel+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [mhalstead@linuxfoundation.org]
-=-=-=-=-=-=-=-=-=-=-=-

Patch hide | download patch | download mbox

diff --git a/lib/bb/ui/toasterui.py b/lib/bb/ui/toasterui.py
index 9260f5d9d7..ec5bd4f105 100644
--- a/lib/bb/ui/toasterui.py
+++ b/lib/bb/ui/toasterui.py
@@ -131,6 +131,10 @@  def main(server, eventHandler, params):
 
     helper = uihelper.BBUIHelper()
 
+    if not params.observe_only:
+        params.updateToServer(server, os.environ.copy())
+        params.updateFromServer(server)
+
     # TODO don't use log output to determine when bitbake has started
     #
     # WARNING: this log handler cannot be removed, as localhostbecontroller
@@ -162,8 +166,6 @@  def main(server, eventHandler, params):
         logger.warning("buildstats is not enabled. Please enable INHERIT += \"buildstats\" to generate build statistics.")
 
     if not params.observe_only:
-        params.updateFromServer(server)
-        params.updateToServer(server, os.environ.copy())
         cmdline = params.parseActions()
         if not cmdline:
             print("Nothing to do.  Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")