Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BEE78C433EF for ; Tue, 12 Jul 2022 01:05:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0DC69840B3; Tue, 12 Jul 2022 03:05:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="HgAK7OmD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8757D840A5; Tue, 12 Jul 2022 03:04:46 +0200 (CEST) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E764A840AB for ; Tue, 12 Jul 2022 03:04:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-wr1-x432.google.com with SMTP id b26so9102561wrc.2 for ; Mon, 11 Jul 2022 18:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yYMA3629b3+Jvd+KexzM3y8eT6TY995qq/a2OTYGXas=; b=HgAK7OmDpJAAL8h9Crapkxz/PvmO8G0aw/4E9ObqCrwMV/gzK7VTGrQe1YWjS/wKGX c4FfFvVeU8+P8WxflWQW/MXPY+OgxrjTzoJ6qCCBhDntsUt7qGHs+xqew4To7kuFp58m 3T00Ur4SXld0tJ5baj6W5swH5DRGMMNWQD4wo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yYMA3629b3+Jvd+KexzM3y8eT6TY995qq/a2OTYGXas=; b=q7QGqzPB8m7PXVimaBtPUEwNcho2lOnMaT03gEf0ya3BxZoqQ9OdRg3EJDxrEQ2AO6 12ABt9YCBMmEQJR6VZxxdgNYa+YqkmWNFgWw6lp0PcyDkG2ElOR8UuUlR0/NdCrr5vAH FTxGVbXwjkAQPbKUalHaL5H5MYvV5WhSrvRGApGEgG/BE+3I4Rt0m72UN5MII26Sqhcs WjFaNrHd+Y9sW0KiXzu5qOXcGfoeK+UDx1EjaMqrUn+VcpirIYx7CwMKtXL8oiva+s6s /w9zlgghfYeVB8MnzotB9TQKQ0xkPCrpSHMGR5/pjpooP2TDUPxx3HyFpwD+4DBz4VOR YpBg== X-Gm-Message-State: AJIora+uct6WyApyAWeY3uy1it+CGt5+Z3PmO3EtkCcSb/eS3gz/pnMZ l+QSMXDiFb7PokrYNPvvdO66IeHCYNd1Cv/V X-Google-Smtp-Source: AGRyM1tIvEXGo/5nyCQRNi6T5HBgb85OA2Xdh9xs4px8QVhPrFtp+1PMR7sQRGsUAQ/xjUUhnLfUlw== X-Received: by 2002:a05:6000:2aa:b0:21d:ac4b:95af with SMTP id l10-20020a05600002aa00b0021dac4b95afmr4338216wry.479.1657587879077; Mon, 11 Jul 2022 18:04:39 -0700 (PDT) Received: from sjg1.roam.corp.google.com (host-92-0-109-232.as13285.net. [92.0.109.232]) by smtp.gmail.com with ESMTPSA id p12-20020a5d48cc000000b0021d9d13bf6csm5541152wrs.97.2022.07.11.18.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 18:04:38 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 06/19] buildman: Drop use of 'boards' in control Date: Mon, 11 Jul 2022 19:04:00 -0600 Message-Id: <20220712010413.331984-7-sjg@chromium.org> X-Mailer: git-send-email 2.37.0.144.g8ac04bfd2-goog In-Reply-To: <20220712010413.331984-1-sjg@chromium.org> References: <20220712010413.331984-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Use brds instead so that we can reserve 'boards' for a module name. Signed-off-by: Simon Glass --- tools/buildman/builder.py | 11 +++++------ tools/buildman/control.py | 26 +++++++++++++------------- tools/buildman/func_test.py | 2 +- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 462266b4b84..33f9373b8f8 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -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 + '(') diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 68dca97413f..c4dfc2af571 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -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 diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 812dc924c8d..23627f3b0f2 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -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 -- 2.37.0.144.g8ac04bfd2-goog