Bug 1598226 - Create task definitions for external clang-tidy checks; r=andi,tjr,glandium

Depends on D81448

Differential Revision: https://phabricator.services.mozilla.com/D84769
This commit is contained in:
june wilde 2020-08-10 21:02:04 +00:00
parent a157125ab9
commit 103a325162
5 changed files with 89 additions and 2 deletions

View File

@ -0,0 +1,17 @@
{
"stages": "1",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"python_path": "/usr/bin/python2.7",
"gcc_dir": "{MOZ_FETCHES_DIR}/gcc",
"cc": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"cxx": "{MOZ_FETCHES_DIR}/gcc/bin/g++",
"as": "{MOZ_FETCHES_DIR}/gcc/bin/gcc",
"patches": [
"clang-tidy-ci.patch",
"clang-tidy-no-errors.patch"
],
"build_clang_tidy_external": true
}

View File

@ -424,6 +424,14 @@ clang-10:
repo: https://github.com/llvm/llvm-project
revision: d32170dbd5b0d54436537b6b75beaf44324e0c28
civet-source:
description: Repository for external static analysis checks
fetch:
type: git
repo: git@github.com:mozilla-services/civet.git
revision: 1a7a27f0a3bede8f94ac1e7c73f400de797296b5
ssh-key: project/civet/github-deploy-key
wasi-sdk:
description: wasi-sdk source code
fetch:

View File

@ -24,7 +24,6 @@ job-defaults:
fetches:
toolchain:
- linux64-clang
- linux64-clang-tidy
- linux64-rust
- linux64-cbindgen
- linux64-nasm
@ -52,7 +51,9 @@ tidy:
command: >-
source taskcluster/scripts/misc/source-test-clang-setup.sh &&
./mach --log-no-times static-analysis check --outgoing --output $HOME/clang-tidy.json --format json
fetches:
toolchain:
- linux64-clang-tidy
worker:
artifacts:
- type: file
@ -69,6 +70,9 @@ format:
source taskcluster/scripts/misc/source-test-clang-setup.sh &&
./mach --log-no-times clang-format --outgoing --output $HOME/clang-format.json --format json &&
./mach --log-no-times clang-format --outgoing --output $HOME/clang-format.diff --format diff
fetches:
toolchain:
- linux64-clang-tidy
worker:
artifacts:
- type: file
@ -77,3 +81,23 @@ format:
- type: file
name: public/code-review/clang-format.diff
path: /builds/worker/clang-format.diff
civet:
description: Run static-analysis (clang-tidy) on C/C++ patches with external checks
attributes:
code-review: false
treeherder:
symbol: cpp(clang-civet)
run:
cwd: '{checkout}'
command: >-
source taskcluster/scripts/misc/source-test-clang-setup.sh &&
./mach --log-no-times static-analysis check --checks="-*,mozilla-civet-*" --outgoing --output $HOME/clang-tidy.json --format json
fetches:
toolchain:
- linux64-civet-tidy
worker:
artifacts:
- type: file
name: public/code-review/clang-tidy.json
path: /builds/worker/clang-tidy.json

View File

@ -92,3 +92,27 @@ win64-clang-tidy:
fetch:
- cmake
- ninja
linux64-civet-tidy:
index:
job-name: linux64-civet-tidy
treeherder:
symbol: TL(linux64-civet-tidy)
worker:
artifacts:
- name: project/civet/clang-tidy.tar.zst
path: /builds/worker/private-artifacts/clang-tidy.tar.zst
type: file
run:
toolchain-artifact: project/civet/clang-tidy.tar.zst
script: build-civet.sh
arguments:
- 'build/build-clang/civet-tidy-linux64.json'
resources:
- 'build/build-clang/civet-tidy-linux64.json'
fetches:
fetch:
- civet-source
toolchain:
- linux64-binutils
- linux64-gcc-7

View File

@ -0,0 +1,14 @@
#!/bin/bash
set -x
# Because we specify a private artifact, UPLOAD_DIR is not populated for us
export UPLOAD_DIR="/builds/worker/private-artifacts/"
# # Delete the external directory
rm -rf $GECKO_PATH/build/clang-plugin/external/*
# # Move civet into its place
cp -r $MOZ_FETCHES_DIR/civet.git/* $GECKO_PATH/build/clang-plugin/external
# Call build-clang.sh with this script's first argument (our JSON config)
$GECKO_PATH/taskcluster/scripts/misc/build-clang.sh $1