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 A69ACC0015E for ; Thu, 20 Jul 2023 00:02:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 15AE4868F6; Thu, 20 Jul 2023 01:52:59 +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="Ra4Y5Vse"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A5DF86805; Thu, 20 Jul 2023 01:51:01 +0200 (CEST) Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (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 140E586774 for ; Thu, 20 Jul 2023 01:50: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=sjg@chromium.org Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-78372b895d6so8089439f.2 for ; Wed, 19 Jul 2023 16:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810653; x=1690415453; 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=bUtBWEug/8jm8/aKk9id49DbaqdfngXqs9QA5LVKDl4=; b=Ra4Y5VseSPrKoAMAj0Sx2w1wH0NK4FujRf7pwMbIVgZgN8gtVezgai5KeBJhe98UCw KNFIs2BnYdCFJpF2jrMxvQ38JjtWNwPe4sVOKze5RaPDFLWODWVHwI5YeQKdboqV85wz XhoA43lA4FA0Kl2ePdmemVMC9SoAzqwywi5hQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810653; x=1690415453; 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=bUtBWEug/8jm8/aKk9id49DbaqdfngXqs9QA5LVKDl4=; b=WjcpyhzxmRdDge9g1alnuwUZbaa14E4j53sl+e8dhJQ2nh9c2UTFxfuIPigY1OAExG 2TyKzAnFhVY7FTFeuYI83RJj+66U88Glc7cmsSCh0uBU+JFWo7glBqza+PLbp+urJtEj +sTbh+h7LNW6mddsUtKv+e3OY+XhnfsFWAShWMV6AFzpOOA+23pKq68D0w/XzPm/h5jz ARFKwTBBe490kzqfIlYa+VtHSCUFZt07ZrjDjSXHDr8CslfVjVja0zTZEueYaV3AvWyd cVmMyDC9BKJyLKzYD6mJgDrvgmlIl+qfqJSLwCWr5roq3kmpAlrt1c8S/yET0GJkfcOk uw2w== X-Gm-Message-State: ABy/qLZpJhnRMQRolo2uax2UYhbCX45bbAirHYaTGx3f1fODJdyJyKV/ l5v87qJnTb0bmh09aVDHkOndogqVjxImDahEIYA= X-Google-Smtp-Source: APBJJlGnxWwMotRzejOXYYHQUH0FiU9ruNIBNnddnsw8hF6tRd3988tJ1CaoJ5L8m50NtUryiqgDdw== X-Received: by 2002:a05:6602:3294:b0:786:e669:3059 with SMTP id d20-20020a056602329400b00786e6693059mr918430ioz.6.1689810653716; Wed, 19 Jul 2023 16:50:53 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:53 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 73/83] buildman: Move code to decide output dirs Date: Wed, 19 Jul 2023 17:49:21 -0600 Message-ID: <20230719234953.796101-74-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 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.487.g6d72f3e995-goog