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 92D4CC0015E for ; Sun, 16 Jul 2023 00:45:46 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D5FBA866C0; Sun, 16 Jul 2023 02:39: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="G8p4wzF8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 53A9A86321; Sun, 16 Jul 2023 02:38:15 +0200 (CEST) Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (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 94A30863E9 for ; Sun, 16 Jul 2023 02:37:58 +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-x12f.google.com with SMTP id e9e14a558f8ab-345e55a62d8so13770795ab.3 for ; Sat, 15 Jul 2023 17:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467877; x=1692059877; 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=FeH61FllGiV9i6UrOMBqOboMG8hWbTX+p/btf6flYlk=; b=G8p4wzF8y5+4G0wBG+WUQjzBu6qqChuQbDclxeqSbsJM7jqI9K4XMh0ljA8ltYVcZt Zb19edG9WW2KSA49nBTIMH17S9jaGc+76do+5FADyXSSIAaRw8LW0IvGuVt4bfbj2w0S 7e/4FXU/8OrNbs5XEgY2gPIEzi5e/BZw5SnXM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467877; x=1692059877; 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=FeH61FllGiV9i6UrOMBqOboMG8hWbTX+p/btf6flYlk=; b=kTy7h8wT3WSfJgXUiw4wrI69QirZKh/tZyqU2YmvXWRtP22zecivutxf6h4GWOEV9E bgkNn2Brj98Ddf/gsor893Gp0GcVf387Rmrx7GBypIOYjxCiTm/4BW5y/QNaoqvPv7Ru 2yOL0wuriJgUBWMa3GF5hjTE6GGmYX17nMkwcOOt0tpL2HL6U/9xKd3vutByRxJfnKPn kuko3HJ/ZPNMcGsvG7mCdp4BhlfbQzRPx9p+UsQxBdm5JTgdKFCPHPXezARtDedRI5sR Xz4Yg6OBdhx+910okf9/SterUTJIHJwzn7EaB2rY0UABiyOUV2jjf9xTFKhrHRUWBbHL duhA== X-Gm-Message-State: ABy/qLaHtP2BP8ztPvDTbHHVPI2nuok3brIYcSJOIaqjOmkL8BU/tVmF em80zJ2R1pvSHbB6UPOibEuT86tcFtrQVbfHPrI= X-Google-Smtp-Source: APBJJlFATv5SR2HL7zbKmOdvvYKuWrPCcCkp93MpruoUCXc8P6IsI/C5pfhUn7+xUaghDb0du6xSBQ== X-Received: by 2002:a92:d944:0:b0:346:34fe:f2f7 with SMTP id l4-20020a92d944000000b0034634fef2f7mr7719088ilq.13.1689467877177; Sat, 15 Jul 2023 17:37:57 -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.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 17:37:57 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v3 48/81] buildman: Move getting the adjust_cfg into run_builder() Date: Sat, 15 Jul 2023 18:36:16 -0600 Message-ID: <20230716003718.231903-49-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 Move this into its own function to reduce the size of do_buildman(). Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/control.py | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 1317cc718484..a20fa6286f72 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -515,6 +515,31 @@ def run_builder(builder, commits, board_selected, options): return 101 return 0 + +def calc_adjust_cfg(adjust_cfg, reproducible_builds): + """Calculate the value to use for adjust_cfg + + Args: + adjust_cfg (list of str): List of configuration changes. See cfgutil for + details + reproducible_builds (bool): True to adjust the configuration to get + reproduceable builds + + Returns: + adjust_cfg (list of str): List of configuration changes + """ + adjust_cfg = cfgutil.convert_list_to_dict(adjust_cfg) + + # Drop LOCALVERSION_AUTO since it changes the version string on every commit + if reproducible_builds: + # If these are mentioned, leave the local version alone + if 'LOCALVERSION' in adjust_cfg or 'LOCALVERSION_AUTO' in adjust_cfg: + print('Not dropping LOCALVERSION_AUTO for reproducible build') + else: + adjust_cfg['LOCALVERSION_AUTO'] = '~' + return adjust_cfg + + def do_buildman(options, args, toolchains=None, make_func=None, brds=None, clean_dir=False, test_thread_exceptions=False): """The main control code for buildman @@ -582,16 +607,6 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None, options.no_allow_missing, len(selected), options.branch) - adjust_cfg = cfgutil.convert_list_to_dict(options.adjust_cfg) - - # Drop LOCALVERSION_AUTO since it changes the version string on every commit - if options.reproducible_builds: - # If these are mentioned, leave the local version alone - if 'LOCALVERSION' in adjust_cfg or 'LOCALVERSION_AUTO' in adjust_cfg: - print('Not dropping LOCALVERSION_AUTO for reproducible build') - else: - adjust_cfg['LOCALVERSION_AUTO'] = '~' - # Create a new builder with the selected options builder = Builder(toolchains, output_dir, git_dir, options.threads, options.jobs, checkout=True, @@ -605,7 +620,8 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None, warnings_as_errors=options.warnings_as_errors, work_in_output=options.work_in_output, test_thread_exceptions=test_thread_exceptions, - adjust_cfg=adjust_cfg, + adjust_cfg=calc_adjust_cfg(options.adjust_cfg, + options.reproducible_builds), allow_missing=allow_missing, no_lto=options.no_lto, reproducible_builds=options.reproducible_builds, force_build = options.force_build, -- 2.41.0.455.g037347b96a-goog