Using pre-existing constants instead of hard-coding
[chromium-blink-merge.git] / build / get_landmines.py
blobdaa917229d767437922712c6b11d0c6c00af014f
1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 """
7 This file emits the list of reasons why a particular build needs to be clobbered
8 (or a list of 'landmines').
9 """
11 import optparse
12 import sys
14 import landmine_utils
17 builder = landmine_utils.builder
18 distributor = landmine_utils.distributor
19 gyp_defines = landmine_utils.gyp_defines
20 gyp_msvs_version = landmine_utils.gyp_msvs_version
21 platform = landmine_utils.platform
24 def print_landmines(target):
25 """
26 ALL LANDMINES ARE EMITTED FROM HERE.
27 target can be one of {'Release', 'Debug', 'Debug_x64', 'Release_x64'}.
28 """
29 if (distributor() == 'goma' and platform() == 'win32' and
30 builder() == 'ninja'):
31 print 'Need to clobber winja goma due to backend cwd cache fix.'
32 if platform() == 'android':
33 print 'Clobber: build_size.jar needs to be deleted (issue 258633003)'
34 if platform() == 'win' and builder() == 'ninja':
35 print 'Compile on cc_unittests fails due to symbols removed in r185063.'
36 if platform() == 'linux' and builder() == 'ninja':
37 print 'Builders switching from make to ninja will clobber on this.'
38 if platform() == 'mac':
39 print 'Switching from bundle to unbundled dylib (issue 14743002).'
40 if platform() in ('win', 'mac'):
41 print ('Improper dependency for create_nmf.py broke in r240802, '
42 'fixed in r240860.')
43 if (platform() == 'win' and builder() == 'ninja' and
44 gyp_msvs_version() == '2012' and
45 gyp_defines().get('target_arch') == 'x64' and
46 gyp_defines().get('dcheck_always_on') == '1'):
47 print "Switched win x64 trybots from VS2010 to VS2012."
48 if (platform() == 'win' and builder() == 'ninja' and
49 gyp_msvs_version().startswith('2013')):
50 print "Switched win from VS2010 to VS2013."
51 print "Update to VS2013 Update 2."
52 print 'Need to clobber everything due to an IDL change in r154579 (blink)'
53 if (platform() != 'ios'):
54 print 'Clobber to get rid of obselete test plugin after r248358'
57 def main():
58 parser = optparse.OptionParser()
59 parser.add_option('-t', '--target',
60 help=='Target for which the landmines have to be emitted')
62 options, args = parser.parse_args()
64 if args:
65 parser.error('Unknown arguments %s' % args)
67 print_landmines(options.target)
68 return 0
71 if __name__ == '__main__':
72 sys.exit(main())