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

Side by Side Diff: tools/gn/bin/roll_gn.py

Issue 1363703003: Attempt to fix race in GN auto-roller again. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« 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 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 """An auto-roller for GN binaries into Chromium. 5 """An auto-roller for GN binaries into Chromium.
6 6
7 This script is used to update the GN binaries that a Chromium 7 This script is used to update the GN binaries that a Chromium
8 checkout uses. In order to update the binaries, one must follow 8 checkout uses. In order to update the binaries, one must follow
9 four steps in order: 9 four steps in order:
10 10
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 deps_content = fp.read() 174 deps_content = fp.read()
175 new_deps = deps_content.replace("'buildtools_revision':", 175 new_deps = deps_content.replace("'buildtools_revision':",
176 "'buildtools_revision': ") 176 "'buildtools_revision': ")
177 177
178 with open('DEPS', 'w') as fp: 178 with open('DEPS', 'w') as fp:
179 fp.write(new_deps) 179 fp.write(new_deps)
180 180
181 def WaitForBuildToFinish(self): 181 def WaitForBuildToFinish(self):
182 print('Checking build') 182 print('Checking build')
183 results = self.CheckBuild() 183 results = self.CheckBuild()
184 while (len(results) or 184 while (len(results) < 3 or
185 any(r['state'] == 'pending' for r in results.values())): 185 any(r['state'] == 'pending' for r in results.values())):
186 print() 186 print()
187 print('Sleeping for 30 seconds') 187 print('Sleeping for 30 seconds')
188 time.sleep(30) 188 time.sleep(30)
189 print('Checking build') 189 print('Checking build')
190 results = self.CheckBuild() 190 results = self.CheckBuild()
191 return 0 if all(r['state'] == 'success' for r in results.values()) else 1 191 return 0 if all(r['state'] == 'success' for r in results.values()) else 1
192 192
193 def CheckBuild(self): 193 def CheckBuild(self):
194 _, out, _ = self.Call('git-cl issue') 194 _, out, _ = self.Call('git-cl issue')
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 def Call(self, cmd, cwd=None): 406 def Call(self, cmd, cwd=None):
407 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, 407 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True,
408 cwd=(cwd or self.chromium_src_dir)) 408 cwd=(cwd or self.chromium_src_dir))
409 out, err = proc.communicate() 409 out, err = proc.communicate()
410 return proc.returncode, out, err 410 return proc.returncode, out, err
411 411
412 412
413 if __name__ == '__main__': 413 if __name__ == '__main__':
414 roller = GNRoller() 414 roller = GNRoller()
415 sys.exit(roller.Roll()) 415 sys.exit(roller.Roll())
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