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 AA128C0015E for ; Thu, 20 Jul 2023 00:02:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ABF3D868F8; Thu, 20 Jul 2023 01:52:55 +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="IQ8KZywx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B1733867F2; Thu, 20 Jul 2023 01:50:59 +0200 (CEST) Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (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 F2960867F1 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-il1-x129.google.com with SMTP id e9e14a558f8ab-346541baf2aso3533925ab.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=X1gSnnFWSmA+qA9eNNCgd+L6xLa46cT3nFBP0hypQg0=; b=IQ8KZywxyYJghoFd5e63J0KiogeFmXeupygTkWPuvyRweIc/e6WqrdiPKIrwGv6Mar BKp30g8bA1fWKYYWoN3YBljRkVupA5baRp6lIjgxgFjs4BQ18QLzNN/dPbL1+GoCaYne w5kbqisn1iZBeLjJ2+vREHk7rgK3CBbQeaqLQ= 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=X1gSnnFWSmA+qA9eNNCgd+L6xLa46cT3nFBP0hypQg0=; b=kEog9/dO2o16K3aM2FSO2zNq4MilvOgh1BzADtjnlHKeYPNLP3F5l2LpxmVP6gSl4G kbO38WiSm78p/0QGfAcxSxbL+MFwRvjlg7dWYGpY0ZSIDAyqgEsQ39VGAAZqJ4T1fQDZ 8+hMnYof10MDxNBX/yYR38RXS7jqwakYJLHlAVEM73Z5TN0uhLJ1SHhsO38p5bWKTRf2 lag8j1nPQHMzSYIetptpdT9cEPVzRD+dfo7wrCXuqwmzRGsrLy4tzjO0MWuw80TI5Wv/ m+pRtQz/RmRF6v2CfMdbeT4fBHe2w+vu9Mu0EEPV361Wo9zI7pXrQo5mIHy2G0x90lJO kQcQ== X-Gm-Message-State: ABy/qLa/DmTUHwDHaHVB8M9Fxtxe0H5/gTC0NolON+NXN6QJooXZMZx3 hrvkxtehDmeqqMGWfVr7U4Pb1iOv7TESclsfaRU= X-Google-Smtp-Source: APBJJlFLFIGBGojwwUcq/PHY3muE/DZztD/lXeHyj3F9t3EHV9TjL36ulSYQ4UaeOJOb5HEg/IoKuQ== X-Received: by 2002:a92:c403:0:b0:346:63f1:a96f with SMTP id e3-20020a92c403000000b0034663f1a96fmr2516259ilp.2.1689810651571; Wed, 19 Jul 2023 16:50:51 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:51 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 70/83] buildman: Move bulid code into its own function Date: Wed, 19 Jul 2023 17:49:18 -0600 Message-ID: <20230719234953.796101-71-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 | 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.487.g6d72f3e995-goog