Remove use_clang_static_analyzer and use_vs_code_analysis.
The clang we ship no longer includes the static analyzer, so this flag hasn't been working for a while. Remove it, and mb stuff for an FYI bot that uses it. The plan is to run the static analyzer through clang-tidy instead. While here, also remove the 'win analyze' bot src bits, since that bot depends on MSVC which we haven't supported in a while either, and the little bit of GN code kept alive by it. Bug: 925145,687243 Change-Id: I042d3cc9f512a024a6eae6a8e7d43aa2f9a74fea Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538987 Commit-Queue: Nico Weber <thakis@chromium.org> Reviewed-by: Hans Wennborg <hans@chromium.org> Auto-Submit: Nico Weber <thakis@chromium.org> Cr-Commit-Position: refs/heads/master@{#644866}
This commit is contained in:
build
config
toolchain
docs
infra/config
testing/buildbot
tools/mb
@ -447,7 +447,6 @@ if (is_win) {
|
||||
"//build/config/win:nominmax",
|
||||
"//build/config/win:unicode",
|
||||
"//build/config/win:winver",
|
||||
"//build/config/win:vs_code_analysis",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -14,12 +14,6 @@ import("//build/toolchain/toolchain.gni")
|
||||
assert(is_win)
|
||||
|
||||
declare_args() {
|
||||
# Set this to true to enable static analysis through Visual Studio's
|
||||
# /analyze. This dramatically slows compiles and reports thousands of
|
||||
# warnings, so normally this is done on a build machine and only the new
|
||||
# warnings are examined.
|
||||
use_vs_code_analysis = false
|
||||
|
||||
# Turn this on to have the linker output extra timing information.
|
||||
win_linker_timing = false
|
||||
|
||||
@ -212,46 +206,6 @@ config("compiler") {
|
||||
]
|
||||
}
|
||||
|
||||
config("vs_code_analysis") {
|
||||
if (use_vs_code_analysis && !is_clang) {
|
||||
# When use_vs_code_analysis is specified add the /analyze switch to enable
|
||||
# static analysis. Specifying /analyze:WX- says that /analyze warnings
|
||||
# should not be treated as errors.
|
||||
cflags = [ "/analyze:WX-" ]
|
||||
|
||||
# Also, disable various noisy warnings that have low value.
|
||||
cflags += [
|
||||
"/wd6011", # Dereferencing NULL pointer
|
||||
|
||||
# C6285 is ~16% of raw warnings and has low value
|
||||
"/wd6285", # non-zero constant || non-zero constant
|
||||
"/wd6308", # realloc might return null pointer
|
||||
|
||||
# Possible infinite loop: use of the constant
|
||||
# EXCEPTION_CONTINUE_EXECUTION in the exception-filter
|
||||
"/wd6312",
|
||||
|
||||
"/wd6322", # Empty _except block
|
||||
"/wd6330", # 'char' used instead of 'unsigned char' for istype() call
|
||||
|
||||
# C6334 is ~80% of raw warnings and has low value
|
||||
"/wd6334", # sizeof applied to an expression with an operator
|
||||
"/wd6326", # Potential comparison of constant with constant
|
||||
"/wd6340", # Sign mismatch in function parameter
|
||||
"/wd28159", # Consider using 'GetTickCount64'
|
||||
"/wd28196", # The precondition is not satisfied
|
||||
"/wd28204", # Inconsistent SAL annotations
|
||||
"/wd28251", # Inconsistent SAL annotations
|
||||
"/wd28252", # Inconsistent SAL annotations
|
||||
"/wd28253", # Inconsistent SAL annotations
|
||||
"/wd28278", # Function appears with no prototype in scope
|
||||
"/wd28285", # syntax error in SAL annotation (in algorithm)
|
||||
"/wd28301", # Inconsistent SAL annotations
|
||||
"/wd28182", # Dereferencing NULL pointer
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
# This is included by reference in the //build/config/compiler:runtime_library
|
||||
# config that is applied to all targets. It is here to separate out the logic
|
||||
# that is Windows-only. Please see that target for advice on what should go in
|
||||
@ -278,11 +232,9 @@ config("runtime_library") {
|
||||
"_SECURE_ATL",
|
||||
]
|
||||
|
||||
if (!use_vs_code_analysis) {
|
||||
# This is required for ATL to use XP-safe versions of its functions.
|
||||
# However it is prohibited when using /analyze
|
||||
defines += [ "_USING_V110_SDK71_" ]
|
||||
}
|
||||
# This is required for ATL to use XP-safe versions of its functions.
|
||||
# TODO(thakis): We no longer support XP; try removing this.
|
||||
defines += [ "_USING_V110_SDK71_" ]
|
||||
|
||||
if (current_os == "winuwp") {
|
||||
# When targeting Windows Runtime, certain compiler/linker flags are
|
||||
|
@ -1,11 +0,0 @@
|
||||
# Copyright (c) 2017 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Defines the configuration of Clang static analysis tools.
|
||||
# See docs/clang_static_analyzer.md for more information.
|
||||
|
||||
declare_args() {
|
||||
# Uses the Clang static analysis tools during compilation.
|
||||
use_clang_static_analyzer = false
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2017 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
"""Adds an analysis build step to invocations of the Clang C/C++ compiler.
|
||||
|
||||
Usage: clang_static_analyzer_wrapper.py <compiler> [args...]
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import fnmatch
|
||||
import itertools
|
||||
import os
|
||||
import sys
|
||||
import wrapper_utils
|
||||
|
||||
# Flags used to enable analysis for Clang invocations.
|
||||
analyzer_enable_flags = [
|
||||
'--analyze',
|
||||
]
|
||||
|
||||
# Flags used to configure the analyzer's behavior.
|
||||
analyzer_option_flags = [
|
||||
'-fdiagnostics-show-option',
|
||||
'-analyzer-checker=cplusplus',
|
||||
'-analyzer-opt-analyze-nested-blocks',
|
||||
'-analyzer-output=text',
|
||||
'-analyzer-config',
|
||||
'suppress-c++-stdlib=true',
|
||||
|
||||
# List of checkers to execute.
|
||||
# The full list of checkers can be found at
|
||||
# https://clang-analyzer.llvm.org/available_checks.html.
|
||||
'-analyzer-checker=core',
|
||||
'-analyzer-checker=unix',
|
||||
'-analyzer-checker=deadcode',
|
||||
]
|
||||
|
||||
|
||||
# Prepends every element of a list |args| with |token|.
|
||||
# e.g. ['-analyzer-foo', '-analyzer-bar'] => ['-Xanalyzer', '-analyzer-foo',
|
||||
# '-Xanalyzer', '-analyzer-bar']
|
||||
def interleave_args(args, token):
|
||||
return list(sum(zip([token] * len(args), args), ()))
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--mode',
|
||||
choices=['clang', 'cl'],
|
||||
required=True,
|
||||
help='Specifies the compiler argument convention to use.')
|
||||
parser.add_argument('args', nargs=argparse.REMAINDER)
|
||||
parsed_args = parser.parse_args()
|
||||
|
||||
prefix = '-Xclang' if parsed_args.mode == 'cl' else '-Xanalyzer'
|
||||
cmd = parsed_args.args + analyzer_enable_flags + \
|
||||
interleave_args(analyzer_option_flags, prefix)
|
||||
returncode, stderr = wrapper_utils.CaptureCommandStderr(
|
||||
wrapper_utils.CommandToRun(cmd))
|
||||
sys.stderr.write(stderr)
|
||||
|
||||
returncode, stderr = wrapper_utils.CaptureCommandStderr(
|
||||
wrapper_utils.CommandToRun(parsed_args.args))
|
||||
sys.stderr.write(stderr)
|
||||
|
||||
return returncode
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
@ -8,7 +8,6 @@ import("//build/config/coverage/coverage.gni")
|
||||
import("//build/config/sanitizers/sanitizers.gni")
|
||||
import("//build/config/v8_target_cpu.gni")
|
||||
import("//build/toolchain/cc_wrapper.gni")
|
||||
import("//build/toolchain/clang_static_analyzer.gni")
|
||||
import("//build/toolchain/goma.gni")
|
||||
import("//build/toolchain/toolchain.gni")
|
||||
|
||||
@ -37,13 +36,6 @@ if (is_linux && target_os == "android") {
|
||||
enable_resource_whitelist_generation = false
|
||||
}
|
||||
|
||||
# Path to the Clang static analysis wrapper script.
|
||||
# REVIEWERS: can you suggest a better location for this?
|
||||
# GN is really picky about dead stores of variables except at the global scope.
|
||||
analyzer_wrapper =
|
||||
rebase_path("//build/toolchain/clang_static_analyzer_wrapper.py",
|
||||
root_build_dir) + " --mode=clang"
|
||||
|
||||
# This template defines a toolchain for something that works like gcc
|
||||
# (including clang).
|
||||
#
|
||||
@ -181,19 +173,10 @@ template("gcc_toolchain") {
|
||||
compiler_prefix = "${toolchain_cc_wrapper} "
|
||||
}
|
||||
|
||||
# Create a distinct variable for "asm", since analysis runs pass # a bunch
|
||||
# of flags to clang/clang++ that are nonsensical on assembler runs.
|
||||
# Create a distinct variable for "asm", since coverage runs pass a bunch of
|
||||
# flags to clang/clang++ that are nonsensical on assembler runs.
|
||||
asm_prefix = compiler_prefix
|
||||
|
||||
# Use the static analysis script if static analysis is turned on
|
||||
# AND the tool has not opted out by setting
|
||||
# 'is_clang_static_analysis_supported' to false.
|
||||
if (is_clang && use_clang_static_analyzer &&
|
||||
(!defined(invoker.is_clang_analysis_supported) ||
|
||||
invoker.is_clang_analysis_supported)) {
|
||||
compiler_prefix = "${analyzer_wrapper} " + compiler_prefix
|
||||
}
|
||||
|
||||
# A specific toolchain may wish to avoid coverage instrumentation, so we
|
||||
# allow the global "use_clang_coverage" arg to be overridden.
|
||||
if (defined(toolchain_args.use_clang_coverage)) {
|
||||
@ -205,10 +188,6 @@ template("gcc_toolchain") {
|
||||
# For a coverage build, we use the wrapper script globally so that it can
|
||||
# remove coverage cflags from files that should not have them.
|
||||
if (toolchain_use_clang_coverage) {
|
||||
assert(!use_clang_static_analyzer,
|
||||
"Clang static analyzer wrapper and Clang code coverage wrapper " +
|
||||
"cannot be used together.")
|
||||
|
||||
# "coverage_instrumentation_input_file" is set in args.gn, but it can be
|
||||
# overridden by a toolchain config.
|
||||
if (defined(toolchain_args.coverage_instrumentation_input_file)) {
|
||||
@ -647,7 +626,6 @@ template("clang_toolchain") {
|
||||
forward_variables_from(invoker,
|
||||
[
|
||||
"strip",
|
||||
"is_clang_analysis_supported",
|
||||
"default_shlib_subdir",
|
||||
"enable_linker_map",
|
||||
"use_unstripped_as_runtime_outputs",
|
||||
|
@ -18,7 +18,6 @@ import("//build/config/mac/symbols.gni")
|
||||
assert(host_os == "mac")
|
||||
|
||||
import("//build/toolchain/cc_wrapper.gni")
|
||||
import("//build/toolchain/clang_static_analyzer.gni")
|
||||
import("//build/toolchain/concurrent_links.gni")
|
||||
import("//build/toolchain/goma.gni")
|
||||
import("//build/toolchain/toolchain.gni")
|
||||
@ -126,16 +125,6 @@ template("mac_toolchain") {
|
||||
cxx = compiler_prefix + _cxx
|
||||
ld = _cxx
|
||||
|
||||
if (use_clang_static_analyzer) {
|
||||
analyzer_wrapper =
|
||||
rebase_path("//build/toolchain/clang_static_analyzer_wrapper.py",
|
||||
root_build_dir) + " --mode=clang"
|
||||
cc = analyzer_wrapper + " ${cc}"
|
||||
cxx = analyzer_wrapper + " ${cxx}"
|
||||
|
||||
ld = cxx
|
||||
}
|
||||
|
||||
if (defined(toolchain_args.coverage_instrumentation_input_file)) {
|
||||
toolchain_coverage_instrumentation_input_file =
|
||||
toolchain_args.coverage_instrumentation_input_file
|
||||
@ -146,10 +135,6 @@ template("mac_toolchain") {
|
||||
_use_clang_coverage_wrapper =
|
||||
toolchain_coverage_instrumentation_input_file != ""
|
||||
if (_use_clang_coverage_wrapper) {
|
||||
assert(!use_clang_static_analyzer,
|
||||
"Clang static analyzer wrapper and Clang code coverage wrapper " +
|
||||
"cannot be used together.")
|
||||
|
||||
_coverage_wrapper =
|
||||
rebase_path("//build/toolchain/clang_code_coverage_wrapper.py",
|
||||
root_build_dir) + " --files-to-instrument=" +
|
||||
@ -188,8 +173,8 @@ template("mac_toolchain") {
|
||||
dsym_switch = " -Wcrl,dsym,{{root_out_dir}} "
|
||||
if (is_mac) {
|
||||
dsym_switch += "-Wcrl,dsymutilpath," +
|
||||
rebase_path("//tools/clang/dsymutil/bin/dsymutil",
|
||||
root_build_dir) + " "
|
||||
rebase_path("//tools/clang/dsymutil/bin/dsymutil",
|
||||
root_build_dir) + " "
|
||||
}
|
||||
|
||||
dsym_output_dir =
|
||||
|
@ -2,8 +2,8 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import("//build/config/sysroot.gni")
|
||||
import("//build/config/nacl/config.gni")
|
||||
import("//build/config/sysroot.gni")
|
||||
import("//build/toolchain/nacl_toolchain.gni")
|
||||
|
||||
# Add the toolchain revision as a preprocessor define so that sources are
|
||||
@ -108,10 +108,6 @@ pnacl_toolchain("newlib_pnacl") {
|
||||
pnacl_toolchain("newlib_pnacl_nonsfi") {
|
||||
executable_extension = ""
|
||||
strip = "strip"
|
||||
|
||||
if (use_clang_static_analyzer) {
|
||||
is_clang_analysis_supported = false
|
||||
}
|
||||
}
|
||||
|
||||
template("nacl_glibc_toolchain") {
|
||||
|
@ -32,7 +32,6 @@ template("nacl_toolchain") {
|
||||
"cc",
|
||||
"cxx",
|
||||
"deps",
|
||||
"is_clang_analysis_supported",
|
||||
"ld",
|
||||
"link_outputs",
|
||||
"nm",
|
||||
|
@ -7,7 +7,6 @@ import("//build/config/compiler/compiler.gni")
|
||||
import("//build/config/sanitizers/sanitizers.gni")
|
||||
import("//build/config/win/visual_studio_version.gni")
|
||||
import("//build/toolchain/cc_wrapper.gni")
|
||||
import("//build/toolchain/clang_static_analyzer.gni")
|
||||
import("//build/toolchain/goma.gni")
|
||||
import("//build/toolchain/toolchain.gni")
|
||||
|
||||
@ -91,26 +90,8 @@ template("msvc_toolchain") {
|
||||
|
||||
env = invoker.environment
|
||||
|
||||
# When the invoker has explicitly overridden use_goma or cc_wrapper in the
|
||||
# toolchain args, use those values, otherwise default to the global one.
|
||||
# This works because the only reasonable override that toolchains might
|
||||
# supply for these values are to force-disable them.
|
||||
if (defined(toolchain_args.is_clang)) {
|
||||
toolchain_uses_clang = toolchain_args.is_clang
|
||||
} else {
|
||||
toolchain_uses_clang = is_clang
|
||||
}
|
||||
|
||||
cl = invoker.cl
|
||||
|
||||
if (toolchain_uses_clang && use_clang_static_analyzer) {
|
||||
analyzer_prefix =
|
||||
"$python_path " +
|
||||
rebase_path("//build/toolchain/clang_static_analyzer_wrapper.py",
|
||||
root_build_dir) + " --mode=cl"
|
||||
cl = "${analyzer_prefix} ${cl}"
|
||||
}
|
||||
|
||||
if (use_lld) {
|
||||
if (host_os == "win") {
|
||||
lld_link = "lld-link.exe"
|
||||
@ -141,7 +122,8 @@ template("msvc_toolchain") {
|
||||
sys_include_flags = "${invoker.sys_include_flags} " # Note trailing space.
|
||||
} else {
|
||||
# clang-cl doesn't need this env hoop, so omit it there.
|
||||
assert(!toolchain_uses_clang)
|
||||
assert((defined(toolchain_args.is_clang) && !toolchain_args.is_clang) ||
|
||||
!is_clang)
|
||||
env_wrapper = "ninja -t msvc -e $env -- " # Note trailing space.
|
||||
sys_include_flags = ""
|
||||
}
|
||||
|
@ -6,77 +6,46 @@ a technique that explores all the possible branches in code and
|
||||
records the codepaths that might lead to bad or undefined behavior,
|
||||
like an uninitialized reads, use after frees, pointer leaks, and so on.
|
||||
|
||||
You can now use these static analysis capabilities to find potential bugs in
|
||||
Chromium code! Note that this capability is quite new, and as of this writing,
|
||||
there are still a large number of warnings to be fixed in Chromium and especially
|
||||
in its third_party dependencies. Some of the warnings might be false positives,
|
||||
see the section on "Addressing false positives" for more information on
|
||||
resolving them.
|
||||
|
||||
We're still evaluating this tool, please let us know if you find it useful.
|
||||
|
||||
See the [official Clang static analyzer page](http://clang-analyzer.llvm.org/)
|
||||
for more background information.
|
||||
|
||||
## Save some time, look at the buildbot logs!
|
||||
We used to have a bot that continuously ran with the static analyzer,
|
||||
but people used to not look at it much.
|
||||
|
||||
We run static analysis builds continuously, all day long on FYI buildbots.
|
||||
You can save yourself some time by first inspecting their build logs for errors
|
||||
before running your own analysis builds. You will probably need to Ctrl-F the
|
||||
logs to find any issues for the specific files you're interested in.
|
||||
The static analyzer can still be invoked with [clang-tidy](clang_tidy.md).
|
||||
|
||||
You can find the analysis logs in the `compile stdout` step.
|
||||
* [Linux buildbot logs](https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Linux%20Clang%20Analyzer)
|
||||
## Recommended checks
|
||||
Clang's static analyzer comes with a wide variety of checkers. Some of the
|
||||
checks aren't useful because they are intended for different languages,
|
||||
platforms, or coding conventions than the ones used for Chromium development.
|
||||
|
||||
## Enabling static analysis
|
||||
Checkers we found useful were:
|
||||
|
||||
*Warning:* `use_clang_static_analyzer` is deprecated, but the static analyzer can
|
||||
still be invoked with [clang-tidy](clang_tidy.md).
|
||||
|
||||
To get static analysis running for your build, add the following flag to your GN
|
||||
args.
|
||||
|
||||
```
|
||||
use_clang_static_analyzer = true
|
||||
```
|
||||
|
||||
The next time you run your build, you should see static analysis warnings appear
|
||||
inline with the usual Clang build warnings and errors. Expect some slowdown on
|
||||
your build; anywhere from a 10% increase on local builds, to well over 100% under Goma
|
||||
([crbug](https://crbug.com/733363)).
|
||||
|
||||
## Supported checks
|
||||
Clang's static analyzer comes with a wide variety of checkers. Some of the checks
|
||||
aren't useful because they are intended for different languages, platforms, or
|
||||
coding conventions than the ones used for Chromium development.
|
||||
|
||||
The checkers that we are interested in running for Chromium are in the
|
||||
`analyzer_option_flags` variable in
|
||||
[clang_static_analyzer_wrapper.py](../build/toolchain/clang_static_analyzer_wrapper.py).
|
||||
-analyzer-checker=core
|
||||
-analyzer-checker=cpp
|
||||
-analyzer-checker=unix
|
||||
-analyzer-checker=deadcode
|
||||
|
||||
As of this writing, the checker suites we support are
|
||||
[core](https://clang-analyzer.llvm.org/available_checks.html#core_checkers),
|
||||
[cplusplus](https://clang-analyzer.llvm.org/available_checks.html#cplusplus_checkers), and
|
||||
[deadcode](https://clang-analyzer.llvm.org/available_checks.html#deadcode_checkers).
|
||||
|
||||
To add or remove checkers, simply modify the `-analyzer-checker=` flags.
|
||||
Remember that checkers aren't free; additional checkers will add to the
|
||||
analysis time.
|
||||
|
||||
## Addressing false positives
|
||||
|
||||
Some of the errors you encounter might be false positives, which occurs when the
|
||||
static analyzer naively follows codepaths which are practically impossible to hit
|
||||
at runtime. Fortunately, we have a tool at our disposal for guiding the analyzer
|
||||
away from impossible codepaths: assertion handlers like DCHECK/CHECK/LOG(FATAL).
|
||||
The analyzer won't check the codepaths which we assert are unreachable.
|
||||
Some of the errors you encounter will be false positives, which occurs when the
|
||||
static analyzer naively follows codepaths which are practically impossible to
|
||||
hit at runtime. Fortunately, we have a tool at our disposal for guiding the
|
||||
analyzer away from impossible codepaths: assertion handlers like
|
||||
DCHECK/CHECK/LOG(FATAL). The analyzer won't check the codepaths which we
|
||||
assert are unreachable.
|
||||
|
||||
An example would be that if the analyzer detected the function argument `*my_ptr`
|
||||
might be null and dereferencing it would potentially segfault, you would see the
|
||||
error `warning: Dereference of null pointer (loaded from variable 'my_ptr')`.
|
||||
If you know for a fact that my_ptr will not be null in practice, then you can
|
||||
place an assert at the top of the function: `DCHECK(my_ptr)`. The analyzer will
|
||||
no longer generate the warning.
|
||||
An example would be that if the analyzer detected the function argument
|
||||
`*my_ptr` might be null and dereferencing it would potentially segfault, you
|
||||
would see the error `warning: Dereference of null pointer (loaded from variable
|
||||
'my_ptr')`. If you know for a fact that my_ptr will not be null in practice,
|
||||
then you can place an assert at the top of the function: `DCHECK(my_ptr)`. The
|
||||
analyzer will no longer generate the warning.
|
||||
|
||||
Be mindful about only specifying assertions which are factually correct! Don't
|
||||
DCHECK recklessly just to quiet down the analyzer. :)
|
||||
@ -88,7 +57,7 @@ Other types of false positives and their suppressions:
|
||||
`ANALYZER_ALLOW_UNUSED(my_var)`. This also suppresses dead store warnings
|
||||
on conventional builds without static analysis enabled!
|
||||
|
||||
See the definitions of the ANALYZER_* macros in base/logging.h for more
|
||||
See the definitions of the `ANALYZER_*` macros in base/logging.h for more
|
||||
detailed information about how the annotations are implemented.
|
||||
|
||||
## Logging bugs
|
||||
@ -96,26 +65,3 @@ detailed information about how the annotations are implemented.
|
||||
If you find any issues with the static analyzer, or find Chromium code behaving
|
||||
badly with the analyzer, please check the `Infra>CodeAnalysis` CrBug component
|
||||
to look for known issues, or file a bug if it is a new problem.
|
||||
|
||||
***
|
||||
|
||||
## Technical details
|
||||
### GN hooks
|
||||
The platform toolchain .gni/BUILD.gn files check for the
|
||||
`use_clang_static_analyzer` flag and modify the compiler command line so as to
|
||||
call the analysis wrapper script rather than call the compiler directly.
|
||||
The flag has no effect on assembler invocations, linker invocations, or
|
||||
NaCl toolchain builds.
|
||||
|
||||
### Analysis wrapper script
|
||||
The entry point for running analysis is the Python script
|
||||
`//build/toolchain/clang_static_analyzer_wrapper.py` which invokes Clang
|
||||
with the parameters for running static analysis.
|
||||
|
||||
**Alternatives considered**
|
||||
A script-less, GN-based solution is not possible because GN's control flows
|
||||
are very limited in how they may be extended.
|
||||
|
||||
The `scan-build` wrapper script included with Clang does not
|
||||
work with Goma, so it couldn't be used.
|
||||
|
||||
|
@ -2342,11 +2342,6 @@ buckets {
|
||||
dimensions: "os:Ubuntu-14.04"
|
||||
mixins: "android-ci"
|
||||
}
|
||||
builders {
|
||||
name: "Linux Clang Analyzer"
|
||||
dimensions: "os:Ubuntu-14.04"
|
||||
mixins: "fyi-ci"
|
||||
}
|
||||
builders {
|
||||
name: "Android Builder (dbg)"
|
||||
dimensions: "os:Ubuntu-14.04"
|
||||
@ -2451,14 +2446,6 @@ buckets {
|
||||
dimensions: "os:Ubuntu-14.04"
|
||||
mixins: "android-fyi-ci"
|
||||
}
|
||||
builders {
|
||||
name: "Chromium Windows Analyze"
|
||||
dimensions: "os:Windows-10"
|
||||
mixins: "fyi-ci"
|
||||
recipe {
|
||||
name: "win_analyze"
|
||||
}
|
||||
}
|
||||
builders {
|
||||
name: "ios-device-goma-canary-clobber"
|
||||
dimensions: "os:Mac-10.13"
|
||||
|
@ -2469,10 +2469,6 @@ consoles {
|
||||
name: "buildbucket/luci.chromium.ci/Android VR Tests"
|
||||
category: "android_tests"
|
||||
}
|
||||
builders {
|
||||
name: "buildbucket/luci.chromium.ci/Linux Clang Analyzer"
|
||||
category: "clang tot"
|
||||
}
|
||||
builders {
|
||||
name: "buildbucket/luci.chromium.ci/Closure Compilation Linux"
|
||||
category: "closure_compilation"
|
||||
@ -2530,10 +2526,6 @@ consoles {
|
||||
name: "buildbucket/luci.chromium.ci/Chromium Mac 10.13"
|
||||
category: "default"
|
||||
}
|
||||
builders {
|
||||
name: "buildbucket/luci.chromium.ci/Chromium Windows Analyze"
|
||||
category: "default"
|
||||
}
|
||||
builders {
|
||||
name: "buildbucket/luci.chromium.ci/Mac deterministic"
|
||||
category: "deterministic"
|
||||
|
@ -138,7 +138,6 @@ trigger {
|
||||
triggers: "Chromium Win Goma RBE ToT"
|
||||
triggers: "Chromium Win Goma RBE Staging"
|
||||
triggers: "Chromium Win Goma RBE Staging (clobber)"
|
||||
triggers: "Chromium Windows Analyze"
|
||||
triggers: "ChromiumOS ASAN Release"
|
||||
triggers: "Closure Compilation Linux"
|
||||
triggers: "CrWinAsan"
|
||||
@ -199,7 +198,6 @@ trigger {
|
||||
triggers: "Linux Chromium OS ASan LSan Builder"
|
||||
triggers: "Linux ChromiumOS Full"
|
||||
triggers: "Linux ChromiumOS MSan Builder"
|
||||
triggers: "Linux Clang Analyzer"
|
||||
triggers: "Linux FYI GPU TSAN Release"
|
||||
triggers: "Linux MSan Builder"
|
||||
triggers: "Linux TSan Builder"
|
||||
@ -3177,16 +3175,6 @@ job {
|
||||
}
|
||||
}
|
||||
|
||||
job {
|
||||
id: "Chromium Windows Analyze"
|
||||
acl_sets: "default"
|
||||
buildbucket: {
|
||||
server: "cr-buildbucket.appspot.com"
|
||||
bucket: "luci.chromium.ci"
|
||||
builder: "Chromium Windows Analyze"
|
||||
}
|
||||
}
|
||||
|
||||
job {
|
||||
id: "ChromiumOS ASAN Release"
|
||||
acl_sets: "default"
|
||||
@ -3528,16 +3516,6 @@ job {
|
||||
}
|
||||
}
|
||||
|
||||
job {
|
||||
id: "Linux Clang Analyzer"
|
||||
acl_sets: "default"
|
||||
buildbucket: {
|
||||
server: "cr-buildbucket.appspot.com"
|
||||
bucket: "luci.chromium.ci"
|
||||
builder: "Linux Clang Analyzer"
|
||||
}
|
||||
}
|
||||
|
||||
job {
|
||||
id: "Linux MSan Builder"
|
||||
acl_sets: "default"
|
||||
|
@ -1013,11 +1013,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"Linux Clang Analyzer": {
|
||||
"additional_compile_targets": [
|
||||
"chrome"
|
||||
]
|
||||
},
|
||||
"Linux Viz": {
|
||||
"additional_compile_targets": [
|
||||
"all"
|
||||
|
@ -1094,11 +1094,6 @@
|
||||
'gtest_tests': 'goma_gtests',
|
||||
},
|
||||
},
|
||||
'Linux Clang Analyzer': {
|
||||
'additional_compile_targets': [
|
||||
'chrome',
|
||||
]
|
||||
},
|
||||
'Linux Viz': {
|
||||
'additional_compile_targets': [
|
||||
'all',
|
||||
|
@ -232,8 +232,6 @@
|
||||
'Mac Goma Latest Client (clobber)': 'release_bot_mac_strip',
|
||||
'Mac Goma Latest Client LocalOutputCache': 'release_bot_mac_strip',
|
||||
|
||||
'Chromium Windows Analyze': 'windows_analyze',
|
||||
|
||||
'Win7 Builder (dbg) Goma Canary': 'debug_trybot_x86_minimal_symbols',
|
||||
'Win7 Builder (dbg) Goma Latest Client': 'debug_trybot_x86_minimal_symbols',
|
||||
'Win7 Builder Goma Canary': 'release_bot_x86_minimal_symbols',
|
||||
@ -269,7 +267,6 @@
|
||||
'Libfuzzer Upload Mac ASan': 'libfuzzer_mac_asan_release_bot',
|
||||
'Libfuzzer Upload Windows ASan': 'libfuzzer_windows_asan_release_bot',
|
||||
'Linux ARM': 'release_bot_arm',
|
||||
'Linux Clang Analyzer': 'linux_chromium_analysis',
|
||||
'Linux remote_run Builder': 'release_bot',
|
||||
'Linux remote_run Tester': 'release_bot',
|
||||
'Linux Viz': 'release_trybot',
|
||||
@ -1643,10 +1640,6 @@
|
||||
'libfuzzer', 'asan', 'release_trybot', 'chrome_with_codecs', 'pdf_xfa', 'disable_nacl', 'minimal_symbols',
|
||||
],
|
||||
|
||||
'linux_chromium_analysis': [
|
||||
'analysis'
|
||||
],
|
||||
|
||||
'msan_release_bot': [
|
||||
'msan', 'release_bot',
|
||||
],
|
||||
@ -1877,10 +1870,6 @@
|
||||
'clang_tot_win_release_cross': [
|
||||
'clang_tot', 'win_cross', 'minimal_symbols', 'shared', 'release', 'dcheck_always_on',
|
||||
],
|
||||
|
||||
'windows_analyze': [
|
||||
'no_symbols', 'no_pch', 'shared', 'x86', 'win_analyze',
|
||||
],
|
||||
},
|
||||
|
||||
# This is a dict mapping a given 'mixin' name to a dict of settings that
|
||||
@ -1888,8 +1877,6 @@
|
||||
'mixins': {
|
||||
'afl': { 'gn_args': 'use_afl=true' },
|
||||
|
||||
'analysis': { 'gn_args': 'use_clang_static_analyzer=true'},
|
||||
|
||||
# We build Android with codecs on most bots to ensure maximum test
|
||||
# coverage, but use 'android_without_codecs' on bots responsible for
|
||||
# building publicly advertised non-Official Android builds --
|
||||
@ -2216,10 +2203,6 @@
|
||||
'gn_args': 'enable_keystone_registration_framework=false',
|
||||
},
|
||||
|
||||
'no_pch': {
|
||||
'gn_args': 'enable_precompiled_headers=false',
|
||||
},
|
||||
|
||||
'no_symbols': {
|
||||
'gn_args': 'symbol_level=0',
|
||||
},
|
||||
@ -2398,10 +2381,6 @@
|
||||
'gn_args': 'target_os="win"',
|
||||
},
|
||||
|
||||
'win_analyze': {
|
||||
'gn_args': 'use_vs_code_analysis=true',
|
||||
},
|
||||
|
||||
'x64': {
|
||||
'gn_args': 'target_cpu="x64"',
|
||||
},
|
||||
|
Reference in New Issue
Block a user