control.py 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. # SPDX-License-Identifier: GPL-2.0+
  2. # Copyright (c) 2013 The Chromium OS Authors.
  3. #
  4. """Control module for buildman
  5. This holds the main control logic for buildman, when not running tests.
  6. """
  7. import multiprocessing
  8. import os
  9. import shutil
  10. import sys
  11. from buildman import boards
  12. from buildman import bsettings
  13. from buildman import cfgutil
  14. from buildman import toolchain
  15. from buildman.builder import Builder
  16. from patman import gitutil
  17. from patman import patchstream
  18. from u_boot_pylib import command
  19. from u_boot_pylib import terminal
  20. from u_boot_pylib.terminal import tprint
  21. TEST_BUILDER = None
  22. def get_plural(count):
  23. """Returns a plural 's' if count is not 1"""
  24. return 's' if count != 1 else ''
  25. def count_build_commits(commits, step):
  26. """Calculate the number of commits to be built
  27. Args:
  28. commits (list of Commit): Commits to build or None
  29. step (int): Step value for commits, typically 1
  30. Returns:
  31. Number of commits that will be built
  32. """
  33. if commits:
  34. count = len(commits)
  35. return (count + step - 1) // step
  36. return 0
  37. def get_action_summary(is_summary, commit_count, selected, threads, jobs):
  38. """Return a string summarising the intended action.
  39. Args:
  40. is_summary (bool): True if this is a summary (otherwise it is building)
  41. commits (list): List of commits being built
  42. selected (list of Board): List of Board objects that are marked
  43. step (int): Step increment through commits
  44. threads (int): Number of processor threads being used
  45. jobs (int): Number of jobs to build at once
  46. Returns:
  47. Summary string.
  48. """
  49. if commit_count:
  50. commit_str = f'{commit_count} commit{get_plural(commit_count)}'
  51. else:
  52. commit_str = 'current source'
  53. msg = (f"{'Summary of' if is_summary else 'Building'} "
  54. f'{commit_str} for {len(selected)} boards')
  55. msg += (f' ({threads} thread{get_plural(threads)}, '
  56. f'{jobs} job{get_plural(jobs)} per thread)')
  57. return msg
  58. # pylint: disable=R0913
  59. def show_actions(series, why_selected, boards_selected, output_dir,
  60. board_warnings, step, threads, jobs, verbose):
  61. """Display a list of actions that we would take, if not a dry run.
  62. Args:
  63. series: Series object
  64. why_selected: Dictionary where each key is a buildman argument
  65. provided by the user, and the value is the list of boards
  66. brought in by that argument. For example, 'arm' might bring
  67. in 400 boards, so in this case the key would be 'arm' and
  68. the value would be a list of board names.
  69. boards_selected: Dict of selected boards, key is target name,
  70. value is Board object
  71. output_dir (str): Output directory for builder
  72. board_warnings: List of warnings obtained from board selected
  73. step (int): Step increment through commits
  74. threads (int): Number of processor threads being used
  75. jobs (int): Number of jobs to build at once
  76. verbose (bool): True to indicate why each board was selected
  77. """
  78. col = terminal.Color()
  79. print('Dry run, so not doing much. But I would do this:')
  80. print()
  81. if series:
  82. commits = series.commits
  83. else:
  84. commits = None
  85. print(get_action_summary(False, count_build_commits(commits, step),
  86. boards_selected, threads, jobs))
  87. print(f'Build directory: {output_dir}')
  88. if commits:
  89. for upto in range(0, len(series.commits), step):
  90. commit = series.commits[upto]
  91. print(' ', col.build(col.YELLOW, commit.hash[:8], bright=False), end=' ')
  92. print(commit.subject)
  93. print()
  94. for arg in why_selected:
  95. if arg != 'all':
  96. print(arg, f': {len(why_selected[arg])} boards')
  97. if verbose:
  98. print(f" {' '.join(why_selected[arg])}")
  99. print('Total boards to build for each '
  100. f"commit: {len(why_selected['all'])}\n")
  101. if board_warnings:
  102. for warning in board_warnings:
  103. print(col.build(col.YELLOW, warning))
  104. def show_toolchain_prefix(brds, toolchains):
  105. """Show information about a the tool chain used by one or more boards
  106. The function checks that all boards use the same toolchain, then prints
  107. the correct value for CROSS_COMPILE.
  108. Args:
  109. boards: Boards object containing selected boards
  110. toolchains: Toolchains object containing available toolchains
  111. Return:
  112. None on success, string error message otherwise
  113. """
  114. board_selected = brds.get_selected_dict()
  115. tc_set = set()
  116. for brd in board_selected.values():
  117. tc_set.add(toolchains.Select(brd.arch))
  118. if len(tc_set) != 1:
  119. sys.exit('Supplied boards must share one toolchain')
  120. tchain = tc_set.pop()
  121. print(tchain.GetEnvArgs(toolchain.VAR_CROSS_COMPILE))
  122. def show_arch(brds):
  123. """Show information about a the architecture used by one or more boards
  124. The function checks that all boards use the same architecture, then prints
  125. the correct value for ARCH.
  126. Args:
  127. boards: Boards object containing selected boards
  128. Return:
  129. None on success, string error message otherwise
  130. """
  131. board_selected = brds.get_selected_dict()
  132. arch_set = set()
  133. for brd in board_selected.values():
  134. arch_set.add(brd.arch)
  135. if len(arch_set) != 1:
  136. sys.exit('Supplied boards must share one arch')
  137. print(arch_set.pop())
  138. def get_allow_missing(opt_allow, opt_no_allow, num_selected, has_branch):
  139. """Figure out whether to allow external blobs
  140. Uses the allow-missing setting and the provided arguments to decide whether
  141. missing external blobs should be allowed
  142. Args:
  143. opt_allow (bool): True if --allow-missing flag is set
  144. opt_no_allow (bool): True if --no-allow-missing flag is set
  145. num_selected (int): Number of selected board
  146. has_branch (bool): True if a git branch (to build) has been provided
  147. Returns:
  148. bool: True to allow missing external blobs, False to produce an error if
  149. external blobs are used
  150. """
  151. allow_missing = False
  152. am_setting = bsettings.get_global_item_value('allow-missing')
  153. if am_setting:
  154. if am_setting == 'always':
  155. allow_missing = True
  156. if 'multiple' in am_setting and num_selected > 1:
  157. allow_missing = True
  158. if 'branch' in am_setting and has_branch:
  159. allow_missing = True
  160. if opt_allow:
  161. allow_missing = True
  162. if opt_no_allow:
  163. allow_missing = False
  164. return allow_missing
  165. def count_commits(branch, count, col, git_dir):
  166. """Could the number of commits in the branch/ranch being built
  167. Args:
  168. branch (str): Name of branch to build, or None if none
  169. count (int): Number of commits to build, or -1 for all
  170. col (Terminal.Color): Color object to use
  171. git_dir (str): Git directory to use, e.g. './.git'
  172. Returns:
  173. tuple:
  174. Number of commits being built
  175. True if the 'branch' string contains a range rather than a simple
  176. name
  177. """
  178. has_range = branch and '..' in branch
  179. if count == -1:
  180. if not branch:
  181. count = 1
  182. else:
  183. if has_range:
  184. count, msg = gitutil.count_commits_in_range(git_dir, branch)
  185. else:
  186. count, msg = gitutil.count_commits_in_branch(git_dir, branch)
  187. if count is None:
  188. sys.exit(col.build(col.RED, msg))
  189. elif count == 0:
  190. sys.exit(col.build(col.RED,
  191. f"Range '{branch}' has no commits"))
  192. if msg:
  193. print(col.build(col.YELLOW, msg))
  194. count += 1 # Build upstream commit also
  195. if not count:
  196. msg = (f"No commits found to process in branch '{branch}': "
  197. "set branch's upstream or use -c flag")
  198. sys.exit(col.build(col.RED, msg))
  199. return count, has_range
  200. def determine_series(selected, col, git_dir, count, branch, work_in_output):
  201. """Determine the series which is to be built, if any
  202. If there is a series, the commits in that series are numbered by setting
  203. their sequence value (starting from 0). This is used by tests.
  204. Args:
  205. selected (list of Board): List of Board objects that are marked
  206. selected
  207. col (Terminal.Color): Color object to use
  208. git_dir (str): Git directory to use, e.g. './.git'
  209. count (int): Number of commits in branch
  210. branch (str): Name of branch to build, or None if none
  211. work_in_output (bool): True to work in the output directory
  212. Returns:
  213. Series: Series to build, or None for none
  214. Read the metadata from the commits. First look at the upstream commit,
  215. then the ones in the branch. We would like to do something like
  216. upstream/master~..branch but that isn't possible if upstream/master is
  217. a merge commit (it will list all the commits that form part of the
  218. merge)
  219. Conflicting tags are not a problem for buildman, since it does not use
  220. them. For example, Series-version is not useful for buildman. On the
  221. other hand conflicting tags will cause an error. So allow later tags
  222. to overwrite earlier ones by setting allow_overwrite=True
  223. """
  224. # Work out how many commits to build. We want to build everything on the
  225. # branch. We also build the upstream commit as a control so we can see
  226. # problems introduced by the first commit on the branch.
  227. count, has_range = count_commits(branch, count, col, git_dir)
  228. if work_in_output:
  229. if len(selected) != 1:
  230. sys.exit(col.build(col.RED,
  231. '-w can only be used with a single board'))
  232. if count != 1:
  233. sys.exit(col.build(col.RED,
  234. '-w can only be used with a single commit'))
  235. if branch:
  236. if count == -1:
  237. if has_range:
  238. range_expr = branch
  239. else:
  240. range_expr = gitutil.get_range_in_branch(git_dir, branch)
  241. upstream_commit = gitutil.get_upstream(git_dir, branch)
  242. series = patchstream.get_metadata_for_list(upstream_commit,
  243. git_dir, 1, series=None, allow_overwrite=True)
  244. series = patchstream.get_metadata_for_list(range_expr,
  245. git_dir, None, series, allow_overwrite=True)
  246. else:
  247. # Honour the count
  248. series = patchstream.get_metadata_for_list(branch,
  249. git_dir, count, series=None, allow_overwrite=True)
  250. # Number the commits for test purposes
  251. for i, commit in enumerate(series.commits):
  252. commit.sequence = i
  253. else:
  254. series = None
  255. return series
  256. def do_fetch_arch(toolchains, col, fetch_arch):
  257. """Handle the --fetch-arch option
  258. Args:
  259. toolchains (Toolchains): Tool chains to use
  260. col (terminal.Color): Color object to build
  261. fetch_arch (str): Argument passed to the --fetch-arch option
  262. Returns:
  263. int: Return code for buildman
  264. """
  265. if fetch_arch == 'list':
  266. sorted_list = toolchains.ListArchs()
  267. print(col.build(
  268. col.BLUE,
  269. f"Available architectures: {' '.join(sorted_list)}\n"))
  270. return 0
  271. if fetch_arch == 'all':
  272. fetch_arch = ','.join(toolchains.ListArchs())
  273. print(col.build(col.CYAN,
  274. f'\nDownloading toolchains: {fetch_arch}'))
  275. for arch in fetch_arch.split(','):
  276. print()
  277. ret = toolchains.FetchAndInstall(arch)
  278. if ret:
  279. return ret
  280. return 0
  281. def get_toolchains(toolchains, col, override_toolchain, fetch_arch,
  282. list_tool_chains, verbose):
  283. """Get toolchains object to use
  284. Args:
  285. toolchains (Toolchains or None): Toolchains to use. If None, then a
  286. Toolchains object will be created and scanned
  287. col (Terminal.Color): Color object
  288. override_toolchain (str or None): Override value for toolchain, or None
  289. fetch_arch (bool): True to fetch the toolchain for the architectures
  290. list_tool_chains (bool): True to list all tool chains
  291. verbose (bool): True for verbose output when listing toolchains
  292. Returns:
  293. Either:
  294. int: Operation completed and buildman should exit with exit code
  295. Toolchains: Toolchains object to use
  296. """
  297. no_toolchains = toolchains is None
  298. if no_toolchains:
  299. toolchains = toolchain.Toolchains(override_toolchain)
  300. if fetch_arch:
  301. return do_fetch_arch(toolchains, col, fetch_arch)
  302. if no_toolchains:
  303. toolchains.GetSettings()
  304. toolchains.Scan(list_tool_chains and verbose)
  305. if list_tool_chains:
  306. toolchains.List()
  307. print()
  308. return 0
  309. return toolchains
  310. def get_boards_obj(output_dir, regen_board_list, maintainer_check, full_check,
  311. threads, verbose):
  312. """Object the Boards object to use
  313. Creates the output directory and ensures there is a boards.cfg file, then
  314. read it in.
  315. Args:
  316. output_dir (str): Output directory to use
  317. regen_board_list (bool): True to just regenerate the board list
  318. maintainer_check (bool): True to just run a maintainer check
  319. full_check (bool): True to just run a full check of Kconfig and
  320. maintainers
  321. threads (int or None): Number of threads to use to create boards file
  322. verbose (bool): False to suppress output from boards-file generation
  323. Returns:
  324. Either:
  325. int: Operation completed and buildman should exit with exit code
  326. Boards: Boards object to use
  327. """
  328. brds = boards.Boards()
  329. nr_cpus = threads or multiprocessing.cpu_count()
  330. if maintainer_check or full_check:
  331. warnings = brds.build_board_list(jobs=nr_cpus,
  332. warn_targets=full_check)[1]
  333. if warnings:
  334. for warn in warnings:
  335. print(warn, file=sys.stderr)
  336. return 2
  337. return 0
  338. if not os.path.exists(output_dir):
  339. os.makedirs(output_dir)
  340. board_file = os.path.join(output_dir, 'boards.cfg')
  341. if regen_board_list and regen_board_list != '-':
  342. board_file = regen_board_list
  343. okay = brds.ensure_board_list(board_file, nr_cpus, force=regen_board_list,
  344. quiet=not verbose)
  345. if regen_board_list:
  346. return 0 if okay else 2
  347. brds.read_boards(board_file)
  348. return brds
  349. def determine_boards(brds, args, col, opt_boards, exclude_list):
  350. """Determine which boards to build
  351. Each element of args and exclude can refer to a board name, arch or SoC
  352. Args:
  353. brds (Boards): Boards object
  354. args (list of str): Arguments describing boards to build
  355. col (Terminal.Color): Color object
  356. opt_boards (list of str): Specific boards to build, or None for all
  357. exclude_list (list of str): Arguments describing boards to exclude
  358. Returns:
  359. tuple:
  360. list of Board: List of Board objects that are marked selected
  361. why_selected: Dictionary where each key is a buildman argument
  362. provided by the user, and the value is the list of boards
  363. brought in by that argument. For example, 'arm' might bring
  364. in 400 boards, so in this case the key would be 'arm' and
  365. the value would be a list of board names.
  366. board_warnings: List of warnings obtained from board selected
  367. """
  368. exclude = []
  369. if exclude_list:
  370. for arg in exclude_list:
  371. exclude += arg.split(',')
  372. if opt_boards:
  373. requested_boards = []
  374. for brd in opt_boards:
  375. requested_boards += brd.split(',')
  376. else:
  377. requested_boards = None
  378. why_selected, board_warnings = brds.select_boards(args, exclude,
  379. requested_boards)
  380. selected = brds.get_selected()
  381. if not selected:
  382. sys.exit(col.build(col.RED, 'No matching boards found'))
  383. return selected, why_selected, board_warnings
  384. def adjust_args(args, series, selected):
  385. """Adjust arguments according to various constraints
  386. Updates verbose, show_errors, threads, jobs and step
  387. Args:
  388. args (Namespace): Namespace object to adjust
  389. series (Series): Series being built / summarised
  390. selected (list of Board): List of Board objects that are marked
  391. """
  392. if not series and not args.dry_run:
  393. args.verbose = True
  394. if not args.summary:
  395. args.show_errors = True
  396. # By default we have one thread per CPU. But if there are not enough jobs
  397. # we can have fewer threads and use a high '-j' value for make.
  398. if args.threads is None:
  399. args.threads = min(multiprocessing.cpu_count(), len(selected))
  400. if not args.jobs:
  401. args.jobs = max(1, (multiprocessing.cpu_count() +
  402. len(selected) - 1) // len(selected))
  403. if not args.step:
  404. args.step = len(series.commits) - 1
  405. # We can't show function sizes without board details at present
  406. if args.show_bloat:
  407. args.show_detail = True
  408. def setup_output_dir(output_dir, work_in_output, branch, no_subdirs, col,
  409. clean_dir):
  410. """Set up the output directory
  411. Args:
  412. output_dir (str): Output directory provided by the user, or None if none
  413. work_in_output (bool): True to work in the output directory
  414. branch (str): Name of branch to build, or None if none
  415. no_subdirs (bool): True to put the output in the top-level output dir
  416. clean_dir: Used for tests only, indicates that the existing output_dir
  417. should be removed before starting the build
  418. Returns:
  419. str: Updated output directory pathname
  420. """
  421. if not output_dir:
  422. if work_in_output:
  423. sys.exit(col.build(col.RED, '-w requires that you specify -o'))
  424. output_dir = '..'
  425. if branch and not no_subdirs:
  426. # As a special case allow the board directory to be placed in the
  427. # output directory itself rather than any subdirectory.
  428. dirname = branch.replace('/', '_')
  429. output_dir = os.path.join(output_dir, dirname)
  430. if clean_dir and os.path.exists(output_dir):
  431. shutil.rmtree(output_dir)
  432. return output_dir
  433. def run_builder(builder, commits, board_selected, args):
  434. """Run the builder or show the summary
  435. Args:
  436. commits (list of Commit): List of commits being built, None if no branch
  437. boards_selected (dict): Dict of selected boards:
  438. key: target name
  439. value: Board object
  440. args (Namespace): Namespace to use
  441. Returns:
  442. int: Return code for buildman
  443. """
  444. gnu_make = command.output(os.path.join(args.git,
  445. 'scripts/show-gnu-make'), raise_on_error=False).rstrip()
  446. if not gnu_make:
  447. sys.exit('GNU Make not found')
  448. builder.gnu_make = gnu_make
  449. if not args.ide:
  450. commit_count = count_build_commits(commits, args.step)
  451. tprint(get_action_summary(args.summary, commit_count, board_selected,
  452. args.threads, args.jobs))
  453. builder.set_display_options(
  454. args.show_errors, args.show_sizes, args.show_detail, args.show_bloat,
  455. args.list_error_boards, args.show_config, args.show_environment,
  456. args.filter_dtb_warnings, args.filter_migration_warnings, args.ide)
  457. if args.summary:
  458. builder.show_summary(commits, board_selected)
  459. else:
  460. fail, warned, excs = builder.build_boards(
  461. commits, board_selected, args.keep_outputs, args.verbose)
  462. if excs:
  463. return 102
  464. if fail:
  465. return 100
  466. if warned and not args.ignore_warnings:
  467. return 101
  468. return 0
  469. def calc_adjust_cfg(adjust_cfg, reproducible_builds):
  470. """Calculate the value to use for adjust_cfg
  471. Args:
  472. adjust_cfg (list of str): List of configuration changes. See cfgutil for
  473. details
  474. reproducible_builds (bool): True to adjust the configuration to get
  475. reproduceable builds
  476. Returns:
  477. adjust_cfg (list of str): List of configuration changes
  478. """
  479. adjust_cfg = cfgutil.convert_list_to_dict(adjust_cfg)
  480. # Drop LOCALVERSION_AUTO since it changes the version string on every commit
  481. if reproducible_builds:
  482. # If these are mentioned, leave the local version alone
  483. if 'LOCALVERSION' in adjust_cfg or 'LOCALVERSION_AUTO' in adjust_cfg:
  484. print('Not dropping LOCALVERSION_AUTO for reproducible build')
  485. else:
  486. adjust_cfg['LOCALVERSION_AUTO'] = '~'
  487. return adjust_cfg
  488. def do_buildman(args, toolchains=None, make_func=None, brds=None,
  489. clean_dir=False, test_thread_exceptions=False):
  490. """The main control code for buildman
  491. Args:
  492. args: ArgumentParser object
  493. args: Command line arguments (list of strings)
  494. toolchains: Toolchains to use - this should be a Toolchains()
  495. object. If None, then it will be created and scanned
  496. make_func: Make function to use for the builder. This is called
  497. to execute 'make'. If this is None, the normal function
  498. will be used, which calls the 'make' tool with suitable
  499. arguments. This setting is useful for tests.
  500. brds: Boards() object to use, containing a list of available
  501. boards. If this is None it will be created and scanned.
  502. clean_dir: Used for tests only, indicates that the existing output_dir
  503. should be removed before starting the build
  504. test_thread_exceptions: Uses for tests only, True to make the threads
  505. raise an exception instead of reporting their result. This simulates
  506. a failure in the code somewhere
  507. """
  508. # Used so testing can obtain the builder: pylint: disable=W0603
  509. global TEST_BUILDER
  510. gitutil.setup()
  511. col = terminal.Color()
  512. git_dir = os.path.join(args.git, '.git')
  513. toolchains = get_toolchains(toolchains, col, args.override_toolchain,
  514. args.fetch_arch, args.list_tool_chains,
  515. args.verbose)
  516. if isinstance(toolchains, int):
  517. return toolchains
  518. output_dir = setup_output_dir(
  519. args.output_dir, args.work_in_output, args.branch,
  520. args.no_subdirs, col, clean_dir)
  521. # Work out what subset of the boards we are building
  522. if not brds:
  523. brds = get_boards_obj(output_dir, args.regen_board_list,
  524. args.maintainer_check, args.full_check,
  525. args.threads, args.verbose)
  526. if isinstance(brds, int):
  527. return brds
  528. selected, why_selected, board_warnings = determine_boards(
  529. brds, args.terms, col, args.boards, args.exclude)
  530. if args.print_prefix:
  531. show_toolchain_prefix(brds, toolchains)
  532. return 0
  533. if args.print_arch:
  534. show_arch(brds)
  535. return 0
  536. series = determine_series(selected, col, git_dir, args.count,
  537. args.branch, args.work_in_output)
  538. adjust_args(args, series, selected)
  539. # For a dry run, just show our actions as a sanity check
  540. if args.dry_run:
  541. show_actions(series, why_selected, selected, output_dir, board_warnings,
  542. args.step, args.threads, args.jobs,
  543. args.verbose)
  544. return 0
  545. # Create a new builder with the selected args
  546. builder = Builder(toolchains, output_dir, git_dir,
  547. args.threads, args.jobs, checkout=True,
  548. show_unknown=args.show_unknown, step=args.step,
  549. no_subdirs=args.no_subdirs, full_path=args.full_path,
  550. verbose_build=args.verbose_build,
  551. mrproper=args.mrproper,
  552. per_board_out_dir=args.per_board_out_dir,
  553. config_only=args.config_only,
  554. squash_config_y=not args.preserve_config_y,
  555. warnings_as_errors=args.warnings_as_errors,
  556. work_in_output=args.work_in_output,
  557. test_thread_exceptions=test_thread_exceptions,
  558. adjust_cfg=calc_adjust_cfg(args.adjust_cfg,
  559. args.reproducible_builds),
  560. allow_missing=get_allow_missing(args.allow_missing,
  561. args.no_allow_missing,
  562. len(selected), args.branch),
  563. no_lto=args.no_lto,
  564. reproducible_builds=args.reproducible_builds,
  565. force_build = args.force_build,
  566. force_build_failures = args.force_build_failures,
  567. force_reconfig = args.force_reconfig, in_tree = args.in_tree,
  568. force_config_on_failure=not args.quick, make_func=make_func)
  569. TEST_BUILDER = builder
  570. return run_builder(builder, series.commits if series else None,
  571. brds.get_selected_dict(), args)