Index: build/landmines.py |
diff --git a/build/landmines.py b/build/landmines.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5254b504197c29ae67ed941e9a3eb9b6af9a3795 |
--- /dev/null |
+++ b/build/landmines.py |
@@ -0,0 +1,42 @@ |
+# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
cmp_google
2012/10/20 22:27:16
before line 1, insert a #!/usr/bin/python call
|
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+""" |
+This file holds a list of reasons why a particular build needs to be clobbered |
+(or a list of 'landmines'). |
+ |
+On every bulid, a list of landmines is generated by running this file and |
cmp_google
2012/10/20 22:27:16
bulid -> build
|
+saving its output to <build_dir>/<target>/.landmines |
+ |
+A landmine is tripped when a builder checks out a different revision, and the |
+diff between the new landmines and the old ones is non-null. At this point, the |
+build is clobbered. |
+""" |
+ |
+import sys |
+import json |
cmp_google
2012/10/20 22:27:16
line 18 before line 17
|
+ |
+# Expect no args, JSON on stdin |
cmp_google
2012/10/20 22:27:16
append a period
|
+assert len(sys.argv) == 1 |
cmp_google
2012/10/20 22:27:16
would be better to output usage text here, and pri
|
+OPTIONS = json.load(sys.stdin) |
+ |
+# Some keys in OPTIONS, and example values |
+# target -> release, debug |
+# distributor -> goma, ib // build distribution platform |
+# platform -> win32, mac, linux, android, ios |
+# arch -> ia32, x64, ... |
+# builder -> make, ninja, vs |
+# msvs -> |
+# version -> 2010, 2012 |
+ |
+def o(key, default=''): |
cmp_google
2012/10/20 22:27:16
o is very bare, how about opt instead
|
+ return OPTIONS.get(key, default) |
+ |
+MSVS_VERSION = o('msvs', {}).get('version', '') |
cmp_google
2012/10/20 22:27:16
this line is not used, let's remove it
|
+ |
+# Now for the good part |
cmp_google
2012/10/20 22:27:16
let's ditch this comment
|
+ |
+if o('distributor') == 'goma' and o('platform') == 'win32' and \ |
+ o('builder') == 'ninja': |
cmp_google
2012/10/20 22:27:16
to span multiple lines, we prefer to prepend a par
|
+ print 'Need to clobber winja goma due to backend cwd cache fix' |
cmp_google
2012/10/20 22:27:16
append a period to the end of the sentence here
l
|