[PATCH v4 29/83] buildman: Move dry-run handling higher in do_buildman()

Simon Glass sjg at chromium.org
Thu Jul 20 01:48:37 CEST 2023


Move this up above where the builder is created, since it no-longer makes
use of the builder.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 tools/buildman/control.py | 88 ++++++++++++++++++++-------------------
 1 file changed, 45 insertions(+), 43 deletions(-)

diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 0aa19a279628..80f9315a11e4 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -395,6 +395,13 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None,
             output_dir = os.path.join(options.output_dir, dirname)
         if clean_dir and os.path.exists(output_dir):
             shutil.rmtree(output_dir)
+
+    # For a dry run, just show our actions as a sanity check
+    if options.dry_run:
+        show_actions(series, why_selected, selected, output_dir, options,
+                    board_warnings)
+        return 0
+
     adjust_cfg = cfgutil.convert_list_to_dict(options.adjust_cfg)
 
     # Drop LOCALVERSION_AUTO since it changes the version string on every commit
@@ -425,48 +432,43 @@ def do_buildman(options, args, toolchains=None, make_func=None, brds=None,
     if make_func:
         builder.do_make = make_func
 
-    # For a dry run, just show our actions as a sanity check
-    if options.dry_run:
-        show_actions(series, why_selected, selected, output_dir, options,
-                    board_warnings)
+    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()
+
+    if series:
+        commits = series.commits
+        # Number the commits for test purposes
+        for i, commit in enumerate(commits):
+            commit.sequence = i
     else:
-        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()
-
-        if series:
-            commits = series.commits
-            # Number the commits for test purposes
-            for i, commit in enumerate(commits):
-                commit.sequence = i
-        else:
-            commits = None
-
-        if not options.ide:
-            tprint(get_action_summary(options.summary, commits, board_selected,
-                                    options))
-
-        # We can't show function sizes without board details at present
-        if options.show_bloat:
-            options.show_detail = True
-        builder.SetDisplayOptions(
-            options.show_errors, options.show_sizes, options.show_detail,
-            options.show_bloat, options.list_error_boards, options.show_config,
-            options.show_environment, options.filter_dtb_warnings,
-            options.filter_migration_warnings, options.ide)
-        if options.summary:
-            builder.ShowSummary(commits, board_selected)
-        else:
-            fail, warned, excs = builder.BuildBoards(
-                commits, board_selected, options.keep_outputs, options.verbose)
-            if excs:
-                return 102
-            if fail:
-                return 100
-            if warned and not options.ignore_warnings:
-                return 101
+        commits = None
+
+    if not options.ide:
+        tprint(get_action_summary(options.summary, commits, board_selected,
+                                options))
+
+    # We can't show function sizes without board details at present
+    if options.show_bloat:
+        options.show_detail = True
+    builder.SetDisplayOptions(
+        options.show_errors, options.show_sizes, options.show_detail,
+        options.show_bloat, options.list_error_boards, options.show_config,
+        options.show_environment, options.filter_dtb_warnings,
+        options.filter_migration_warnings, options.ide)
+    if options.summary:
+        builder.ShowSummary(commits, board_selected)
+    else:
+        fail, warned, excs = builder.BuildBoards(
+            commits, board_selected, options.keep_outputs, options.verbose)
+        if excs:
+            return 102
+        if fail:
+            return 100
+        if warned and not options.ignore_warnings:
+            return 101
     return 0
-- 
2.41.0.487.g6d72f3e995-goog



More information about the U-Boot mailing list