Commit 0b3b7882 authored by dpranke's avatar dpranke Committed by Commit bot

Re-roll GN to 326666 and fix GN-related bugs.

Fix bugs related to the latest GN roll.

1) the new GN binary will return an error if you pass it
a file it doesn't know anything about in 'gn refs'.

2) for some reason with the new GN binary we're triggering a
code path in gyp_flag_compare.py that wasn't running before,
and that code path was busted.

TBR=brettw@chromium.org
BUG=
CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:linux_chromium_gn_dbg;tryserver.chromium.mac:mac_chromium_gn_rel,mac_chromium_gn_dbg;tryserver.chromium.win:win8_chromium_gn_rel

Review URL: https://codereview.chromium.org/1109453002

Cr-Commit-Position: refs/heads/master@{#326736}
parent 950d0c46
......@@ -62,7 +62,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling build tools
# and whatever else without interference from each other.
'buildtools_revision': '3b302fef93f7cc58d9b8168466905237484b2772',
'buildtools_revision': '15308f469a704c45d15567fa69cd94ce07ad0e1b',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling PDFium
# and whatever else without interference from each other.
......
......@@ -66,7 +66,7 @@ def NormalizeSymbolArguments(command_line):
# Rename -g2 to -g.
if '-g2' in command_line:
command_line[index('-g2')] = '-g'
command_line[command_line.index('-g2')] = '-g'
def GetFlags(lines):
......
......@@ -430,7 +430,7 @@ class MetaBuildWrapper(object):
cmd = self.GNCmd('refs', self.args.path[0]) + [
'//' + f, '--type=executable', '--all', '--as=output']
ret, out, _ = self.Run(cmd)
if ret:
if ret and not 'The input matches no targets' in out:
self.WriteFailureAndRaise('gn refs returned %d: %s' % (ret, out),
output_path)
......
......@@ -153,6 +153,24 @@ class UnitTest(unittest.TestCase):
'status': 'Found dependency (all)',
})
def test_gn_analyze_missing_file(self):
files = {'/tmp/in.json': """{\
"files": ["foo/foo_unittest.cc"],
"targets": ["bar_unittests"]
}"""}
mbw = self.fake_mbw(files)
mbw.Call = lambda cmd: (
1, 'The input matches no targets, configs, or files\n', '')
self.check(['analyze', '-c', 'gn_debug', '//out/Default',
'/tmp/in.json', '/tmp/out.json'], mbw=mbw, ret=0)
out = json.loads(mbw.files['/tmp/out.json'])
self.assertEqual(out, {
'build_targets': [],
'targets': [],
'status': 'No dependency',
})
def test_gyp_analyze(self):
self.check(['analyze', '-c', 'gyp_rel_bot', '//out/Release',
'/tmp/in.json', '/tmp/out.json'],
......
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