summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-12-03 09:57:49 +0700
committerhathach <[email protected]>2025-12-03 11:00:57 +0700
commitee3d3e3551f95757b85de1c2c9777a1daed8f78d (patch)
treeed935ea67c67eba98ab29e0d9dcddc52e89b3137 /tools
parent3d190475ad2b71d913e059dfc6f5cc5dafe6555d (diff)
upload metrics.json and aggregate code metrics, fine tune ci matrix run
Diffstat (limited to 'tools')
-rwxr-xr-xtools/build.py13
-rwxr-xr-xtools/get_deps.py2
2 files changed, 10 insertions, 5 deletions
diff --git a/tools/build.py b/tools/build.py
index 5392a9aa4..b87af6c6a 100755
--- a/tools/build.py
+++ b/tools/build.py
@@ -6,8 +6,6 @@ import sys
import time
import subprocess
import shlex
-import glob
-import metrics
from pathlib import Path
from multiprocessing import Pool
@@ -26,6 +24,7 @@ build_separator = '-' * 95
build_status = [STATUS_OK, STATUS_FAILED, STATUS_SKIPPED]
verbose = False
+clean_build = False
parallel_jobs = os.cpu_count()
# -----------------------------
@@ -117,11 +116,13 @@ def cmake_board(board, build_args, build_flags_on):
f'-DBOARD={board}', '-DCMAKE_BUILD_TYPE=MinSizeRel', '-DLINKERMAP_OPTION=-q -f tinyusb/src',
*build_args, *build_flags])
if rcmd.returncode == 0:
+ if clean_build:
+ run_cmd(["cmake", "--build", build_dir, '--target', 'clean'])
cmd = ["cmake", "--build", build_dir, '--parallel', str(parallel_jobs)]
rcmd = run_cmd(cmd)
if rcmd.returncode == 0:
ret[0] += 1
- rcmd = run_cmd(["cmake", "--build", build_dir, '--target', 'tinyusb_examples_metrics'])
+ run_cmd(["cmake", "--build", build_dir, '--target', 'tinyusb_examples_metrics'])
# print(rcmd.stdout.decode("utf-8"))
else:
ret[1] += 1
@@ -148,7 +149,8 @@ def make_one_example(example, board, make_option):
if make_option:
make_args += shlex.split(make_option)
make_args.append("all")
- # run_cmd(make_args + ["clean"])
+ if clean_build:
+ run_cmd(make_args + ["clean"])
build_result = run_cmd(make_args)
r = 0 if build_result.returncode == 0 else 1
print_build_result(board, example, r, time.monotonic() - start_time)
@@ -235,11 +237,13 @@ def get_family_boards(family, one_per_family, boards):
# -----------------------------
def main():
global verbose
+ global clean_build
global parallel_jobs
parser = argparse.ArgumentParser()
parser.add_argument('families', nargs='*', default=[], help='Families to build')
parser.add_argument('-b', '--board', action='append', default=[], help='Boards to build')
+ parser.add_argument('-c', '--clean', action='store_true', default=False, help='Clean before build')
parser.add_argument('-t', '--toolchain', default='gcc', help='Toolchain to use, default is gcc')
parser.add_argument('-s', '--build-system', default='cmake', help='Build system to use, default is cmake')
parser.add_argument('-D', '--define-symbol', action='append', default=[], help='Define to pass to build system')
@@ -257,6 +261,7 @@ def main():
build_flags_on = args.build_flags_on
one_per_family = args.one_per_family
verbose = args.verbose
+ clean_build = args.clean
parallel_jobs = args.jobs
build_defines.append(f'TOOLCHAIN={toolchain}')
diff --git a/tools/get_deps.py b/tools/get_deps.py
index fe2f51e01..9634451e2 100755
--- a/tools/get_deps.py
+++ b/tools/get_deps.py
@@ -15,7 +15,7 @@ deps_mandatory = {
'159e31b689577dbf69cf0683bbaffbd71fa5ee10',
'all'],
'tools/linkermap': ['https://github.com/hathach/linkermap.git',
- '87f94869f9ff828812f4551138f82c3bfcaf2620',
+ '46c3c2947db366fb66af6723709febf80d860bc1',
'all'],
'tools/uf2': ['https://github.com/microsoft/uf2.git',
'c594542b2faa01cc33a2b97c9fbebc38549df80a',