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

Unified Diff: tools/cr/cr/actions/ninja.py

Issue 131543004: Make cr build run goma_ctl.py ensure_start before building. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/cr/cr/base/host.py » ('j') | tools/cr/cr/base/host.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cr/cr/actions/ninja.py
diff --git a/tools/cr/cr/actions/ninja.py b/tools/cr/cr/actions/ninja.py
index 404e6caea26e11360bf1b874e72c8de38f3fd697..6a8bd1900ba9def5d628aa1d12ea91355d947606 100644
--- a/tools/cr/cr/actions/ninja.py
+++ b/tools/cr/cr/actions/ninja.py
@@ -30,6 +30,26 @@ class NinjaBuilder(cr.Builder):
self._targets = []
def Build(self, context, targets, arguments):
+ # Make sure Goma is started, if Ninja is set to use it.
+ # This may be redundant, but it currently improves reliability.
+ try:
ian_cottrell 2014/01/09 17:00:21 I would change how you build paths. Use NINJA_BU
johnme 2014/01/09 19:06:11 Done.
+ goma_dir = context.Get('GOMA_DIR', raise_errors=True)
+ build_dir = context.Get('CR_BUILD_DIR', raise_errors=True)
+ build_ninja = os.path.join(build_dir, 'build.ninja')
+ if os.path.exists(build_ninja):
+ goma_cc = 'cc = {} $\n'.format(os.path.join(goma_dir, 'gomacc'))
+ with open(build_ninja, 'r') as f:
ian_cottrell 2014/01/09 17:00:21 This is vile, but I don't have a better suggestion
+ if f.readline() == goma_cc:
+ # Goma is active, so make sure it's started.
+ cr.Host.ExecuteSilently(
+ context,
+ os.path.join('{GOMA_DIR}', 'goma_ctl.py'),
+ 'ensure_start'
+ )
+ except KeyError:
+ pass
+
+
build_arguments = [target.build_target for target in targets]
build_arguments.extend(arguments)
cr.Host.Execute(
« no previous file with comments | « no previous file | tools/cr/cr/base/host.py » ('j') | tools/cr/cr/base/host.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698