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 DA39CC001DF for ; Sun, 16 Jul 2023 00:49:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B032786728; Sun, 16 Jul 2023 02:40:38 +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="LcYmj4nM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ADB1C86657; Sun, 16 Jul 2023 02:38:37 +0200 (CEST) Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (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 84C5886638 for ; Sun, 16 Jul 2023 02:38:14 +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-x12a.google.com with SMTP id e9e14a558f8ab-3464c774f23so16698595ab.1 for ; Sat, 15 Jul 2023 17:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467893; x=1692059893; 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=RxNhA4CfgFUFWwfaXL+Loz9vTP6M0hYLS0VqI8ZWRWI=; b=LcYmj4nMed3fOiRMTaLtNT8FzezPzoGCuRhmp3gZIih3mlK36cvtbQyNyxSEW+MTJd lC9wKZ18rAm4XVg3IDrBv6YLkMpeo1XCPMZMw/K4YsKSiqqbH/bZir3sC4pxwsqvyTG5 tO+elFPpof1YCP7TJeefhuga10IWNUwJnHKB8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467893; x=1692059893; 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=RxNhA4CfgFUFWwfaXL+Loz9vTP6M0hYLS0VqI8ZWRWI=; b=XLUWnt/FmeYaNNDkOf+kEXNQZBPDqJmquJrsUIyiUBeCBMubQ17V0WyZmdhNk8pOvt RBZ+gXgujzGF62rx8Taq3vMmpk5ffo/S8MhDD0POSLTwR5ES1s4w88vvIDDq621tLs3K Gh/g+pBBIeEv3K5aMN3+k0CLFpoMsv8UsAO3U1QHOyHf078JWW5xkhKfB7ronQvsCaIf tKms1Eiv36Eq0rySOnD5OZETxKjTnx8Y806R3EUQDn/Mda+eM9zD3Zq+9c4s8y5cDFuj xUgeK0amISUv6aaT8n65kdMw/A1k8emAqb2zKoO3X9QvHutkbwfgrVwMcyCllXYKhqEY it/g== X-Gm-Message-State: ABy/qLaS8Sb9x8ljl0750TIPhRbxs09T3tguKeXY+pX2W1+BE+pt+9Bu 6+S2Xuo+vtYc9h3OJGa46GZAIhgXy3h24Tttlb0= X-Google-Smtp-Source: APBJJlHWuP9j2uYmUnr03YSyioHzIEFHhlZoQ/+3hE9izwSDLX9fiJUsgLClcDOpOzDRonAeg5tnUQ== X-Received: by 2002:a92:d0c8:0:b0:348:6716:7fce with SMTP id y8-20020a92d0c8000000b0034867167fcemr4794705ila.7.1689467893135; Sat, 15 Jul 2023 17:38:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 17:38:12 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v3 71/81] buildman: Move code to decide output dirs Date: Sat, 15 Jul 2023 18:36:39 -0600 Message-ID: <20230716003718.231903-72-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 Put this in its own function to reduce the size of the run_commit() function. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/builderthread.py | 34 ++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 4abad86ebc7b..78405956ef51 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -302,6 +302,30 @@ class BuilderThread(threading.Thread): will_build = False return will_build + def _decide_dirs(self, brd, work_dir, work_in_output): + """Decide the output directory to use + + Args: + work_dir (str): Directory to which the source will be checked out + work_in_output (bool): Use the output directory as the work + directory and don't write to a separate output directory. + + Returns: + tuple: + out_dir (str): Output directory for the build + out_rel_dir (str): Output directory relatie to the current dir + """ + if work_in_output or self.builder.in_tree: + out_rel_dir = None + out_dir = work_dir + else: + if self.per_board_out_dir: + out_rel_dir = os.path.join('..', brd.target) + else: + out_rel_dir = 'build' + out_dir = os.path.join(work_dir, out_rel_dir) + return out_dir, out_rel_dir + def run_commit(self, commit_upto, brd, work_dir, do_config, config_only, force_build, force_build_failures, work_in_output, adjust_cfg): @@ -338,15 +362,7 @@ class BuilderThread(threading.Thread): # self.make() below, in the event that we do a build. result = command.CommandResult() result.return_code = 0 - if work_in_output or self.builder.in_tree: - out_rel_dir = None - out_dir = work_dir - else: - if self.per_board_out_dir: - out_rel_dir = os.path.join('..', brd.target) - else: - out_rel_dir = 'build' - out_dir = os.path.join(work_dir, out_rel_dir) + out_dir, out_rel_dir = self._decide_dirs(brd, work_dir, work_in_output) # Check if the job was already completed last time will_build = self._read_done_file(commit_upto, brd, result, force_build, -- 2.41.0.455.g037347b96a-goog