Merge "build: limit clang-tidy concurrency and respect NIX_BUILD_CORES" into main

This commit is contained in:
jade 2024-08-19 02:55:48 +00:00 committed by Gerrit Code Review
commit 925e08b858

View file

@ -57,6 +57,12 @@ build_all_generated_headers = custom_target(
) )
if lix_clang_tidy_so_found 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 = [ run_clang_tidy_args = [
'-load', '-load',
lix_clang_tidy_so, lix_clang_tidy_so,
@ -66,6 +72,7 @@ if lix_clang_tidy_so_found
# https://github.com/llvm/llvm-project/issues/101440 # https://github.com/llvm/llvm-project/issues/101440
meson.current_build_dir(), meson.current_build_dir(),
'-quiet', '-quiet',
'-j', default_concurrency,
] ]
run_target( run_target(
'clang-tidy', 'clang-tidy',