Skip to content
Snippets Groups Projects
Commit 7c66ead4 authored by Simon Glass's avatar Simon Glass
Browse files

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: default avatarSimon Glass <sjg@chromium.org>
parent 6a3fc91e
No related branches found
No related tags found
No related merge requests found
...@@ -170,35 +170,6 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None, ...@@ -170,35 +170,6 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
print() print()
return 0 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 # Work out what subset of the boards we are building
if not boards: if not boards:
if not os.path.exists(options.output_dir): if not os.path.exists(options.output_dir):
...@@ -217,7 +188,6 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None, ...@@ -217,7 +188,6 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
for arg in options.exclude: for arg in options.exclude:
exclude += arg.split(',') exclude += arg.split(',')
if options.boards: if options.boards:
requested_boards = [] requested_boards = []
for b in options.boards: for b in options.boards:
...@@ -230,6 +200,35 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None, ...@@ -230,6 +200,35 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
if not len(selected): if not len(selected):
sys.exit(col.Color(col.RED, 'No matching boards found')) 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, # 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 # 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 # upstream/master~..branch but that isn't possible if upstream/master is
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment