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

Side by Side Diff: build/landmines.py

Issue 2959743004: Add comment warning about modifying landmines (Closed)
Patch Set: Created 3 years, 5 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
« 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 the first hook (See DEPS). If it detects that 7 This script runs every build as the first hook (See DEPS). If it detects that
8 the build should be clobbered, it will delete the contents of the build 8 the build should be clobbered, it will delete the contents of the build
9 directory. 9 directory.
10 10
11 A landmine is tripped when a builder checks out a different revision, and the 11 A landmine is tripped when a builder checks out a different revision, and the
12 diff between the new landmines and the old ones is non-null. At this point, the 12 diff between the new landmines and the old ones is non-null. At this point, the
13 build is clobbered. 13 build is clobbered.
14
15 Before adding or changing a landmine consider the consequences of doing so.
16 Doing so will wipe out every output directory on every Chrome developer's
17 machine. This can be particularly problematic on Windows where the directory
18 deletion may well fail (locked files, command prompt in the directory, etc.),
19 and generated .sln and .vcxproj files will be deleted.
20
21 This output directory deletion will be repated when going back and forth across
22 the change that added the landmine, adding to the cost. There are usually less
23 troublesome alternatives.
14 """ 24 """
15 25
16 import difflib 26 import difflib
17 import errno 27 import errno
18 import gyp_environment 28 import gyp_environment
19 import logging 29 import logging
20 import optparse 30 import optparse
21 import os 31 import os
22 import sys 32 import sys
23 import subprocess 33 import subprocess
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE) 139 proc = subprocess.Popen([sys.executable, s], stdout=subprocess.PIPE)
130 output, _ = proc.communicate() 140 output, _ = proc.communicate()
131 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()]) 141 landmines.extend([('%s\n' % l.strip()) for l in output.splitlines()])
132 clobber_if_necessary(landmines, options.src_dir) 142 clobber_if_necessary(landmines, options.src_dir)
133 143
134 return 0 144 return 0
135 145
136 146
137 if __name__ == '__main__': 147 if __name__ == '__main__':
138 sys.exit(main()) 148 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