]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
buildman: Tidy up reporting of a toolchain error
authorSimon Glass <sjg@chromium.org>
Wed, 19 Jul 2023 23:49:25 +0000 (17:49 -0600)
committerSimon Glass <sjg@chromium.org>
Mon, 24 Jul 2023 15:34:11 +0000 (09:34 -0600)
Provide the text of the exception when something goes wrong.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/buildman/builderthread.py
tools/buildman/func_test.py

index d3912390bc4f2d7b9cb5000cd0cefe641540b486..043e92b6d92dc970477a8ed17ad80f75b68538af 100644 (file)
@@ -457,18 +457,13 @@ class BuilderThread(threading.Thread):
                 except ValueError as err:
                     result.return_code = 10
                     result.stdout = ''
-                    result.stderr = str(err)
-                    # TODO(sjg@chromium.org): This gets swallowed, but needs
-                    # to be reported.
+                    result.stderr = f'Tool chain error for {brd.arch}: {str(err)}'
 
             if self.toolchain:
                 commit = self._checkout(commit_upto, work_dir)
                 result, do_config = self._config_and_build(
                     commit_upto, brd, work_dir, do_config, config_only,
                     adjust_cfg, commit, out_dir, out_rel_dir, result)
-            else:
-                result.return_code = 1
-                result.stderr = f'No tool chain for {brd.arch}\n'
             result.already_done = False
 
         result.toolchain = self.toolchain
index 07b4ac0174b5c1fa7c7e8395144b75b191d111df..126ea9e11f0031b7f11650ec935441ad3351e9c7 100644 (file)
@@ -511,8 +511,10 @@ Some images are invalid'''
                 if brd.arch != 'sandbox':
                   errfile = self._builder.get_err_file(commit, brd.target)
                   fd = open(errfile)
-                  self.assertEqual(fd.readlines(),
-                          ['No tool chain for %s\n' % brd.arch])
+                  self.assertEqual(
+                      fd.readlines(),
+                      [f'Tool chain error for {brd.arch}: '
+                       f"No tool chain found for arch '{brd.arch}'"])
                   fd.close()
 
     def testBranch(self):