Commit 0bab9f84 authored by Ben Wagner's avatar Ben Wagner Committed by Commit Bot

Fuzzer owner finding to fail early on gn warning.

If a user has an args.gn which specifies an argument which isn't
actually used in the build, gn will output a warning on stdout (instead
of stderr) but otherwise continue as normal. Then gen_fuzzer_owners.py
in GetSourcesFromDeps will add a number of 'sources' which are actually
lines from the warning message. This leads to difficult to diagnose
errors later on.

Since there is no means to suppress this warning nor move it to stderr,
this change adds '--fail-on-unused-args' to the gn command so that the
owner finding will fail earlier and and more obviously.

Change-Id: I617fe3b500ada13323b77bb18c8e40b256144833
Reviewed-on: https://chromium-review.googlesource.com/c/1286731Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Reviewed-by: default avatarAbhishek Arya <inferno@chromium.org>
Commit-Queue: Ben Wagner <bungeman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600466}
parent 783d2c26
......@@ -104,7 +104,8 @@ def FindGroupsAndDepsInDeps(deps_list, build_dir):
groups = []
deps_for_groups = {}
for deps in deps_list:
output = subprocess.check_output([GNPath(), 'desc', build_dir, deps])
output = subprocess.check_output(
[GNPath(), 'desc', '--fail-on-unused-args', build_dir, deps])
needle = 'Type: '
for line in output.splitlines():
if needle and not line.startswith(needle):
......@@ -164,7 +165,7 @@ def GetSourcesFromDeps(deps_list, build_dir):
all_sources = []
for deps in full_deps_list:
output = subprocess.check_output(
[GNPath(), 'desc', build_dir, deps, 'sources'])
[GNPath(), 'desc', '--fail-on-unused-args', build_dir, deps, 'sources'])
for source in output.splitlines():
if source.startswith('//'):
source = source[2:]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment