-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #1325 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
- Loading branch information
Shigeki Ohtsu
committed
Apr 4, 2015
1 parent
efadffe
commit 21f4fb6
Showing
1,471 changed files
with
54,748 additions
and
1,421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
"""Argument-less script to select what to run on the buildbots.""" | ||
|
||
|
||
import filecmp | ||
import os | ||
import shutil | ||
import subprocess | ||
|
@@ -30,7 +31,8 @@ | |
|
||
def CallSubProcess(*args, **kwargs): | ||
"""Wrapper around subprocess.call which treats errors as build exceptions.""" | ||
retcode = subprocess.call(*args, **kwargs) | ||
with open(os.devnull) as devnull_fd: | ||
retcode = subprocess.call(stdin=devnull_fd, *args, **kwargs) | ||
if retcode != 0: | ||
print '@@@STEP_EXCEPTION@@@' | ||
sys.exit(1) | ||
|
@@ -49,10 +51,6 @@ def PrepareCmake(): | |
|
||
print '@@@BUILD_STEP Initialize CMake checkout@@@' | ||
os.mkdir(CMAKE_DIR) | ||
CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot']) | ||
CallSubProcess(['git', 'config', '--global', | ||
'user.email', '[email protected]']) | ||
CallSubProcess(['git', 'config', '--global', 'color.ui', 'false']) | ||
|
||
print '@@@BUILD_STEP Sync CMake@@@' | ||
CallSubProcess( | ||
|
@@ -73,41 +71,96 @@ def PrepareCmake(): | |
CallSubProcess( ['make', 'cmake'], cwd=CMAKE_DIR) | ||
|
||
|
||
_ANDROID_SETUP = 'source build/envsetup.sh && lunch full-eng' | ||
|
||
|
||
def PrepareAndroidTree(): | ||
"""Prepare an Android tree to run 'android' format tests.""" | ||
if os.environ['BUILDBOT_CLOBBER'] == '1': | ||
print '@@@BUILD_STEP Clobber Android checkout@@@' | ||
shutil.rmtree(ANDROID_DIR) | ||
|
||
# The release of Android we use is static, so there's no need to do anything | ||
# if the directory already exists. | ||
if os.path.isdir(ANDROID_DIR): | ||
# (Re)create the directory so that the following steps will succeed. | ||
if not os.path.isdir(ANDROID_DIR): | ||
os.mkdir(ANDROID_DIR) | ||
|
||
# We use a manifest from the gyp project listing pinned revisions of AOSP to | ||
# use, to ensure that we test against a stable target. This needs to be | ||
# updated to pick up new build system changes sometimes, so we must test if | ||
# it has changed. | ||
manifest_filename = 'aosp_manifest.xml' | ||
gyp_manifest = os.path.join(BUILDBOT_DIR, manifest_filename) | ||
android_manifest = os.path.join(ANDROID_DIR, '.repo', 'manifests', | ||
manifest_filename) | ||
manifest_is_current = (os.path.isfile(android_manifest) and | ||
filecmp.cmp(gyp_manifest, android_manifest)) | ||
if not manifest_is_current: | ||
# It's safe to repeat these steps, so just do them again to make sure we are | ||
# in a good state. | ||
print '@@@BUILD_STEP Initialize Android checkout@@@' | ||
CallSubProcess( | ||
['repo', 'init', | ||
'-u', 'https://android.googlesource.com/platform/manifest', | ||
'-b', 'master', | ||
'-g', 'all,-notdefault,-device,-darwin,-mips,-x86'], | ||
cwd=ANDROID_DIR) | ||
shutil.copy(gyp_manifest, android_manifest) | ||
|
||
print '@@@BUILD_STEP Sync Android@@@' | ||
CallSubProcess(['repo', 'sync', '-j4', '-m', manifest_filename], | ||
cwd=ANDROID_DIR) | ||
|
||
# If we already built the system image successfully and didn't sync to a new | ||
# version of the source, skip running the build again as it's expensive even | ||
# when there's nothing to do. | ||
system_img = os.path.join(ANDROID_DIR, 'out', 'target', 'product', 'generic', | ||
'system.img') | ||
if manifest_is_current and os.path.isfile(system_img): | ||
return | ||
|
||
print '@@@BUILD_STEP Initialize Android checkout@@@' | ||
os.mkdir(ANDROID_DIR) | ||
CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot']) | ||
CallSubProcess(['git', 'config', '--global', | ||
'user.email', '[email protected]']) | ||
CallSubProcess(['git', 'config', '--global', 'color.ui', 'false']) | ||
print '@@@BUILD_STEP Build Android@@@' | ||
CallSubProcess( | ||
['repo', 'init', | ||
'-u', 'https://android.googlesource.com/platform/manifest', | ||
'-b', 'android-4.2.1_r1', | ||
'-g', 'all,-notdefault,-device,-darwin,-mips,-x86'], | ||
['/bin/bash', | ||
'-c', '%s && make -j4' % _ANDROID_SETUP], | ||
cwd=ANDROID_DIR) | ||
|
||
print '@@@BUILD_STEP Sync Android@@@' | ||
CallSubProcess(['repo', 'sync', '-j4'], cwd=ANDROID_DIR) | ||
|
||
print '@@@BUILD_STEP Build Android@@@' | ||
def StartAndroidEmulator(): | ||
"""Start an android emulator from the built android tree.""" | ||
print '@@@BUILD_STEP Start Android emulator@@@' | ||
|
||
CallSubProcess(['/bin/bash', '-c', | ||
'%s && adb kill-server ' % _ANDROID_SETUP], | ||
cwd=ANDROID_DIR) | ||
|
||
# If taskset is available, use it to force adbd to run only on one core, as, | ||
# sadly, it improves its reliability (see crbug.com/268450). | ||
adbd_wrapper = '' | ||
with open(os.devnull, 'w') as devnull_fd: | ||
if subprocess.call(['which', 'taskset'], stdout=devnull_fd) == 0: | ||
adbd_wrapper = 'taskset -c 0' | ||
CallSubProcess(['/bin/bash', '-c', | ||
'%s && %s adb start-server ' % (_ANDROID_SETUP, adbd_wrapper)], | ||
cwd=ANDROID_DIR) | ||
|
||
subprocess.Popen( | ||
['/bin/bash', '-c', | ||
'%s && emulator -no-window' % _ANDROID_SETUP], | ||
cwd=ANDROID_DIR) | ||
CallSubProcess( | ||
['/bin/bash', | ||
'-c', 'source build/envsetup.sh && lunch full-eng && make -j4'], | ||
['/bin/bash', '-c', | ||
'%s && adb wait-for-device' % _ANDROID_SETUP], | ||
cwd=ANDROID_DIR) | ||
|
||
|
||
def GypTestFormat(title, format=None, msvs_version=None): | ||
def StopAndroidEmulator(): | ||
"""Stop all android emulators.""" | ||
print '@@@BUILD_STEP Stop Android emulator@@@' | ||
# If this fails, it's because there is no emulator running. | ||
subprocess.call(['pkill', 'emulator.*']) | ||
|
||
|
||
def GypTestFormat(title, format=None, msvs_version=None, tests=[]): | ||
"""Run the gyp tests for a given format, emitting annotator tags. | ||
See annotator docs at: | ||
|
@@ -126,19 +179,18 @@ def GypTestFormat(title, format=None, msvs_version=None): | |
if msvs_version: | ||
env['GYP_MSVS_VERSION'] = msvs_version | ||
command = ' '.join( | ||
[sys.executable, 'trunk/gyptest.py', | ||
[sys.executable, 'gyp/gyptest.py', | ||
'--all', | ||
'--passed', | ||
'--format', format, | ||
'--path', CMAKE_BIN_DIR, | ||
'--chdir', 'trunk']) | ||
'--chdir', 'gyp'] + tests) | ||
if format == 'android': | ||
# gyptest needs the environment setup from envsetup/lunch in order to build | ||
# using the 'android' backend, so this is done in a single shell. | ||
retcode = subprocess.call( | ||
['/bin/bash', | ||
'-c', 'source build/envsetup.sh && lunch full-eng && cd %s && %s' | ||
% (ROOT_DIR, command)], | ||
'-c', '%s && cd %s && %s' % (_ANDROID_SETUP, ROOT_DIR, command)], | ||
cwd=ANDROID_DIR, env=env) | ||
else: | ||
retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True) | ||
|
@@ -160,7 +212,11 @@ def GypBuild(): | |
# The Android gyp bot runs on linux so this must be tested first. | ||
if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-android': | ||
PrepareAndroidTree() | ||
retcode += GypTestFormat('android') | ||
StartAndroidEmulator() | ||
try: | ||
retcode += GypTestFormat('android') | ||
finally: | ||
StopAndroidEmulator() | ||
elif sys.platform.startswith('linux'): | ||
retcode += GypTestFormat('ninja') | ||
retcode += GypTestFormat('make') | ||
|
@@ -173,8 +229,13 @@ def GypBuild(): | |
elif sys.platform == 'win32': | ||
retcode += GypTestFormat('ninja') | ||
if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-win64': | ||
retcode += GypTestFormat('msvs-2010', format='msvs', msvs_version='2010') | ||
retcode += GypTestFormat('msvs-2012', format='msvs', msvs_version='2012') | ||
retcode += GypTestFormat('msvs-ninja-2013', format='msvs-ninja', | ||
msvs_version='2013', | ||
tests=[ | ||
r'test\generator-output\gyptest-actions.py', | ||
r'test\generator-output\gyptest-relocate.py', | ||
r'test\generator-output\gyptest-rules.py']) | ||
retcode += GypTestFormat('msvs-2013', format='msvs', msvs_version='2013') | ||
else: | ||
raise Exception('Unknown platform') | ||
if retcode: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
set noparent | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cq_config.json describes the trybots that must pass in order | ||
to land a change through the commit queue. | ||
Comments are here as the file is strictly JSON. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"trybots": { | ||
"launched": { | ||
"tryserver.nacl": { | ||
"gyp-presubmit": ["defaulttests"], | ||
"gyp-android": ["defaulttests"], | ||
"gyp-linux": ["defaulttests"], | ||
"gyp-mac": ["defaulttests"], | ||
"gyp-win32": ["defaulttests"], | ||
"gyp-win64": ["defaulttests"] | ||
} | ||
}, | ||
"triggered": { | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# This file is used by gcl to get repository specific information. | ||
CODE_REVIEW_SERVER: codereview.chromium.org | ||
CC_LIST: [email protected] | ||
VIEW_VC: http://code.google.com/p/gyp/source/detail?r= | ||
TRY_ON_UPLOAD: True | ||
VIEW_VC: https://chromium.googlesource.com/external/gyp/+/ | ||
TRY_ON_UPLOAD: False | ||
TRYSERVER_PROJECT: gyp | ||
TRYSERVER_PATCHLEVEL: 0 | ||
TRYSERVER_ROOT: trunk | ||
TRYSERVER_PATCHLEVEL: 1 | ||
TRYSERVER_ROOT: gyp | ||
TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try-nacl | ||
|
||
PROJECT: gyp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.