This folder contains scripts for discovering and cataloguing instances of compiler warnings in Chromium builds.
There are currently many clang warnings which we suppress when building Chromium, but intend to one day re-enable (try searching for -Wno
in build/config/compiler.BUILD.gn for some examples). Unfortunately, actually turning these warnings back on is a daunting task due to the sheer variety of platforms on which chromium needs to build. Each of these compiles a different subset of the codebase, meaning that certain warnings may only show up when building on a single, obscure system.
The Chromium CQ lets us check for this by building on many different systems simultaneously. If we disable the -Werror
flag, the build logs for each system will contain a list of all the warnings that occurred during the build. However, the CQ is quite large. It's not feasible to manually inspect the logs for every single build to ensure all possible warning sites are caught.
The scripts in this directory serve to automate that process. pull_logs.py
uses the bitbucket cli tool bb
(which must be in the PATH) to pull the build logs for all trybots from a given CQ run, then collect_warnings.py
can process them to determine all the places in the codebase where a warning occurs. With that information, it's feasible to begin fixing the occurrences.
The scripts are flexible, but they are intended for use as part of the following workflow:
-Werror
by setting treat_warnings_as_errors
to false
in build/config/compiler/compiler.gni.pull_logs.py
with the CL and patchset number the CQ ran on.collect_warnings.py
with the warning flag you're interested in.The section describes particularly notable behavior. See the scripts themselves for a full list of options. Almost all options have an equivalent single-letter form.
pull_logs.py
--step
argument may be specified multiple times. If so, the scripts tries to pull logs from each step name in order until one succeeds.--log-dir
argument.--filter
flag may be used to automatically remove uninteresting lines before saving the log to disk. The definition of “interesting” is controlled by a lambda defined in the script file; by default, all lines beginning with [
are pruned. Feel free to edit the lambda locally if you want a different filter.--delete-logs
flag is passed, all .txt
files in the log directory will be deleted before the new ones are downloaded. Not using this argument can result in having stale files in the log directory, preventing accurate collection of warnings. The argument is disabled by default to prevent unintentional deletion of data.collect_warnings.py
--warning
flag is required to determine which lines correspond to the warning of interest. The value of the flag should be the ending text on the line where the compiler announces the warning, e.g. --warning [-Wthread-safety-reference-return]
. A convenient shortcut to collect all warnings in the file (frequently there will only be one type of warning anyway) is to simply pass --warning ]
.--output
argument. If the value is stdout
or -
, the text will be printed to stdout instead of a file..json
file with detailed information about each warning emitted. If the --summarize
flag is passed, it will instead output a more human-readable .txt
file which simply lists every warning site, along with a count of number of files and warnings emitted total.Pull logs for cl 1234567, patchset 8. Logs will be stored in the default location (tools/warning_analysis/build_logs
).
python3 tools/warning_analysis/pull_logs.py -cl 12345678 -p 8
Pull logs for cl 1234567, patchset 8. Delete any old logs, filter out uninteresting lines from the new logs, and print progress to the console as the script is running.
python3 tools/warning_analysis/pull_logs.py -cl 12345678 -p 8 -d --filter -v
Collect instances of clang's C++ extension warning from the default log location, and store a summary in thread_safety.txt
.
python3 tools/warning_analysis/collect_warnings.py -w [-Wvla-cxx-extension] -o cxx_extension --summarize
Collect instances of any warning, and store the detailed output in out.json
.
python3 tools/warning_analysis/collect_warnings.py -w ]
脾胃是什么 | ru是什么意思 | 中午12点到1点是什么时辰 | 树欲静而风不止是什么意思 | 尾盘跳水意味着什么 |
黄精什么时候种植 | 蟋蟀吃什么食物 | 现充什么意思 | head是什么牌子 | 糖尿病人不能吃什么水果 |
hfp是什么意思 | 流口水什么原因 | 白细胞高说明什么 | 海蜇是什么动物 | 薄荷不能和什么一起吃 |
玻尿酸是什么 | 提报是什么意思 | 垫背是什么意思 | 为什么总是想吐 | 人体缺钾是什么症状 |
午睡睡不着是什么原因hcv8jop5ns3r.cn | 药石是什么意思hcv8jop6ns4r.cn | 指尖发麻是什么原因hcv8jop6ns5r.cn | 人为什么会抽筋hcv8jop9ns0r.cn | 半月板损伤吃什么药ff14chat.com |
supor是什么品牌hcv7jop5ns6r.cn | 美的不可方物是什么意思520myf.com | ojbk是什么意思hcv9jop0ns6r.cn | 阴液是什么hcv7jop6ns8r.cn | 外耳道耵聍什么意思hcv8jop7ns8r.cn |
嗓子疼什么原因hcv8jop0ns4r.cn | 南京有什么美食hcv8jop3ns4r.cn | 立夏是什么意思hcv8jop2ns6r.cn | 露水夫妻是什么意思jasonfriends.com | 什么样的人容易低血糖hcv8jop1ns2r.cn |
相识是什么意思zhiyanzhang.com | 喉咙长息肉有什么症状hcv9jop3ns9r.cn | bolon是什么牌子眼镜hcv9jop2ns8r.cn | 身上肉疼是什么原因hcv7jop7ns1r.cn | 过期药品是什么垃圾jingluanji.com |