summaryrefslogtreecommitdiff
path: root/tools/buildman/builderthread.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-20 02:49:17 +0300
committerSimon Glass <sjg@chromium.org>2023-07-24 18:34:11 +0300
commitec2f492e78728d43e06211038185454e7af49011 (patch)
tree026c8736509a8414a856e21df1713b996ac027f1 /tools/buildman/builderthread.py
parentdab3a4a0e32e89001ba9cfaa790ca8fbf15d195b (diff)
downloadu-boot-ec2f492e78728d43e06211038185454e7af49011.tar.xz
buildman: Move reconfigure code into its own function
Split this into its own function so reduce the size of run_commit(). Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman/builderthread.py')
-rw-r--r--tools/buildman/builderthread.py41
1 files changed, 30 insertions, 11 deletions
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index 9c2938d1b0..80fca2a61b 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -191,6 +191,33 @@ class BuilderThread(threading.Thread):
args.extend(self.toolchain.MakeArgs())
return args, cwd, src_dir
+ def _reconfigure(self, commit, brd, cwd, args, env, config_args, config_out,
+ cmd_list):
+ """Reconfigure the build
+
+ Args:
+ commit (Commit): Commit only being built
+ brd (Board): Board being built
+ cwd (str): Current working directory
+ args (list of str): Arguments to pass to make
+ env (dict): Environment strings
+ config_args (list of str): defconfig arg for this board
+ cmd_list (list of str): List to add the commands to, for logging
+
+ Returns:
+ CommandResult object
+ """
+ if self.mrproper:
+ result = self.make(commit, brd, 'mrproper', cwd, 'mrproper', *args,
+ env=env)
+ config_out.write(result.combined)
+ cmd_list.append([self.builder.gnu_make, 'mrproper', *args])
+ result = self.make(commit, brd, 'config', cwd, *(args + config_args),
+ env=env)
+ cmd_list.append([self.builder.gnu_make] + args + config_args)
+ config_out.write(result.combined)
+ return result
+
def run_commit(self, commit_upto, brd, work_dir, do_config, config_only,
force_build, force_build_failures, work_in_output,
adjust_cfg):
@@ -309,17 +336,9 @@ class BuilderThread(threading.Thread):
cfg_file = os.path.join(out_dir, '.config')
cmd_list = []
if do_config or adjust_cfg:
- if self.mrproper:
- result = self.make(commit, brd, 'mrproper', cwd,
- 'mrproper', *args, env=env)
- config_out.write(result.combined)
- cmd_list.append([self.builder.gnu_make, 'mrproper',
- *args])
- result = self.make(commit, brd, 'config', cwd,
- *(args + config_args), env=env)
- cmd_list.append([self.builder.gnu_make] + args +
- config_args)
- config_out.write(result.combined)
+ result = self._reconfigure(
+ commit, brd, cwd, args, env, config_args, config_out,
+ cmd_list)
do_config = False # No need to configure next time
if adjust_cfg:
cfgutil.adjust_cfg_file(cfg_file, adjust_cfg)