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 19BADC001DC for ; Thu, 20 Jul 2023 00:02:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8031F868EF; Thu, 20 Jul 2023 01:52:54 +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="GW7Kgml5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7EDED86772; Thu, 20 Jul 2023 01:50:59 +0200 (CEST) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 46316867F2 for ; Thu, 20 Jul 2023 01:50:52 +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-io1-xd36.google.com with SMTP id ca18e2360f4ac-77a62a84855so8819839f.1 for ; Wed, 19 Jul 2023 16:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810651; x=1690415451; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r+Otou/7l4GviD+Oxw4nxMf6JDUTvB+jPS5vAs0lwiI=; b=GW7Kgml54MOnCMW4izMK2pVDkX4FGVWyKxZCfg1ySzwZPyXPWR34lRC2DcKNTk8C6X eGTqsPNpDFlC9yZMraSLWikUsBFAPhsRsfjY/SeR/XAcJssPtLTJPB6zR0C6hyZOmsFd iiYb1LNc54SHooKx4ZaNIEYub9lGlq4tdguwM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810651; x=1690415451; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r+Otou/7l4GviD+Oxw4nxMf6JDUTvB+jPS5vAs0lwiI=; b=YQSr0ukG0AIClFF18y2N1YmCsPTuGD+kp8Pa4OuFWiP7471NuAvplYbFQNmn3YTw2Q 9S6bUZdT9O3/6rH8MTHfRS7X47i77IlqbK9mV29G7kcrrLBb6j7oLdT2wdaIfhn+l+gw cqnRrBuhBzFD9iwaBUEjPlfOOduPbd71t/leT3cnABrFZ/l7i4GgIwLzC+0C6CQlaE5l JtNrtTxHjOG2EAxWEqdApDjQJF16godFVL4TTHDjgAAQ6p3gTylhZ/ySTTaXCQgWfqRE 0ozACCbueU32/fDGCTCZopX137waJAr80nn81u4y7ZcFuJyJtMeKOhNnf8VES1e0FZ6p XXWQ== X-Gm-Message-State: ABy/qLZsjIfc/AUCokv62VCioO/G6bX8Y+kAGsLhC8pTgngWmc1ZSy6u PnAyMkfqgEDakZtAutHNmdcURUhYoC+iKx72jAo= X-Google-Smtp-Source: APBJJlHQp9Gx0Me2XmUOLy0ABNtobym56kCB9Ic2MscAKv+o2KuEZFxarsmygrD1Wwj3DIwqfA8xsA== X-Received: by 2002:a5d:9512:0:b0:787:a73:b411 with SMTP id d18-20020a5d9512000000b007870a73b411mr3758565iom.17.1689810650857; Wed, 19 Jul 2023 16:50:50 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id ed16-20020a056638291000b0042bb1779c18sm1551779jab.151.2023.07.19.16.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:50 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 69/83] buildman: Move reconfigure code into its own function Date: Wed, 19 Jul 2023 17:49:17 -0600 Message-ID: <20230719234953.796101-70-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230719234953.796101-1-sjg@chromium.org> References: <20230719234953.796101-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.8 at phobos.denx.de X-Virus-Status: Clean Split this into its own function so reduce the size of run_commit(). Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/builderthread.py | 41 ++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 9c2938d1b071..80fca2a61bb3 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -191,6 +191,33 @@ class BuilderThread(threading.Thread): args.extend(self.toolchain.MakeArgs()) return args, cwd, src_dir + def _reconfigure(self, commit, brd, cwd, args, env, config_args, config_out, + cmd_list): + """Reconfigure the build + + Args: + commit (Commit): Commit only being built + brd (Board): Board being built + cwd (str): Current working directory + args (list of str): Arguments to pass to make + env (dict): Environment strings + config_args (list of str): defconfig arg for this board + cmd_list (list of str): List to add the commands to, for logging + + Returns: + CommandResult object + """ + if self.mrproper: + result = self.make(commit, brd, 'mrproper', cwd, 'mrproper', *args, + env=env) + config_out.write(result.combined) + cmd_list.append([self.builder.gnu_make, 'mrproper', *args]) + result = self.make(commit, brd, 'config', cwd, *(args + config_args), + env=env) + cmd_list.append([self.builder.gnu_make] + args + config_args) + config_out.write(result.combined) + return result + def run_commit(self, commit_upto, brd, work_dir, do_config, config_only, force_build, force_build_failures, work_in_output, adjust_cfg): @@ -309,17 +336,9 @@ class BuilderThread(threading.Thread): cfg_file = os.path.join(out_dir, '.config') cmd_list = [] if do_config or adjust_cfg: - if self.mrproper: - result = self.make(commit, brd, 'mrproper', cwd, - 'mrproper', *args, env=env) - config_out.write(result.combined) - cmd_list.append([self.builder.gnu_make, 'mrproper', - *args]) - result = self.make(commit, brd, 'config', cwd, - *(args + config_args), env=env) - cmd_list.append([self.builder.gnu_make] + args + - config_args) - config_out.write(result.combined) + result = self._reconfigure( + commit, brd, cwd, args, env, config_args, config_out, + cmd_list) do_config = False # No need to configure next time if adjust_cfg: cfgutil.adjust_cfg_file(cfg_file, adjust_cfg) -- 2.41.0.487.g6d72f3e995-goog