Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1355)

Side by Side Diff: build/landmines.py

Issue 23604016: Make landmines.py take an extra script via an env var. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ 6 """
7 This script runs every build as a hook. If it detects that the build should 7 This script runs every build as a hook. If it detects that the build should
8 be clobbered, it will touch the file <build_dir>/.landmine_triggered. The 8 be clobbered, it will touch the file <build_dir>/.landmine_triggered. The
9 various build scripts will then check for the presence of this file and clobber 9 various build scripts will then check for the presence of this file and clobber
10 accordingly. The script will also emit the reasons for the clobber to stdout. 10 accordingly. The script will also emit the reasons for the clobber to stdout.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 '-s', '--landmine-scripts', action='append', 89 '-s', '--landmine-scripts', action='append',
90 default=[os.path.join(SRC_DIR, 'build', 'get_landmines.py')], 90 default=[os.path.join(SRC_DIR, 'build', 'get_landmines.py')],
91 help='Path to the script which emits landmines to stdout. The target ' 91 help='Path to the script which emits landmines to stdout. The target '
92 'is passed to this script via option -t.') 92 'is passed to this script via option -t.')
93 parser.add_option('-v', '--verbose', action='store_true', 93 parser.add_option('-v', '--verbose', action='store_true',
94 default=('LANDMINES_VERBOSE' in os.environ), 94 default=('LANDMINES_VERBOSE' in os.environ),
95 help=('Emit some extra debugging information (default off). This option ' 95 help=('Emit some extra debugging information (default off). This option '
96 'is also enabled by the presence of a LANDMINES_VERBOSE environment ' 96 'is also enabled by the presence of a LANDMINES_VERBOSE environment '
97 'variable.')) 97 'variable.'))
98 98
99 options, args = parser.parse_args() 99 options, args = parser.parse_args()
iannucci 2013/08/30 22:07:51 Just do: extra_script = os.environ.get('EXTRA_LAN
Siva Chandra 2013/08/30 22:17:07 Done. Some reviewers do not like changing cmd line
100 100
101 if args: 101 if args:
102 parser.error('Unknown arguments %s' % args) 102 parser.error('Unknown arguments %s' % args)
103 103
104 logging.basicConfig( 104 logging.basicConfig(
105 level=logging.DEBUG if options.verbose else logging.ERROR) 105 level=logging.DEBUG if options.verbose else logging.ERROR)
106 106
107 gyp_helper.apply_chromium_gyp_env() 107 gyp_helper.apply_chromium_gyp_env()
108 108
109 for target in ('Debug', 'Release', 'Debug_x64', 'Release_x64'): 109 for target in ('Debug', 'Release', 'Debug_x64', 'Release_x64'):
110 landmines = [] 110 landmines = []
111 for s in options.landmine_scripts: 111 for s in options.landmine_scripts:
112 proc = subprocess.Popen([sys.executable, s, '-t', target], 112 proc = subprocess.Popen([sys.executable, s, '-t', target],
113 stdout=subprocess.PIPE) 113 stdout=subprocess.PIPE)
114 output, _ = proc.communicate() 114 output, _ = proc.communicate()
115 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) 115 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()])
116
117 extra_script = os.environ.get('EXTRA_LANDMINES_SCRIPT')
118 if extra_script:
119 proc = subprocess.Popen([sys.executable, extra_script, '-t', target],
120 stdout=subprocess.PIPE)
121 output, _ = p.communicate()
122 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()])
123
116 set_up_landmines(target, landmines) 124 set_up_landmines(target, landmines)
117 125
118 return 0 126 return 0
119 127
120 128
121 if __name__ == '__main__': 129 if __name__ == '__main__':
122 sys.exit(main()) 130 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698