Skip to contentSkip to conversation

Attempt to collect standard extensions for build output

PATCH In review Simon Glass 2 participants 10 messages Sep 7, 2023 – Sep 23, 2023 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

v2 cover Attempt to collect standard extensions for build output

We would like 'buildman -k' to keep the build outputs. This series tries to do this by adding more common extensions to the list.

It also includes a few minor fixes.

Changes in v2:
- Redo patch based on dropping the binman restriction

Simon Glass (4):
buildman: Keep all common output files
buildman: Show progress when regenerating the board.cfg file
buildman: Start the clock when the build starts
kontron_sl28: Use u-boot-update.bin instead of u-boot.update

 arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi |  2 +-
 doc/board/kontron/sl28.rst                        |  4 ++--
 tools/buildman/boards.py                          | 15 ++++++++++++---
 tools/buildman/builder.py                         |  3 ++-
 tools/buildman/builderthread.py                   | 12 ++++++++----
 tools/buildman/control.py                         |  3 ++-
 6 files changed, 27 insertions(+), 12 deletions(-)
Signature · 1 line
2.42.0.283.g2d96d420d3-goog
#1 lore raw

PATCH v2 1/4 buildman: Keep all common output files

Make a list of common output extensions and use it to ensure that the -k option preserves all of these.

---

Changes in v2:
- Redo patch based on dropping the binman restriction

 tools/buildman/builderthread.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
tools/buildman/builderthread.py +8 -4
index 25f460c207db..6a61f64da1d4 100644
@@ -23,6 +23,9 @@ from u_boot_pylib import command
 RETURN_CODE_RETRY = -1
 BASE_ELF_FILENAMES = ['u-boot', 'spl/u-boot-spl', 'tpl/u-boot-tpl']
 
+# Common extensions for images
+COMMON_EXTS = ['.bin', '.rom', '.itb', '.img']
+
 def mkdir(dirname, parents=False):
     """Make a directory if it doesn't already exist.
 
@@ -636,10 +639,11 @@ class BuilderThread(threading.Thread):
 
             # Now write the actual build output
             if keep_outputs:
-                copy_files(
-                    result.out_dir, build_dir, '',
-                    ['u-boot*', '*.bin', '*.map', '*.img', 'MLO', 'SPL',
-                     'include/autoconf.mk', 'spl/u-boot-spl*'])
+                to_copy = ['u-boot*', '*.map', 'MLO', 'SPL',
+                           'include/autoconf.mk', 'spl/u-boot-spl*',
+                           'tpl/u-boot-tpl*', 'vpl/u-boot-vpl*']
+                to_copy += [f'*{ext}' for ext in COMMON_EXTS]
+                copy_files(result.out_dir, build_dir, '', to_copy)
 
     def _send_result(self, result):
         """Send a result to the builder for processing
Signature · 1 line
2.42.0.283.g2d96d420d3-goog
#4 lore raw

PATCH v2 2/4 buildman: Show progress when regenerating the board.cfg file

In reply to Simon Glass

This can take a while, so show a message when starting.

Reported-by Tom Rini <[email protected]>
---

(no changes since v1)

 tools/buildman/boards.py  | 15 ++++++++++++---
 tools/buildman/control.py |  3 ++-
 2 files changed, 14 insertions(+), 4 deletions(-)
tools/buildman/boards.py +12 -3
index eef3f19f7ad6..341a5056dfd2 100644
@@ -19,6 +19,7 @@ import time
 from buildman import board
 from buildman import kconfiglib
 
+from u_boot_pylib.terminal import print_clear, tprint
 
 ### constant variables ###
 OUTPUT_FILE = 'boards.cfg'
