aboutsummaryrefslogtreecommitdiff
path: root/meson
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-08-10 18:40:21 -0700
committerJade Lovelace <lix@jade.fyi>2024-08-18 15:39:05 -0700
commitecfe9345cf4d8e94c11c4536515aea1c2b9bf009 (patch)
tree112ca7b2f0c1bcec938ff24a8d78efa4ddc885c6 /meson
parent007211e7a27a512cb343060e8b363c9f66ef67af (diff)
build: limit clang-tidy concurrency and respect NIX_BUILD_CORES
Apparently it was impolite to lint with 128 jobs on our CI machine with 128 threads. Let's fix it. Change-Id: I9ca7306294c6773c6f233690ba49d45a1da6bf7a
Diffstat (limited to 'meson')
-rw-r--r--meson/clang-tidy/meson.build7
1 files changed, 7 insertions, 0 deletions
diff --git a/meson/clang-tidy/meson.build b/meson/clang-tidy/meson.build
index 9aba5fbdc..1cd85a708 100644
--- a/meson/clang-tidy/meson.build
+++ b/meson/clang-tidy/meson.build
@@ -57,6 +57,12 @@ build_all_generated_headers = custom_target(
)
if lix_clang_tidy_so_found
+ default_concurrency = run_command(python, '-c', '''
+import multiprocessing
+import os
+print(min(multiprocessing.cpu_count(), int(os.environ.get("NIX_BUILD_CORES", "16"))))
+ ''', check : true).stdout()
+
run_clang_tidy_args = [
'-load',
lix_clang_tidy_so,
@@ -66,6 +72,7 @@ if lix_clang_tidy_so_found
# https://github.com/llvm/llvm-project/issues/101440
meson.current_build_dir(),
'-quiet',
+ '-j', default_concurrency,
]
run_target(
'clang-tidy',