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 A4E27C001DC for ; Wed, 19 Jul 2023 23:57:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5574E867D6; Thu, 20 Jul 2023 01:52:18 +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="D6hmSBz1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7D322867FA; Thu, 20 Jul 2023 01:50:43 +0200 (CEST) Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 CBCA1867F0 for ; Thu, 20 Jul 2023 01:50:37 +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-xd2a.google.com with SMTP id ca18e2360f4ac-78362f57500so8035739f.3 for ; Wed, 19 Jul 2023 16:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810636; x=1690415436; 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=qEojNlOS2ZIqLCXUKb5/pwcb9Zo1vI0bQs9s/ChqgIw=; b=D6hmSBz17rBx7/q+NZbznkHLaeWkd6pIvQYh/wRWdZKSwy+KQsIb2O4rd5Y0yzPI6X CYzIGX8SHJZLeraOTnC+N8cbZ5ukiqYkJ+2wQWq0b/8xKLMUzbyW5GD+TyRw6gQgfndh u1hef0GI8yS/Kr96rJluorEe269ivOsCyes6E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810636; x=1690415436; 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=qEojNlOS2ZIqLCXUKb5/pwcb9Zo1vI0bQs9s/ChqgIw=; b=Aq6Gevz9VsVym2GKHW9GG2dgt0qM+DcM3zsuji0gcXVYrP1dcSKxNzWrb4NO1S/4Cc muRuT2bRig5yWgWxnwPsqzfuj9AEvKP/WqdHjNmtUKtCnUvQKOsRcztb1AnnYt61RWvV PNwMogV0mIUwy/MYs1Mgq2bVX2MPXvZ1BaaggmCQIPieJQY9RH9MaBbCNzZmxekce/C0 pk13d/SrdxOjgonoBdcE6cg6tBPEbwuhk+biHcufVIWRKguZ3DDmOBAhpytZsP8HHCiX HLHy90OtDJzkQmoeJn47uDpB2HCA9g8t0cBdbuvFKaIq6SSVQU1PJV5TG5D1yXMntl7i VBXg== X-Gm-Message-State: ABy/qLakvlrxfmPj2TqpbNudrVuRxfqSRFwl966aw8YRLmOEYNAKhaAb +SDE5SClEeL5iKe3cpMEafPvjMq3clpAk3xLrv0= X-Google-Smtp-Source: APBJJlFvIXISXKfKd7/alhDcWdPl/tEWJUBRW5+GBSJXN9XApNZd02SQ9PxrUznAlre4vGZHzpzYmA== X-Received: by 2002:a05:6602:3294:b0:786:e669:3059 with SMTP id d20-20020a056602329400b00786e6693059mr917872ioz.6.1689810636471; Wed, 19 Jul 2023 16:50:36 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:36 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 50/83] buildman: Move getting the adjust_cfg into run_builder() Date: Wed, 19 Jul 2023 17:48:58 -0600 Message-ID: <20230719234953.796101-51-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 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.487.g6d72f3e995-goog