@@ -863,11 +864,19 @@ class Boards:
         Returns:
             bool: True if all is well, False if there were warnings
         """
-        if not force and output_is_new(output, CONFIG_DIR, '.'):
+        if not force:
             if not quiet:
-                print(f'{output} is up to date. Nothing to do.')
-            return True
+                tprint('\rChecking for Kconfig changes...', newline=False)
+            is_new = output_is_new(output, CONFIG_DIR, '.')
+            print_clear()
+            if is_new:
+                if not quiet:
+                    print(f'{output} is up to date. Nothing to do.')
+                return True
+        if not quiet:
+            tprint('\rGenerating board list...', newline=False)
         params_list, warnings = self.build_board_list(CONFIG_DIR, '.', jobs)
+        print_clear()
         for warn in warnings:
             print(warn, file=sys.stderr)
         self.format_and_output(params_list, output)
tools/buildman/control.py +2 -1
index f2ffb7f5b4aa..8f6850c52113 100644
@@ -621,7 +621,8 @@ def do_buildman(args, toolchains=None, make_func=None, brds=None,
     if not brds:
         brds = get_boards_obj(output_dir, args.regen_board_list,
                               args.maintainer_check, args.full_check,
-                              args.threads, args.verbose)
+                              args.threads, args.verbose and
+                              not args.print_arch and not args.print_prefix)
         if isinstance(brds, int):
             return brds
 
Signature · 1 line
2.42.0.283.g2d96d420d3-goog
#5 lore raw

Re: [PATCH v2 2/4] buildman: Show progress when regenerating the board.cfg file

This can take a while, so show a message when starting.

Reported-by Tom Rini <[email protected]>
---

(no changes since v1)

 tools/buildman/boards.py  | 15 ++++++++++++---
 tools/buildman/control.py |  3 ++-
 2 files changed, 14 insertions(+), 4 deletions(-)

Applied to u-boot-dm/next, thanks!

#6 lore raw

PATCH v2 3/4 buildman: Start the clock when the build starts

In reply to Simon Glass

The Kconfig and maintainer processing can take a while, sometimes 5 seconds or more. This skews the timing printed by buildmand when the build completes. Start the clock when the threads start to avoid this problem.

---

(no changes since v1)

 tools/buildman/builder.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/buildman/builder.py +2 -1
index ecbd368c47a5..5305477c5be6 100644
@@ -328,7 +328,7 @@ class Builder:
         self._build_period_us = None
         self._complete_delay = None
         self._next_delay_update = datetime.now()
-        self._start_time = datetime.now()
+        self._start_time = None
         self._step = step
         self._error_lines = 0
         self.no_subdirs = no_subdirs
@@ -1778,6 +1778,7 @@ class Builder:
         self._prepare_output_space()
         if not self._ide:
             tprint('\rStarting build...', newline=False)
+        self._start_time = datetime.now()
         self.setup_build(board_selected, commits)
         self.process_result(None)
         self.thread_exceptions = []
Signature · 1 line
2.42.0.283.g2d96d420d3-goog
#7 lore raw

Re: [PATCH v2 3/4] buildman: Start the clock when the build starts

The Kconfig and maintainer processing can take a while, sometimes 5 seconds or more. This skews the timing printed by buildmand when the build completes. Start the clock when the threads start to avoid this problem.

---

(no changes since v1)

 tools/buildman/builder.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to u-boot-dm/next, thanks!

#8 lore raw

PATCH v2 4/4 kontron_sl28: Use u-boot-update.bin instead of u-boot.update

In reply to Simon Glass

A '.update' extension does not get preserved by buildman, so change it.

---

(no changes since v1)

 arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 2 +-
 doc/board/kontron/sl28.rst                        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +1 -1
index 83750ab001b2..aacf181e2dd0 100644
@@ -64,7 +64,7 @@
 
 &binman {
 	u-boot-update {
-		filename = "u-boot.update";
+		filename = "u-boot-update.bin";
 
 		fit {
 			description = "FIT update image";
doc/board/kontron/sl28.rst +2 -2
index 44435d90c624..2cb8ec62be42 100644
@@ -39,12 +39,12 @@ Update image
 ------------
 
 After the build finished, there will be an update image called
-u-boot.update. This can either be used in the DFU mode (which isn't
+u-boot-update.bin. This can either be used in the DFU mode (which isn't
 supported yet) or encapsulated in an EFI UpdateCapsule.
 
 To build the capsule use the following command
 
- $ tools/mkeficapsule -f u-boot.update -i 1 UpdateUboot
+ $ tools/mkeficapsule -f u-boot-update.bin -i 1 UpdateUboot
 
 Afterward you can copy this file to your ESP into the /EFI/UpdateCapsule/
 folder. On the next EFI boot this will automatically update your
Signature · 1 line
2.42.0.283.g2d96d420d3-goog
author Acked-by Michael Walle on v2 4/4
#9 lore raw

Re: [PATCH v2 4/4] kontron_sl28: Use u-boot-update.bin instead of u-boot.update

A '.update' extension does not get preserved by buildman, so change it.

---

(no changes since v1)

 arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 2 +-
 doc/board/kontron/sl28.rst                        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Applied to u-boot-dm/next, thanks!