Toaster first sets up a server-only instance of bitbake (with Knotty), gets the port number, and then does the actual build with the Toaster GUI. If there is an error starting the server (e.g. recent syntax changes), or more importantly if there is a simple user syntax error (for example in a layer.conf), the server-only call immediately fails before that error can caught and reported by the Toaster GUI. This leads to a hidden error and a frozen build in the webpage. All errors in the build setup must be directly reported to the user and the respective 'build' must be halted.
When "_shellcmd" fails in "localhostcontroller.py" detects a error (clone problem, server error, reported bitbake format errors), it must report the error and formally stop the current build. The current behavior is bailing with a "ShellCmdException()" which leaves the build hanging in the web gui.
Here is my validation test for catching the exceptions: [ Test 1: Format error in custom layer ] * Make a copy of a layer like "meta-poky" and save it in a new directory called "meta-poky-bad". * "Import" this layer to the Toaster project as a local directory * Append the following false line to this layer's "conf/layer.conf" foo=bar * Build a target, for example "quilt-native" Observe that after a moment the build halts, with an error message of the form: "command: bash -c .../bitbake/bin/bitbake ... --server-only -B 0.0.0.0:0" b"ERROR: Unable to start bitbake server\nERROR: Last 10 lines of server log /opt/dreyna/toaster_newer/poky/build-toaster-2/bitbake-cookerdaemon.log:\nBitbake XMLRPC server address: 0.0.0.0, server port: 47425\nEntering server connection loop\nMarking as dirty due to 'prefile' option change to '[]'\nXMLRPC Server triggering exit\nExiting\nERROR: ParseError at /opt/dreyna/toaster_newer/poky/meta-poky-bad/conf/layer.conf:22: unparsed line: 'foo=bar'\nERROR: ..." [ Test 2: Success Test ] * Fix the "layer.conf" and click re-build. Observe that the buils succeeds. [ Test 3: Git error in "setLayers()" ] * In the file localhostbecontroller.py, add the following false git command in "setLayers()": self._shellcmd("git garbage error", self.be.sourcedir).split("\n") * Stop and restart Toaster to instantiate ths change, and then click rebuild. Observe that the build halts with the following error message: command: git garbage error b"git: 'garbage' is not a git command. See 'git --help'.\n"
commit 7dce5875eae80425d1528a914c6b1f165fbb524b