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 691BAC0015E for ; Sun, 16 Jul 2023 00:48:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C42186718; Sun, 16 Jul 2023 02:40:34 +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="OxxTCvqb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3A75286654; Sun, 16 Jul 2023 02:38:34 +0200 (CEST) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 B4D2586624 for ; Sun, 16 Jul 2023 02:38:11 +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-xd31.google.com with SMTP id ca18e2360f4ac-7837329a00aso153125939f.2 for ; Sat, 15 Jul 2023 17:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467890; x=1692059890; 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=+InOS+/zww/7Sz1Lq8Jjy9pu9AHo38XX6jqAPnnS4Uk=; b=OxxTCvqbUnsMhC8zgzUlF/HG78XXIffbbVrO6vbu2jlAjyxWrE1oYzMsDDkKAl7kP0 WBUcjCmASV1xZU0X24VPvhwZQcJGxo6c7H5H0Pn9rFEYpxhheapp9mCWyRV88AH/2HBv 5CFziJ23BNyU21ZppS3fUcdKQsg5xE4q6+RU4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467890; x=1692059890; 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=+InOS+/zww/7Sz1Lq8Jjy9pu9AHo38XX6jqAPnnS4Uk=; b=jF0QpjhawRssumld9VsOPTCBtCJIo2bT/icX3dq4iuIAUpQJoPDbI9pp7iJii0ftuo HuyB7wAc6KVXFt3JtYXoP+aQbIjFec7jJ0JMXJme/8JDG8fZ/uKSpKuWOtxS3lw2hrxj w3Yc1GluWeapldFDe74Hmjrd+rICWMZ7Fkrzyp2XoLxeHXCHW4wM53aF1o3SjuidWcrI lWGdxQz7nj+3THfgyhSjUQ/fhge0KbVg5L7m49CKRUqqEC6hFbtideO0Em7oYp8McGBs KMWPNBnrsu5qHpL3lqeaebmdRwcsnM4njWj+UK/HNtkZcDTp85am86JA5PW3ujfwIMFC 2nUw== X-Gm-Message-State: ABy/qLbV6WsbkDk6FtiPpHV9Xex+mi8pdXnEcgP/afi6aWsJqThu1d0N pu6Ixj53j5Hp1HTy60+gZV/WVdx5Zu4VQm7V6mo= X-Google-Smtp-Source: APBJJlFGjBq0FFPbnwFQ22f8gx/Db5yn7oAkVp72svnLCpR0JOgr1cCqOsiulH4X0tD9m97nklFV1A== X-Received: by 2002:a6b:dd14:0:b0:787:1472:3181 with SMTP id f20-20020a6bdd14000000b0078714723181mr8584829ioc.3.1689467890408; Sat, 15 Jul 2023 17:38:10 -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 t3-20020a05663801e300b0042b52dc77e3sm3510512jaq.158.2023.07.15.17.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 17:38:10 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v3 67/81] buildman: Move reconfigure code into its own function Date: Sat, 15 Jul 2023 18:36:35 -0600 Message-ID: <20230716003718.231903-68-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.455.g037347b96a-goog In-Reply-To: <20230716003718.231903-1-sjg@chromium.org> References: <20230716003718.231903-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.455.g037347b96a-goog