8000 Merge pull request #3203 from WarriorOfWire/speed_up_builds · cwalther/circuitpython@fbc7897 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fbc7897

Browse files
authored
Merge pull request adafruit#3203 from WarriorOfWire/speed_up_builds
Use 2 cores per build task in github CI build
2 parents f01c774 + ebc1373 commit fbc7897

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tools/build_release_files.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# SPDX-License-Identifier: MIT
66

77
import os
8+
import multiprocessing
89
import sys
910
import subprocess
1011
import shutil
@@ -27,6 +28,8 @@
2728

2829
languages = build_info.get_languages()
2930
exit_status = 0
31+
cores = multiprocessing.cpu_count()
32+
print('building boards with parallelism {}'.format(cores))
3033
for board in build_boards:
3134
bin_directory = "../bin/{}/".format(board)
3235
os.makedirs(bin_directory, exist_ok=True)
@@ -41,8 +44,8 @@
4144
# But sometimes a particular language needs to be built from scratch, if, for instance,
4245
# CFLAGS_INLINE_LIMIT is set for a particular language to make it fit.
4346
clean_build_check_result = subprocess.run(
44-
"make -C ../ports/{port} TRANSLATION={language} BOARD={board} check-release-needs-clean-build | fgrep 'RELEASE_NEEDS_CLEAN_BUILD = 1'".format(
45-
port = board_info["port"], language=language, board=board),
47+
"make -C ../ports/{port} TRANSLATION={language} BOARD={board} check-release-needs-clean-build -j {cores} | fgrep 'RELEASE_NEEDS_CLEAN_BUILD = 1'".format(
48+
port = board_info["port"], language=language, board=board, cores=cores),
4649
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
4750
clean_build = clean_build_check_result.returncode == 0
4851

@@ -51,8 +54,8 @@
5154
build_dir += "-{language}".format(language=language)
5255

5356
make_result = subprocess.run(
54-
"make -C ../ports/{port} TRANSLATION={language} BOARD={board} BUILD={build}".format(
55-
port = board_info["port"], language=language, board=board, build=build_dir),
57+
"make -C ../ports/{port} TRANSLATION={language} BOARD={board} BUILD={build} -j {cores}".format(
58+
port = board_info["port"], language=language, board=board, build=build_dir, cores=cores),
5659
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
5760

5861
build_duration = time.monotonic() - start_time

0 commit comments

Comments
 (0)
0