]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
buildman: Drop use of 'boards' in control
authorSimon Glass <sjg@chromium.org>
Tue, 12 Jul 2022 01:04:00 +0000 (19:04 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 5 Aug 2022 15:47:55 +0000 (11:47 -0400)
Use brds instead so that we can reserve 'boards' for a module name.

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

index 462266b4b840f0c81b496ae8eb93d25f51299af5..33f9373b8f8ac6b389a91ac030331528fd9c866e 100644 (file)
@@ -108,7 +108,7 @@ u-boot/             source directory
    boards: List of Board objects which have line in the error/warning output
    errline: The text of the error line
 """
-ErrLine = collections.namedtuple('ErrLine', 'char,boards,errline')
+ErrLine = collections.namedtuple('ErrLine', 'char,brds,errline')
 
 # Possible build outcomes
 OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN = list(range(4))
@@ -1216,14 +1216,14 @@ class Builder:
                 List of boards with that error line, or [] if the user has not
                     requested such a list
             """
-            boards = []
+            brds = []
             board_set = set()
             if self._list_error_boards:
                 for brd in line_boards[line]:
                     if not brd in board_set:
-                        boards.append(brd)
+                        brds.append(brd)
                         board_set.add(brd)
-            return boards
+            return brds
 
         def _CalcErrorDelta(base_lines, base_line_boards, lines, line_boards,
                             char):
@@ -1326,8 +1326,7 @@ class Builder:
             if err_lines:
                 out_list = []
                 for line in err_lines:
-                    boards = ''
-                    names = [brd.target for brd in line.boards]
+                    names = [brd.target for brd in line.brds]
                     board_str = ' '.join(names) if names else ''
                     if board_str:
                         out = self.col.build(colour, line.char + '(')
index 68dca97413fb2661c90808a7ef717c2ecae7e071..c4dfc2af57113becaf06bf279d65e3d099b1523e 100644 (file)
@@ -87,7 +87,7 @@ def ShowActions(series, why_selected, boards_selected, builder, options,
         for warning in board_warnings:
             print(col.build(col.YELLOW, warning))
 
-def ShowToolchainPrefix(boards, toolchains):
+def ShowToolchainPrefix(brds, toolchains):
     """Show information about a the tool chain used by one or more boards
 
     The function checks that all boards use the same toolchain, then prints
@@ -100,9 +100,9 @@ def ShowToolchainPrefix(boards, toolchains):
     Return:
         None on success, string error message otherwise
     """
-    boards = boards.GetSelectedDict()
+    board_selected = brds.GetSelectedDict()
     tc_set = set()
-    for brd in boards.values():
+    for brd in board_selected.values():
         tc_set.add(toolchains.Select(brd.arch))
     if len(tc_set) != 1:
         return 'Supplied boards must share one toolchain'
@@ -111,7 +111,7 @@ def ShowToolchainPrefix(boards, toolchains):
     print(tc.GetEnvArgs(toolchain.VAR_CROSS_COMPILE))
     return None
 
-def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
+def DoBuildman(options, args, toolchains=None, make_func=None, brds=None,
                clean_dir=False, test_thread_exceptions=False):
     """The main control code for buildman
 
@@ -124,7 +124,7 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
                 to execute 'make'. If this is None, the normal function
                 will be used, which calls the 'make' tool with suitable
                 arguments. This setting is useful for tests.
-        board: Boards() object to use, containing a list of available
+        brds: Boards() object to use, containing a list of available
                 boards. If this is None it will be created and scanned.
         clean_dir: Used for tests only, indicates that the existing output_dir
             should be removed before starting the build
@@ -182,7 +182,7 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
         options.output_dir = '..'
 
     # Work out what subset of the boards we are building
-    if not boards:
+    if not brds:
         if not os.path.exists(options.output_dir):
             os.makedirs(options.output_dir)
         board_file = os.path.join(options.output_dir, 'boards.cfg')
@@ -197,8 +197,8 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
             if status != 0:
                 sys.exit("Failed to generate boards.cfg")
 
-        boards = board.Boards()
-        boards.ReadBoards(board_file)
+        brds = board.Boards()
+        brds.ReadBoards(board_file)
 
     exclude = []
     if options.exclude:
@@ -211,14 +211,14 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
             requested_boards += b.split(',')
     else:
         requested_boards = None
-    why_selected, board_warnings = boards.SelectBoards(args, exclude,
-                                                       requested_boards)
-    selected = boards.GetSelected()
+    why_selected, board_warnings = brds.SelectBoards(args, exclude,
+                                                     requested_boards)
+    selected = brds.GetSelected()
     if not len(selected):
         sys.exit(col.build(col.RED, 'No matching boards found'))
 
     if options.print_prefix:
-        err = ShowToolchainPrefix(boards, toolchains)
+        err = ShowToolchainPrefix(brds, toolchains)
         if err:
             sys.exit(col.build(col.RED, err))
         return 0
@@ -349,7 +349,7 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
         builder.in_tree = options.in_tree
 
         # Work out which boards to build
-        board_selected = boards.GetSelectedDict()
+        board_selected = brds.GetSelectedDict()
 
         if series:
             commits = series.commits
index 812dc924c8d50ad7fd2f254ed4e5cf0edb4bf4e3..23627f3b0f2a9cccdc981c6f70a4f91e3a37500b 100644 (file)
@@ -239,7 +239,7 @@ class TestFunctional(unittest.TestCase):
         sys.argv = [sys.argv[0]] + list(args)
         options, args = cmdline.ParseArgs()
         result = control.DoBuildman(options, args, toolchains=self._toolchains,
-                make_func=self._HandleMake, boards=brds or self._boards,
+                make_func=self._HandleMake, brds=brds or self._boards,
                 clean_dir=clean_dir,
                 test_thread_exceptions=test_thread_exceptions)
         self._builder = control.builder