diff --git a/python/mozbuild/mozbuild/code_analysis/mach_commands.py b/python/mozbuild/mozbuild/code_analysis/mach_commands.py index c3a0d1a6f933..bc5604f0dbe6 100644 --- a/python/mozbuild/mozbuild/code_analysis/mach_commands.py +++ b/python/mozbuild/mozbuild/code_analysis/mach_commands.py @@ -2162,6 +2162,7 @@ class StaticAnalysis(MachCommandBase): max_workers = multiprocessing.cpu_count() + rc = 0 with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor: futures = [] for command in commands: @@ -2174,6 +2175,11 @@ class StaticAnalysis(MachCommandBase): ensure_exit_code=False, ) ) + for thread in concurrent.futures.as_completed(futures): + if thread.result() != 0: + rc = thread.result() + + return rc @Command( "clang-format", diff --git a/taskcluster/ci/source-test/clang.yml b/taskcluster/ci/source-test/clang.yml index 867911967723..9fd2164fcb45 100644 --- a/taskcluster/ci/source-test/clang.yml +++ b/taskcluster/ci/source-test/clang.yml @@ -99,3 +99,19 @@ external: - type: file name: public/code-review/clang-tidy.json path: /builds/worker/clang-tidy.json + +non-unified: + description: Run syntax test for non-unified build on C/C++ files. + treeherder: + symbol: cpp(non-unified) + attributes: + code-review: false + run-on-projects: [mozilla-central] + run: + cwd: '{checkout}' + command: >- + source taskcluster/scripts/misc/source-test-clang-setup.sh && + taskcluster/scripts/misc/source-test-clang-non-unified.sh + fetches: + toolchain: + - linux64-clang-tidy diff --git a/taskcluster/scripts/misc/source-test-clang-non-unified.sh b/taskcluster/scripts/misc/source-test-clang-non-unified.sh new file mode 100755 index 000000000000..13bbc87079ec --- /dev/null +++ b/taskcluster/scripts/misc/source-test-clang-non-unified.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +NON_UNIFIED_CFG=$GECKO_PATH/build/non-unified-compat + +while IFS= read -r directory +do + echo "Running non-unified compile test for: $directory" + ./mach static-analysis check-syntax $directory + if [ $? -ne 0 ]; then + # If failure do not continue with the rest of the directories + exit 1 + fi +done < $NON_UNIFIED_CFG diff --git a/taskcluster/scripts/misc/source-test-clang-setup.sh b/taskcluster/scripts/misc/source-test-clang-setup.sh index c457cfb290d3..a8288e5a364f 100755 --- a/taskcluster/scripts/misc/source-test-clang-setup.sh +++ b/taskcluster/scripts/misc/source-test-clang-setup.sh @@ -16,6 +16,8 @@ cat <> $MOZCONFIG ac_add_options --enable-debug # Enable GC zeal, a testing and debugging feature that helps find GC-related bugs in JSAPI applications. ac_add_options --enable-gczeal +# Do not treat warnings as errors +ac_add_options --disable-warnings-as-errors EOT # Mach lookup clang-tidy in clang-tools