| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import argparse | 5 import argparse |
| 6 import datetime | 6 import datetime |
| 7 import difflib | 7 import difflib |
| 8 import random | 8 import random |
| 9 import re | 9 import re |
| 10 import urllib | 10 import urllib |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 # No '=' in x. It's part of a quoted string containing a space. | 425 # No '=' in x. It's part of a quoted string containing a space. |
| 426 # Append it to the last value. | 426 # Append it to the last value. |
| 427 result[-1][1] += (' ' + kv[0]) | 427 result[-1][1] += (' ' + kv[0]) |
| 428 else: | 428 else: |
| 429 result.append(kv) | 429 result.append(kv) |
| 430 return dict(tuple(kv) for kv in result) | 430 return dict(tuple(kv) for kv in result) |
| 431 | 431 |
| 432 infra_flags = gyp_defines_to_dict( | 432 infra_flags = gyp_defines_to_dict( |
| 433 self.m.chromium.c.gyp_env.as_jsonish()['GYP_DEFINES']) | 433 self.m.chromium.c.gyp_env.as_jsonish()['GYP_DEFINES']) |
| 434 | 434 |
| 435 # Get the client's gyp flags from MB's output. | 435 # Get the client's gyp flags from MB's output. Group 1 captures with posix, |
| 436 match = re.search('^GYP_DEFINES=\'(.*)\'$', mb_output, re.M) | 436 # group 2 with windows output semantics. |
| 437 # |
| 438 # Posix: |
| 439 # GYP_DEFINES='foo=1 path=a/b/c' |
| 440 # |
| 441 # Windows: |
| 442 # set GYP_DEFINES=foo=1 path='a/b/c' |
| 443 match = re.search( |
| 444 '^(?:set )?GYP_DEFINES=(?:(?:\'(.*)\')|(?:(.*)))$', mb_output, re.M) |
| 437 | 445 |
| 438 # This won't match in the gn case. | 446 # This won't match in the gn case. |
| 439 if match: | 447 if match: |
| 440 client_flags = gyp_defines_to_dict(match.group(1)) | 448 client_flags = gyp_defines_to_dict(match.group(1) or match.group(2)) |
| 441 | 449 |
| 442 # Tweak both dictionaries for known differences. | 450 # Tweak both dictionaries for known differences. |
| 443 if infra_flags.get('target_arch') == infra_flags.get('v8_target_arch'): | 451 if infra_flags.get('target_arch') == infra_flags.get('v8_target_arch'): |
| 444 # We drop the default case target_arch==v8_target_arch in MB and | 452 # We drop the default case target_arch==v8_target_arch in MB and |
| 445 # only specify target_arch. | 453 # only specify target_arch. |
| 446 infra_flags.pop('v8_target_arch') # pragma: no cover | 454 infra_flags.pop('v8_target_arch') # pragma: no cover |
| 447 | 455 |
| 448 if 'jsfunfuzz' in infra_flags: | 456 if 'jsfunfuzz' in infra_flags: |
| 449 # This is for runhooks only. Not used in MB. | 457 # This is for runhooks only. Not used in MB. |
| 450 infra_flags.pop('jsfunfuzz') # pragma: no cover | 458 infra_flags.pop('jsfunfuzz') # pragma: no cover |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 def report_culprits(self, culprit_range): | 1263 def report_culprits(self, culprit_range): |
| 1256 assert culprit_range | 1264 assert culprit_range |
| 1257 if len(culprit_range) > 1: | 1265 if len(culprit_range) > 1: |
| 1258 text = 'Suspecting multiple commits' | 1266 text = 'Suspecting multiple commits' |
| 1259 else: | 1267 else: |
| 1260 text = 'Suspecting %s' % culprit_range[0][:8] | 1268 text = 'Suspecting %s' % culprit_range[0][:8] |
| 1261 | 1269 |
| 1262 step_result = self.m.step(text, cmd=None) | 1270 step_result = self.m.step(text, cmd=None) |
| 1263 for culprit in culprit_range: | 1271 for culprit in culprit_range: |
| 1264 step_result.presentation.links[culprit[:8]] = COMMIT_TEMPLATE % culprit | 1272 step_result.presentation.links[culprit[:8]] = COMMIT_TEMPLATE % culprit |
| OLD | NEW |