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 5A4F5C0015E for ; Sun, 16 Jul 2023 00:49:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F0ABA86720; Sun, 16 Jul 2023 02:40:36 +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="iq/E2swC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 792C8865D1; Sun, 16 Jul 2023 02:38:34 +0200 (CEST) Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (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 8045986626 for ; Sun, 16 Jul 2023 02:38:12 +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-il1-x134.google.com with SMTP id e9e14a558f8ab-346129c9512so7012385ab.1 for ; Sat, 15 Jul 2023 17:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467891; x=1692059891; 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=CcS+Xp5zzAe2TJ5fb0Zu/kO5H0iSU4igGkFnv1RLlZ0=; b=iq/E2swCkX64WAY2ddWnTtN5NBBwvem/wjA8tUJp8H6eAgExudonYxE/t9P5+b1NJx dykROQP2KGP9BdQBdgyTHO5LXGAXO7oBF3w5W1Gm7z3dhlTsryBGmOSn2sDy4NYKYOkW 8X0j7jLR9dy8gl4dj9Sr2mIV+RlQbO/KHF+Lc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467891; x=1692059891; 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=CcS+Xp5zzAe2TJ5fb0Zu/kO5H0iSU4igGkFnv1RLlZ0=; b=TWoOKL1WzvT0adLjoHwOPHzORG6Dsp23Vib6XKtot2Dbfk3DsJvRrhIqTyNrkax8zy FPqLTK6khxzda6fZf3O3sdPRKWTd6V2L8aDBHdfzSwR3hduu3ZV5ZQKaNaeTxDBWklOm nDDaURlSiGC6ff0nwmfVa611p3XbVUt2ltOi97fWx7EuKJiQAZnIPPikBjwEWCyJ4wd2 WCDRWc3LCpwanjWHCgFfoZ3Ybw4vAPI2Jm+9Azf2AwcO+EYniX13+0F1vokJoPsRniep QahLmWZus+QWCIU7xe4yzz2t9DQ14LOgPBVGDxGkMdL9TOOKPmTQcKbVWB0IU93x8QEZ dhbg== X-Gm-Message-State: ABy/qLZHIYU9e2Qz+0Izw6k76lkO1CuUHk4mk4aRTwKbEf/gcdXJ3Ebu MbpsOqkawsIPIrDvdk0cHIfRf6iMKVmXCaskLBY= X-Google-Smtp-Source: APBJJlEzuOOSHluNHSOmKRG4TMUrrDcJrtsrN2ShQtGEWWDbOqoOnKDqGFQHP6qOmkr/9TsJJiAfBg== X-Received: by 2002:a05:6e02:d44:b0:346:4f37:8a3 with SMTP id h4-20020a056e020d4400b003464f3708a3mr4577411ilj.5.1689467891088; Sat, 15 Jul 2023 17:38:11 -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.10 (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 68/81] buildman: Move bulid code into its own function Date: Sat, 15 Jul 2023 18:36:36 -0600 Message-ID: <20230716003718.231903-69-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 | 40 ++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 80fca2a61bb3..2d54e6283023 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -218,6 +218,32 @@ class BuilderThread(threading.Thread): config_out.write(result.combined) return result + def _build(self, commit, brd, cwd, args, env, cmd_list, config_only): + """Perform 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 + cmd_list (list of str): List to add the commands to, for logging + config_only (bool): True if this is a config-only build (using the + 'make cfg' target) + + Returns: + CommandResult object + """ + if config_only: + args.append('cfg') + result = self.make(commit, brd, 'build', cwd, *args, env=env) + cmd_list.append([self.builder.gnu_make] + args) + if (result.return_code == 2 and + ('Some images are invalid' in result.stderr)): + # This is handled later by the check for output in stderr + result.return_code = 0 + 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): @@ -342,17 +368,11 @@ class BuilderThread(threading.Thread): do_config = False # No need to configure next time if adjust_cfg: cfgutil.adjust_cfg_file(cfg_file, adjust_cfg) + + # Now do the build, if everything looks OK if result.return_code == 0: - if config_only: - args.append('cfg') - result = self.make(commit, brd, 'build', cwd, *args, - env=env) - cmd_list.append([self.builder.gnu_make] + args) - if (result.return_code == 2 and - ('Some images are invalid' in result.stderr)): - # This is handled later by the check for output in - # stderr - result.return_code = 0 + result = self._build(commit, brd, cwd, args, env, cmd_list, + config_only) if adjust_cfg: errs = cfgutil.check_cfg_file(cfg_file, adjust_cfg) if errs: -- 2.41.0.455.g037347b96a-goog