diff options
author | Simon Glass | 2022-07-11 19:04:04 -0600 |
---|---|---|
committer | Tom Rini | 2022-08-05 11:47:56 -0400 |
commit | a8a0141bc2c15fafd5afc96a089e9b2c6a0df340 (patch) | |
tree | 8fab37eb6498a12bba67df6aee865a6b9a6ef1cc /tools/buildman/control.py | |
parent | c52bd22539f3bb009f73cc1608b155813f7e48a0 (diff) |
buildman: Incorporate the genboardscfg.py tool
Bring this tool into buildman, so we don't have to run it separately. The
board.cfg file is still produced as part of the build, to save time when
doing another build in the same working directory. If it is out of date
with respect to the Kconfig, it is updated.
Time to regenerate on a recent single-thread machine is 4.6s (1.3s on a
32-thread machine), so we do need some sort of cache if we want buildman
to be useful on incremental builds. We could use Python's pickle format
but:
- it seems useful to allow boards.cfg to be regenerated, at least for a
while, in case other tools use it
- it is possible to grep the file easily, e.g. to find boards which use
a particular SoC (similar to 'buildman -nv <soc>'
Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/buildman/control.py')
-rw-r--r-- | tools/buildman/control.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/tools/buildman/control.py b/tools/buildman/control.py index 8d3e781d51a..79ce2f6978a 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -186,18 +186,14 @@ def DoBuildman(options, args, toolchains=None, make_func=None, brds=None, if not os.path.exists(options.output_dir): os.makedirs(options.output_dir) board_file = os.path.join(options.output_dir, 'boards.cfg') - our_path = os.path.dirname(os.path.realpath(__file__)) - genboardscfg = os.path.join(our_path, '../genboardscfg.py') - if not os.path.exists(genboardscfg): - genboardscfg = os.path.join(options.git, 'tools/genboardscfg.py') - status = subprocess.call([genboardscfg, '-q', '-o', board_file]) - if status != 0: - # Older versions don't support -q - status = subprocess.call([genboardscfg, '-o', board_file]) - if status != 0: - sys.exit("Failed to generate boards.cfg") brds = boards.Boards() + brds.ensure_board_list(board_file, + options.threads or multiprocessing.cpu_count(), + force=options.regen_board_list, + quiet=not options.verbose) + if options.regen_board_list: + return 0 brds.read_boards(board_file) exclude = [] |