Skip to content

Commit 21f4fb6

Browse files
author
Shigeki Ohtsu
committed
deps: update gyp to e1c8fcf7
PR-URL: #1325 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent efadffe commit 21f4fb6

File tree

1,471 files changed

+54748
-1421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,471 files changed

+54748
-1421
lines changed

tools/gyp/PRESUBMIT.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@
1616
'test/lib/TestCmd.py',
1717
'test/lib/TestCommon.py',
1818
'test/lib/TestGyp.py',
19-
# Needs style fix.
20-
'pylib/gyp/generator/xcode.py',
2119
]
2220

2321

2422
PYLINT_DISABLED_WARNINGS = [
2523
# TODO: fix me.
2624
# Many tests include modules they don't use.
2725
'W0611',
26+
# Possible unbalanced tuple unpacking with sequence.
27+
'W0632',
28+
# Attempting to unpack a non-sequence.
29+
'W0633',
2830
# Include order doesn't properly include local files?
2931
'F0401',
3032
# Some use of built-in names.
@@ -40,6 +42,10 @@
4042
'W0613',
4143
# String has no effect (docstring in wrong place).
4244
'W0105',
45+
# map/filter on lambda could be replaced by comprehension.
46+
'W0110',
47+
# Use of eval.
48+
'W0123',
4349
# Comma not followed by space.
4450
'C0324',
4551
# Access to a protected member.
@@ -56,6 +62,8 @@
5662
'E1101',
5763
# Dangerous default {}.
5864
'W0102',
65+
# Cyclic import.
66+
'R0401',
5967
# Others, too many to sort.
6068
'W0201', 'W0232', 'E1103', 'W0621', 'W0108', 'W0223', 'W0231',
6169
'R0201', 'E0101', 'C0321',
@@ -116,5 +124,16 @@ def CheckChangeOnCommit(input_api, output_api):
116124
return report
117125

118126

119-
def GetPreferredTrySlaves():
120-
return ['gyp-win32', 'gyp-win64', 'gyp-linux', 'gyp-mac', 'gyp-android']
127+
TRYBOTS = [
128+
'gyp-win32',
129+
'gyp-win64',
130+
'gyp-linux',
131+
'gyp-mac',
132+
'gyp-android'
133+
]
134+
135+
136+
def GetPreferredTryMasters(_, change):
137+
return {
138+
'tryserver.nacl': { t: set(['defaulttests']) for t in TRYBOTS },
139+
}

tools/gyp/buildbot/aosp_manifest.xml

Lines changed: 466 additions & 0 deletions
Large diffs are not rendered by default.

tools/gyp/buildbot/buildbot_run.py

Lines changed: 92 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"""Argument-less script to select what to run on the buildbots."""
88

99

10+
import filecmp
1011
import os
1112
import shutil
1213
import subprocess
@@ -30,7 +31,8 @@
3031

3132
def CallSubProcess(*args, **kwargs):
3233
"""Wrapper around subprocess.call which treats errors as build exceptions."""
33-
retcode = subprocess.call(*args, **kwargs)
34+
with open(os.devnull) as devnull_fd:
35+
retcode = subprocess.call(stdin=devnull_fd, *args, **kwargs)
3436
if retcode != 0:
3537
print '@@@STEP_EXCEPTION@@@'
3638
sys.exit(1)
@@ -49,10 +51,6 @@ def PrepareCmake():
4951

5052
print '@@@BUILD_STEP Initialize CMake checkout@@@'
5153
os.mkdir(CMAKE_DIR)
52-
CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot'])
53-
CallSubProcess(['git', 'config', '--global',
54-
'user.email', '[email protected]'])
55-
CallSubProcess(['git', 'config', '--global', 'color.ui', 'false'])
5654

5755
print '@@@BUILD_STEP Sync CMake@@@'
5856
CallSubProcess(
@@ -73,41 +71,96 @@ def PrepareCmake():
7371
CallSubProcess( ['make', 'cmake'], cwd=CMAKE_DIR)
7472

7573

74+
_ANDROID_SETUP = 'source build/envsetup.sh && lunch full-eng'
75+
76+
7677
def PrepareAndroidTree():
7778
"""Prepare an Android tree to run 'android' format tests."""
7879
if os.environ['BUILDBOT_CLOBBER'] == '1':
7980
print '@@@BUILD_STEP Clobber Android checkout@@@'
8081
shutil.rmtree(ANDROID_DIR)
8182

82-
# The release of Android we use is static, so there's no need to do anything
83-
# if the directory already exists.
84-
if os.path.isdir(ANDROID_DIR):
83+
# (Re)create the directory so that the following steps will succeed.
84+
if not os.path.isdir(ANDROID_DIR):
85+
os.mkdir(ANDROID_DIR)
86+
87+
# We use a manifest from the gyp project listing pinned revisions of AOSP to
88+
# use, to ensure that we test against a stable target. This needs to be
89+
# updated to pick up new build system changes sometimes, so we must test if
90+
# it has changed.
91+
manifest_filename = 'aosp_manifest.xml'
92+
gyp_manifest = os.path.join(BUILDBOT_DIR, manifest_filename)
93+
android_manifest = os.path.join(ANDROID_DIR, '.repo', 'manifests',
94+
manifest_filename)
95+
manifest_is_current = (os.path.isfile(android_manifest) and
96+
filecmp.cmp(gyp_manifest, android_manifest))
97+
if not manifest_is_current:
98+
# It's safe to repeat these steps, so just do them again to make sure we are
99+
# in a good state.
100+
print '@@@BUILD_STEP Initialize Android checkout@@@'
101+
CallSubProcess(
102+
['repo', 'init',
103+
'-u', 'https://android.googlesource.com/platform/manifest',
104+
'-b', 'master',
105+
'-g', 'all,-notdefault,-device,-darwin,-mips,-x86'],
106+
cwd=ANDROID_DIR)
107+
shutil.copy(gyp_manifest, android_manifest)
108+
109+
print '@@@BUILD_STEP Sync Android@@@'
110+
CallSubProcess(['repo', 'sync', '-j4', '-m', manifest_filename],
111+
cwd=ANDROID_DIR)
112+
113+
# If we already built the system image successfully and didn't sync to a new
114+
# version of the source, skip running the build again as it's expensive even
115+
# when there's nothing to do.
116+
system_img = os.path.join(ANDROID_DIR, 'out', 'target', 'product', 'generic',
117+
'system.img')
118+
if manifest_is_current and os.path.isfile(system_img):
85119
return
86120

87-
print '@@@BUILD_STEP Initialize Android checkout@@@'
88-
os.mkdir(ANDROID_DIR)
89-
CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot'])
90-
CallSubProcess(['git', 'config', '--global',
91-
'user.email', '[email protected]'])
92-
CallSubProcess(['git', 'config', '--global', 'color.ui', 'false'])
121+
print '@@@BUILD_STEP Build Android@@@'
93122
CallSubProcess(
94-
['repo', 'init',
95-
'-u', 'https://android.googlesource.com/platform/manifest',
96-
'-b', 'android-4.2.1_r1',
97-
'-g', 'all,-notdefault,-device,-darwin,-mips,-x86'],
123+
['/bin/bash',
124+
'-c', '%s && make -j4' % _ANDROID_SETUP],
98125
cwd=ANDROID_DIR)
99126

100-
print '@@@BUILD_STEP Sync Android@@@'
101-
CallSubProcess(['repo', 'sync', '-j4'], cwd=ANDROID_DIR)
102127

103-
print '@@@BUILD_STEP Build Android@@@'
128+
def StartAndroidEmulator():
129+
"""Start an android emulator from the built android tree."""
130+
print '@@@BUILD_STEP Start Android emulator@@@'
131+
132+
CallSubProcess(['/bin/bash', '-c',
133+
'%s && adb kill-server ' % _ANDROID_SETUP],
134+
cwd=ANDROID_DIR)
135+
136+
# If taskset is available, use it to force adbd to run only on one core, as,
137+
# sadly, it improves its reliability (see crbug.com/268450).
138+
adbd_wrapper = ''
139+
with open(os.devnull, 'w') as devnull_fd:
140+
if subprocess.call(['which', 'taskset'], stdout=devnull_fd) == 0:
141+
adbd_wrapper = 'taskset -c 0'
142+
CallSubProcess(['/bin/bash', '-c',
143+
'%s && %s adb start-server ' % (_ANDROID_SETUP, adbd_wrapper)],
144+
cwd=ANDROID_DIR)
145+
146+
subprocess.Popen(
147+
['/bin/bash', '-c',
148+
'%s && emulator -no-window' % _ANDROID_SETUP],
149+
cwd=ANDROID_DIR)
104150
CallSubProcess(
105-
['/bin/bash',
106-
'-c', 'source build/envsetup.sh && lunch full-eng && make -j4'],
151+
['/bin/bash', '-c',
152+
'%s && adb wait-for-device' % _ANDROID_SETUP],
107153
cwd=ANDROID_DIR)
108154

109155

110-
def GypTestFormat(title, format=None, msvs_version=None):
156+
def StopAndroidEmulator():
157+
"""Stop all android emulators."""
158+
print '@@@BUILD_STEP Stop Android emulator@@@'
159+
# If this fails, it's because there is no emulator running.
160+
subprocess.call(['pkill', 'emulator.*'])
161+
162+
163+
def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
111164
"""Run the gyp tests for a given format, emitting annotator tags.
112165
113166
See annotator docs at:
@@ -126,19 +179,18 @@ def GypTestFormat(title, format=None, msvs_version=None):
126179
if msvs_version:
127180
env['GYP_MSVS_VERSION'] = msvs_version
128181
command = ' '.join(
129-
[sys.executable, 'trunk/gyptest.py',
182+
[sys.executable, 'gyp/gyptest.py',
130183
'--all',
131184
'--passed',
132185
'--format', format,
133186
'--path', CMAKE_BIN_DIR,
134-
'--chdir', 'trunk'])
187+
'--chdir', 'gyp'] + tests)
135188
if format == 'android':
136189
# gyptest needs the environment setup from envsetup/lunch in order to build
137190
# using the 'android' backend, so this is done in a single shell.
138191
retcode = subprocess.call(
139192
['/bin/bash',
140-
'-c', 'source build/envsetup.sh && lunch full-eng && cd %s && %s'
141-
% (ROOT_DIR, command)],
193+
'-c', '%s && cd %s && %s' % (_ANDROID_SETUP, ROOT_DIR, command)],
142194
cwd=ANDROID_DIR, env=env)
143195
else:
144196
retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
@@ -160,7 +212,11 @@ def GypBuild():
160212
# The Android gyp bot runs on linux so this must be tested first.
161213
if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-android':
162214
PrepareAndroidTree()
163-
retcode += GypTestFormat('android')
215+
StartAndroidEmulator()
216+
try:
217+
retcode += GypTestFormat('android')
218+
finally:
219+
StopAndroidEmulator()
164220
elif sys.platform.startswith('linux'):
165221
retcode += GypTestFormat('ninja')
166222
retcode += GypTestFormat('make')
@@ -173,8 +229,13 @@ def GypBuild():
173229
elif sys.platform == 'win32':
174230
retcode += GypTestFormat('ninja')
175231
if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-win64':
176-
retcode += GypTestFormat('msvs-2010', format='msvs', msvs_version='2010')
177-
retcode += GypTestFormat('msvs-2012', format='msvs', msvs_version='2012')
232+
retcode += GypTestFormat('msvs-ninja-2013', format='msvs-ninja',
233+
msvs_version='2013',
234+
tests=[
235+
r'test\generator-output\gyptest-actions.py',
236+
r'test\generator-output\gyptest-relocate.py',
237+
r'test\generator-output\gyptest-rules.py'])
238+
retcode += GypTestFormat('msvs-2013', format='msvs', msvs_version='2013')
178239
else:
179240
raise Exception('Unknown platform')
180241
if retcode:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set noparent
2+
3+
4+
5+
6+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cq_config.json describes the trybots that must pass in order
2+
to land a change through the commit queue.
3+
Comments are here as the file is strictly JSON.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"trybots": {
3+
"launched": {
4+
"tryserver.nacl": {
5+
"gyp-presubmit": ["defaulttests"],
6+
"gyp-android": ["defaulttests"],
7+
"gyp-linux": ["defaulttests"],
8+
"gyp-mac": ["defaulttests"],
9+
"gyp-win32": ["defaulttests"],
10+
"gyp-win64": ["defaulttests"]
11+
}
12+
},
13+
"triggered": {
14+
}
15+
}
16+
}

tools/gyp/codereview.settings

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# This file is used by gcl to get repository specific information.
22
CODE_REVIEW_SERVER: codereview.chromium.org
33
4-
VIEW_VC: http://code.google.com/p/gyp/source/detail?r=
5-
TRY_ON_UPLOAD: True
4+
VIEW_VC: https://chromium.googlesource.com/external/gyp/+/
5+
TRY_ON_UPLOAD: False
66
TRYSERVER_PROJECT: gyp
7-
TRYSERVER_PATCHLEVEL: 0
8-
TRYSERVER_ROOT: trunk
7+
TRYSERVER_PATCHLEVEL: 1
8+
TRYSERVER_ROOT: gyp
99
TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try-nacl
10-
10+
PROJECT: gyp

tools/gyp/gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
# Copyright 2013 The Chromium Authors. All rights reserved.
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.

tools/gyp/gyptest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import subprocess
1414
import sys
1515

16-
class CommandRunner:
16+
class CommandRunner(object):
1717
"""
1818
Executor class for commands, including "commands" implemented by
1919
Python functions.
@@ -117,7 +117,7 @@ def run(self, command, display=None, stdout=None, stderr=None):
117117
return self.execute(command, stdout, stderr)
118118

119119

120-
class Unbuffered:
120+
class Unbuffered(object):
121121
def __init__(self, fp):
122122
self.fp = fp
123123
def write(self, arg):
@@ -224,7 +224,7 @@ def main(argv=None):
224224
'win32': ['msvs', 'ninja'],
225225
'linux2': ['make', 'ninja'],
226226
'linux3': ['make', 'ninja'],
227-
'darwin': ['make', 'ninja', 'xcode'],
227+
'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'],
228228
}[sys.platform]
229229

230230
for format in format_list:

tools/gyp/pylib/gyp/MSVSNew.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def set_msbuild_toolset(self, msbuild_toolset):
172172
#------------------------------------------------------------------------------
173173

174174

175-
class MSVSSolution:
175+
class MSVSSolution(object):
176176
"""Visual Studio solution."""
177177

178178
def __init__(self, path, version, entries=None, variants=None,

0 commit comments

Comments
 (0)