summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-12-05 15:59:13 -0700
committerSimon Glass <sjg@chromium.org>2019-12-10 21:11:31 -0700
commit7c66ead45267122c48bc854d1d5bd0d9a99bf943 (patch)
tree0078af9a16dc6917df4d181161381e3fb50dc815 /tools
parent6a3fc91ea7fdf3f6e35c92eb02c9c73fb9f42d04 (diff)
buildman: Figure out boards before commits
At present buildman looks at toolchains, then commits and then boards. Move the board processing up above the commit processing, since it relates to the toolchain code. This will make it easier to check the toolchains needed for a board without processing commits first. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/buildman/control.py59
1 files changed, 29 insertions, 30 deletions
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 3b41d7b26a..a9c5022e48 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -170,35 +170,6 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
print()
return 0
- # Work out how many commits to build. We want to build everything on the
- # branch. We also build the upstream commit as a control so we can see
- # problems introduced by the first commit on the branch.
- count = options.count
- has_range = options.branch and '..' in options.branch
- if count == -1:
- if not options.branch:
- count = 1
- else:
- if has_range:
- count, msg = gitutil.CountCommitsInRange(options.git_dir,
- options.branch)
- else:
- count, msg = gitutil.CountCommitsInBranch(options.git_dir,
- options.branch)
- if count is None:
- sys.exit(col.Color(col.RED, msg))
- elif count == 0:
- sys.exit(col.Color(col.RED, "Range '%s' has no commits" %
- options.branch))
- if msg:
- print(col.Color(col.YELLOW, msg))
- count += 1 # Build upstream commit also
-
- if not count:
- str = ("No commits found to process in branch '%s': "
- "set branch's upstream or use -c flag" % options.branch)
- sys.exit(col.Color(col.RED, str))
-
# Work out what subset of the boards we are building
if not boards:
if not os.path.exists(options.output_dir):
@@ -217,7 +188,6 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
for arg in options.exclude:
exclude += arg.split(',')
-
if options.boards:
requested_boards = []
for b in options.boards:
@@ -230,6 +200,35 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
if not len(selected):
sys.exit(col.Color(col.RED, 'No matching boards found'))
+ # Work out how many commits to build. We want to build everything on the
+ # branch. We also build the upstream commit as a control so we can see
+ # problems introduced by the first commit on the branch.
+ count = options.count
+ has_range = options.branch and '..' in options.branch
+ if count == -1:
+ if not options.branch:
+ count = 1
+ else:
+ if has_range:
+ count, msg = gitutil.CountCommitsInRange(options.git_dir,
+ options.branch)
+ else:
+ count, msg = gitutil.CountCommitsInBranch(options.git_dir,
+ options.branch)
+ if count is None:
+ sys.exit(col.Color(col.RED, msg))
+ elif count == 0:
+ sys.exit(col.Color(col.RED, "Range '%s' has no commits" %
+ options.branch))
+ if msg:
+ print(col.Color(col.YELLOW, msg))
+ count += 1 # Build upstream commit also
+
+ if not count:
+ str = ("No commits found to process in branch '%s': "
+ "set branch's upstream or use -c flag" % options.branch)
+ sys.exit(col.Color(col.RED, str))
+
# Read the metadata from the commits. First look at the upstream commit,
# then the ones in the branch. We would like to do something like
# upstream/master~..branch but that isn't possible if upstream/master is