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 2C4B6C0015E for ; Sun, 16 Jul 2023 00:44:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2A3AF86680; Sun, 16 Jul 2023 02:39:30 +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="Zkb8E/h7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E33668660F; Sun, 16 Jul 2023 02:38:09 +0200 (CEST) Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (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 51F99865C4 for ; Sun, 16 Jul 2023 02:37:54 +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-xd2c.google.com with SMTP id ca18e2360f4ac-78654448524so117747639f.2 for ; Sat, 15 Jul 2023 17:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467873; x=1692059873; 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=bDaJAhdE1RnADR3cQrx9bhABEuQkgJ1zoWvoaiIwnlE=; b=Zkb8E/h7TEXi/IAazid/8VIkmoAUeA5JO12HB4MMyVhocQcPJ4dAnaVUhTmvX7jFtk 8Tgf3hTZhsxcifyDsHpivtLvHQC4bcPWpLSH3nIrpgUtG44/gPGMQvvxafMULiz3Tnr0 OsA0OCrU0OnnJAXWuI8I5VddkxUJETxiFAquQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467873; x=1692059873; 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=bDaJAhdE1RnADR3cQrx9bhABEuQkgJ1zoWvoaiIwnlE=; b=lQ6j4A+RdVjxmssID7SqrueQBTFUgzfF8lzVks02zAc72d3JxpHJPHrUdpWvFHadWM wp9fsz7ySfRRlpHAcCOYeAhoPUidz0LYE2GRCVA/jX3aOzvjLSkW9vgc1+EOmIetwldj xbSR1hkAWLmD5LnxCA9FC2yNsamYs+AzG9I++GxF8yw06iDV+dZWfNVaUaN0ofIN714l Svo5dnJiIfiGcviLTXP+hzOm6DfoQqarJ1W6kJoE+wntpXs6SGke8gs6mqUpCTlLnP+K H1CA8YjcQm2ETjTHLqsXhK3jxsm1KhQAlQ0NNhbDknc0e6/77ICvq8qdO8mEL8+h3pZS gQ7Q== X-Gm-Message-State: ABy/qLbRxx98MiJ4n72u7nIdvtc/DvZV7DdRDmJZU6MDeEfiu9MdRCAR tUww3EswoqVAJsFLZiVU+WL5dQDgq/qpqQTEkeo= X-Google-Smtp-Source: APBJJlF6QDdmfZaQhWO1wQ6w+Vap8McDM8xCRDm6XOwm+QLS9ZDxGURa+5ZI7U/4ih+6RJ5Ij9qhxA== X-Received: by 2002:a92:d68c:0:b0:346:3eec:c893 with SMTP id p12-20020a92d68c000000b003463eecc893mr8691559iln.0.1689467872863; Sat, 15 Jul 2023 17:37:52 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 17:37:52 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v3 42/81] buildman: Move remaining builder properties to constructor Date: Sat, 15 Jul 2023 18:36:10 -0600 Message-ID: <20230716003718.231903-43-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 Do these all in the constructor, so it is consistent. Move the stray builder comment into the correct place. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/builder.py | 25 ++++++++++++++++++------- tools/buildman/control.py | 18 +++++++----------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index d81752e99438..cb3628a8a085 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -255,7 +255,10 @@ class Builder: config_only=False, squash_config_y=False, warnings_as_errors=False, work_in_output=False, test_thread_exceptions=False, adjust_cfg=None, - allow_missing=False, no_lto=False, reproducible_builds=False): + allow_missing=False, no_lto=False, reproducible_builds=False, + force_build=False, force_build_failures=False, + force_reconfig=False, in_tree=False, + force_config_on_failure=False, make_func=None): """Create a new Builder object Args: @@ -295,7 +298,14 @@ class Builder: a string Kconfig allow_missing: Run build with BINMAN_ALLOW_MISSING=1 no_lto (bool): True to set the NO_LTO flag when building - + force_build (bool): Rebuild even commits that are already built + force_build_failures (bool): Rebuild commits that have not been + built, or failed to build + force_reconfig (bool): Reconfigure on each commit + in_tree (bool): Bulid in tree instead of out-of-tree + force_config_on_failure (bool): Reconfigure the build before + retrying a failed build + make_func (function): Function to call to run 'make' """ self.toolchains = toolchains self.base_dir = base_dir @@ -304,7 +314,7 @@ class Builder: else: self._working_dir = os.path.join(base_dir, '.bm-work') self.threads = [] - self.do_make = self.Make + self.do_make = make_func or self.Make self.gnu_make = gnu_make self.checkout = checkout self.num_threads = num_threads @@ -318,11 +328,7 @@ class Builder: self._complete_delay = None self._next_delay_update = datetime.now() self._start_time = datetime.now() - self.force_config_on_failure = True - self.force_build_failures = False - self.force_reconfig = False self._step = step - self.in_tree = False self._error_lines = 0 self.no_subdirs = no_subdirs self.full_path = full_path @@ -336,6 +342,11 @@ class Builder: self._ide = False self.no_lto = no_lto self.reproducible_builds = reproducible_builds + self.force_build = force_build + self.force_build_failures = force_build_failures + self.force_reconfig = force_reconfig + self.in_tree = in_tree + self.force_config_on_failure = force_config_on_failure if not self.squash_config_y: self.config_filenames += EXTRA_CONFIG_FILENAMES diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 44a96cfb7a06..ece54ccb09da 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -545,8 +545,6 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None, options.no_allow_missing, len(selected), options.branch) - # Create a new builder with the selected options. - adjust_cfg = cfgutil.convert_list_to_dict(options.adjust_cfg) # Drop LOCALVERSION_AUTO since it changes the version string on every commit @@ -557,6 +555,7 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None, else: adjust_cfg['LOCALVERSION_AUTO'] = '~' + # Create a new builder with the selected options builder = Builder(toolchains, output_dir, git_dir, options.threads, options.jobs, gnu_make=gnu_make, checkout=True, show_unknown=options.show_unknown, step=options.step, @@ -571,16 +570,13 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None, test_thread_exceptions=test_thread_exceptions, adjust_cfg=adjust_cfg, allow_missing=allow_missing, no_lto=options.no_lto, - reproducible_builds=options.reproducible_builds) + reproducible_builds=options.reproducible_builds, + force_build = options.force_build, + force_build_failures = options.force_build_failures, + force_reconfig = options.force_reconfig, in_tree = options.in_tree, + force_config_on_failure=not options.quick, make_func=make_func) + TEST_BUILDER = builder - builder.force_config_on_failure = not options.quick - if make_func: - builder.do_make = make_func - - builder.force_build = options.force_build - builder.force_build_failures = options.force_build_failures - builder.force_reconfig = options.force_reconfig - builder.in_tree = options.in_tree # Work out which boards to build board_selected = brds.get_selected_dict() -- 2.41.0.455.g037347b96a-goog