Files
serge-sans-paille 94971635cf Bug 2023532 - Speedup source-test-clang-tidy task r=sylvestre
We don't want to lint test files (yet), they are a big source of noisy
output.

We don't want a unified build, as it duplicates the number of entires
potentially selected (each file maps to it s solo invocation, and its
unified one). Plus because clang-tidy ignores headers, the unified
output is actually filtered out by clang-tidy.

Finally, the batch size of a run_clang_tidy should not depend on the
cpu count, which is already handled by run_clang_tidy. Create large
enough batch to take advantage of parallelism while not hitting CLI
limitations, which was the original purpose (see Bug 1605879).

Differential Revision: https://phabricator.services.mozilla.com/D287945
2026-03-22 08:35:55 +00:00

32 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
source $HOME/checkouts/gecko/taskcluster/scripts/misc/source-test-common.sh
# Add clang-tidy to PATH
export PATH=$MOZ_FETCHES_DIR/clang-tidy/bin:$PATH
# Use toolchain clang
export LD_LIBRARY_PATH=$MOZ_FETCHES_DIR/clang/lib
# Write custom mozconfig
export MOZCONFIG=$GECKO_PATH/mozconfig
# Add to mozconfig all the appropriate options
cat <<EOT >> $MOZCONFIG
# Enable debug mode
ac_add_options --enable-debug
# Enable clang-plugin in order to have all defines activated for static-analysis
ac_add_options --enable-clang-plugin
# 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
# Avoid redundnant entries in compile_commands
ac_add_options --disable-unified-build
# We don't want to analyse tests
ac_add_options --disable-tests
EOT
# Mach lookup clang-tidy in clang-tools
mkdir -p $MOZBUILD_STATE_PATH/clang-tools
ln -s $MOZ_FETCHES_DIR/clang-tidy $MOZBUILD_STATE_PATH/clang-tools/clang-tidy