summaryrefslogtreecommitdiff
path: root/tools/gyp/buildbot
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-12-21 12:39:36 -0800
committerRyan Dahl <ry@tinyclouds.org>2011-12-21 12:39:36 -0800
commit60a9e1e40fd520a224b4a971a464227e6838e7af (patch)
treeba39e4f3af1303045a00c77c9b3ac8a491dbf047 /tools/gyp/buildbot
parentf7f8af842077be4e6cc580ddedcccea71e073bbb (diff)
downloadandroid-node-v8-60a9e1e40fd520a224b4a971a464227e6838e7af.tar.gz
android-node-v8-60a9e1e40fd520a224b4a971a464227e6838e7af.tar.bz2
android-node-v8-60a9e1e40fd520a224b4a971a464227e6838e7af.zip
Upgrade GYP to r1115
Diffstat (limited to 'tools/gyp/buildbot')
-rwxr-xr-xtools/gyp/buildbot/buildbot_run.py81
1 files changed, 70 insertions, 11 deletions
diff --git a/tools/gyp/buildbot/buildbot_run.py b/tools/gyp/buildbot/buildbot_run.py
index df1cc8ad5e..a8531258b2 100755
--- a/tools/gyp/buildbot/buildbot_run.py
+++ b/tools/gyp/buildbot/buildbot_run.py
@@ -13,7 +13,45 @@ import subprocess
import sys
-def GypTestFormat(title, format, msvs_version=None):
+if sys.platform in ['win32', 'cygwin']:
+ EXE_SUFFIX = '.exe'
+else:
+ EXE_SUFFIX = ''
+
+
+BUILDBOT_DIR = os.path.dirname(os.path.abspath(__file__))
+TRUNK_DIR = os.path.dirname(BUILDBOT_DIR)
+ROOT_DIR = os.path.dirname(TRUNK_DIR)
+OUT_DIR = os.path.join(TRUNK_DIR, 'out')
+NINJA_PATH = os.path.join(TRUNK_DIR, 'ninja' + EXE_SUFFIX)
+NINJA_WORK_DIR = os.path.join(ROOT_DIR, 'ninja_work')
+
+
+def InstallNinja():
+ """Install + build ninja.
+
+ Returns:
+ 0 for success, 1 for failure.
+ """
+ print '@@@BUILD_STEP install ninja@@@'
+ # Delete old version if any.
+ try:
+ shutil.rmtree(NINJA_WORK_DIR, ignore_errors=True)
+ except:
+ pass
+ # Sync new copy from git.
+ subprocess.check_call(
+ 'git clone https://github.com/martine/ninja.git ' + NINJA_WORK_DIR,
+ shell=True)
+ # Bootstrap.
+ subprocess.check_call('./bootstrap.sh', cwd=NINJA_WORK_DIR, shell=True)
+ # Copy out ninja.
+ shutil.copyfile(os.path.join(NINJA_WORK_DIR, 'ninja' + EXE_SUFFIX),
+ NINJA_PATH)
+ os.chmod(NINJA_PATH, 0777)
+
+
+def GypTestFormat(title, format=None, msvs_version=None):
"""Run the gyp tests for a given format, emitting annotator tags.
See annotator docs at:
@@ -23,12 +61,27 @@ def GypTestFormat(title, format, msvs_version=None):
Returns:
0 for sucesss, 1 for failure.
"""
+ if not format:
+ format = title
+
+ # Install ninja if needed.
+ # NOTE: as ninja gets installed each time, regressions to ninja can come
+ # either from changes to ninja itself, or changes to gyp.
+ if format == 'ninja':
+ try:
+ InstallNinja()
+ except Exception, e:
+ print '@@@STEP_FAILURE@@@'
+ print str(e)
+ return 1
+
print '@@@BUILD_STEP ' + title + '@@@'
sys.stdout.flush()
- buildbot_dir = os.path.dirname(os.path.abspath(__file__))
- trunk_dir = os.path.dirname(buildbot_dir)
- root_dir = os.path.dirname(trunk_dir)
env = os.environ.copy()
+ # TODO(bradnelson): remove this when this issue is resolved:
+ # http://code.google.com/p/chromium/issues/detail?id=108251
+ if format == 'ninja':
+ env['NOGOLD'] = '1'
if msvs_version:
env['GYP_MSVS_VERSION'] = msvs_version
retcode = subprocess.call(' '.join(
@@ -38,7 +91,7 @@ def GypTestFormat(title, format, msvs_version=None):
'--format', format,
'--chdir', 'trunk',
'--path', '../scons']),
- cwd=root_dir, env=env, shell=True)
+ cwd=ROOT_DIR, env=env, shell=True)
if retcode:
# Emit failure tag, and keep going.
print '@@@STEP_FAILURE@@@'
@@ -49,17 +102,23 @@ def GypTestFormat(title, format, msvs_version=None):
def GypBuild():
# Dump out/ directory.
print '@@@BUILD_STEP cleanup@@@'
- print 'Removing out/ ...'
- shutil.rmtree('out', ignore_errors=True)
+ print 'Removing %s...' % OUT_DIR
+ shutil.rmtree(OUT_DIR, ignore_errors=True)
+ print 'Removing %s...' % NINJA_WORK_DIR
+ shutil.rmtree(NINJA_WORK_DIR, ignore_errors=True)
+ print 'Removing %s...' % NINJA_PATH
+ shutil.rmtree(NINJA_PATH, ignore_errors=True)
print 'Done.'
retcode = 0
if sys.platform.startswith('linux'):
- retcode += GypTestFormat('scons', format='scons')
- retcode += GypTestFormat('make', format='make')
+ retcode += GypTestFormat('ninja')
+ retcode += GypTestFormat('scons')
+ retcode += GypTestFormat('make')
elif sys.platform == 'darwin':
- retcode += GypTestFormat('xcode', format='xcode')
- retcode += GypTestFormat('make', format='make')
+ retcode += GypTestFormat('ninja')
+ retcode += GypTestFormat('xcode')
+ retcode += GypTestFormat('make')
elif sys.platform == 'win32':
retcode += GypTestFormat('msvs-2008', format='msvs', msvs_version='2008')
if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-win64':