Skip to content

Commit cc8b2fa

Browse files
Imran Iqbalbnoordhuis
authored andcommitted
Update gyp to b3cef02.
Includes two patches for AIX. Adds support for both 32-bit and 64-bit files[0] and uses -RPf for cp instead of -af (which is unsupported)[1] [0] https://codereview.chromium.org/1319663007 [1] https://codereview.chromium.org/1368133002 PR-URL: #781 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent f5d86eb commit cc8b2fa

20 files changed

+509
-382
lines changed

gyp/PRESUBMIT.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,13 @@ def CheckChangeOnCommit(input_api, output_api):
125125

126126

127127
TRYBOTS = [
128-
'gyp-win32',
129-
'gyp-win64',
130-
'gyp-linux',
131-
'gyp-mac',
132-
'gyp-android'
128+
'linux_try',
129+
'mac_try',
130+
'win_try',
133131
]
134132

135133

136134
def GetPreferredTryMasters(_, change):
137135
return {
138-
'tryserver.nacl': { t: set(['defaulttests']) for t in TRYBOTS },
136+
'client.gyp': { t: set(['defaulttests']) for t in TRYBOTS },
139137
}

gyp/buildbot/buildbot_run.py

Lines changed: 2 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,17 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
76
"""Argument-less script to select what to run on the buildbots."""
87

9-
10-
import filecmp
118
import os
129
import shutil
1310
import subprocess
1411
import sys
1512

1613

17-
if sys.platform in ['win32', 'cygwin']:
18-
EXE_SUFFIX = '.exe'
19-
else:
20-
EXE_SUFFIX = ''
21-
22-
2314
BUILDBOT_DIR = os.path.dirname(os.path.abspath(__file__))
2415
TRUNK_DIR = os.path.dirname(BUILDBOT_DIR)
2516
ROOT_DIR = os.path.dirname(TRUNK_DIR)
26-
ANDROID_DIR = os.path.join(ROOT_DIR, 'android')
2717
CMAKE_DIR = os.path.join(ROOT_DIR, 'cmake')
2818
CMAKE_BIN_DIR = os.path.join(CMAKE_DIR, 'bin')
2919
OUT_DIR = os.path.join(TRUNK_DIR, 'out')
@@ -71,95 +61,6 @@ def PrepareCmake():
7161
CallSubProcess( ['make', 'cmake'], cwd=CMAKE_DIR)
7262

7363

74-
_ANDROID_SETUP = 'source build/envsetup.sh && lunch full-eng'
75-
76-
77-
def PrepareAndroidTree():
78-
"""Prepare an Android tree to run 'android' format tests."""
79-
if os.environ['BUILDBOT_CLOBBER'] == '1':
80-
print '@@@BUILD_STEP Clobber Android checkout@@@'
81-
shutil.rmtree(ANDROID_DIR)
82-
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):
119-
return
120-
121-
print '@@@BUILD_STEP Build Android@@@'
122-
CallSubProcess(
123-
['/bin/bash',
124-
'-c', '%s && make -j4' % _ANDROID_SETUP],
125-
cwd=ANDROID_DIR)
126-
127-
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)
150-
CallSubProcess(
151-
['/bin/bash', '-c',
152-
'%s && adb wait-for-device' % _ANDROID_SETUP],
153-
cwd=ANDROID_DIR)
154-
155-
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-
16364
def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
16465
"""Run the gyp tests for a given format, emitting annotator tags.
16566
@@ -185,15 +86,7 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
18586
'--format', format,
18687
'--path', CMAKE_BIN_DIR,
18788
'--chdir', 'gyp'] + tests)
188-
if format == 'android':
189-
# gyptest needs the environment setup from envsetup/lunch in order to build
190-
# using the 'android' backend, so this is done in a single shell.
191-
retcode = subprocess.call(
192-
['/bin/bash',
193-
'-c', '%s && cd %s && %s' % (_ANDROID_SETUP, ROOT_DIR, command)],
194-
cwd=ANDROID_DIR, env=env)
195-
else:
196-
retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
89+
retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
19790
if retcode:
19891
# Emit failure tag, and keep going.
19992
print '@@@STEP_FAILURE@@@'
@@ -209,15 +102,7 @@ def GypBuild():
209102
print 'Done.'
210103

211104
retcode = 0
212-
# The Android gyp bot runs on linux so this must be tested first.
213-
if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-android':
214-
PrepareAndroidTree()
215-
StartAndroidEmulator()
216-
try:
217-
retcode += GypTestFormat('android')
218-
finally:
219-
StopAndroidEmulator()
220-
elif sys.platform.startswith('linux'):
105+
if sys.platform.startswith('linux'):
221106
retcode += GypTestFormat('ninja')
222107
retcode += GypTestFormat('make')
223108
PrepareCmake()

gyp/buildbot/commit_queue/cq_config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"launched": {
44
"tryserver.nacl": {
55
"gyp-presubmit": ["defaulttests"],
6-
"gyp-android": ["defaulttests"],
76
"gyp-linux": ["defaulttests"],
87
"gyp-mac": ["defaulttests"],
98
"gyp-win32": ["defaulttests"],

gyp/gyp_main.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
# Use of this source code is governed by a BSD-style license that can be
55
# found in the LICENSE file.
66

7+
import os
78
import sys
89

9-
# TODO(mark): sys.path manipulation is some temporary testing stuff.
10-
try:
11-
import gyp
12-
except ImportError, e:
13-
import os.path
14-
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
15-
import gyp
10+
# Make sure we're using the version of pylib in this repo, not one installed
11+
# elsewhere on the system.
12+
sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
13+
import gyp
1614

1715
if __name__ == '__main__':
1816
sys.exit(gyp.script_main())

gyp/pylib/gyp/MSVSSettings.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -708,10 +708,7 @@ def _ValidateSettings(validators, settings, stderr):
708708
_MSBuildOnly(_compile, 'BuildingInIDE', _boolean)
709709
_MSBuildOnly(_compile, 'CompileAsManaged',
710710
_Enumeration([], new=['false',
711-
'true', # /clr
712-
'Pure', # /clr:pure
713-
'Safe', # /clr:safe
714-
'OldSyntax'])) # /clr:oldSyntax
711+
'true'])) # /clr
715712
_MSBuildOnly(_compile, 'CreateHotpatchableImage', _boolean) # /hotpatch
716713
_MSBuildOnly(_compile, 'MultiProcessorCompilation', _boolean) # /MP
717714
_MSBuildOnly(_compile, 'PreprocessOutputPath', _string) # /Fi

gyp/pylib/gyp/MSVSSettings_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def testValidateMSBuildSettings_settings(self):
296296
'BuildingInIDE': 'true',
297297
'CallingConvention': 'Cdecl',
298298
'CompileAs': 'CompileAsC',
299-
'CompileAsManaged': 'Pure',
299+
'CompileAsManaged': 'true',
300300
'CreateHotpatchableImage': 'true',
301301
'DebugInformationFormat': 'ProgramDatabase',
302302
'DisableLanguageExtensions': 'true',

gyp/pylib/gyp/MSVSVersion.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@ def SetupScript(self, target_arch):
8484
# vcvars32, which it can only find if VS??COMNTOOLS is set, which it
8585
# isn't always.
8686
if target_arch == 'x86':
87-
if self.short_name == '2013' and (
87+
if self.short_name >= '2013' and self.short_name[-1] != 'e' and (
8888
os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or
8989
os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'):
90-
# VS2013 non-Express has a x64-x86 cross that we want to prefer.
90+
# VS2013 and later, non-Express have a x64-x86 cross that we want
91+
# to prefer.
9192
return [os.path.normpath(
9293
os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86']
9394
# Otherwise, the standard x86 compiler.

gyp/pylib/gyp/__init__.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def FindBuildFiles():
4949

5050
def Load(build_files, format, default_variables={},
5151
includes=[], depth='.', params=None, check=False,
52-
circular_check=True):
52+
circular_check=True, duplicate_basename_check=True):
5353
"""
5454
Loads one or more specified build files.
5555
default_variables and includes will be copied before use.
@@ -126,6 +126,7 @@ def Load(build_files, format, default_variables={},
126126
# Process the input specific to this generator.
127127
result = gyp.input.Load(build_files, default_variables, includes[:],
128128
depth, generator_input_info, check, circular_check,
129+
duplicate_basename_check,
129130
params['parallel'], params['root_targets'])
130131
return [generator] + result
131132

@@ -324,6 +325,16 @@ def gyp_main(args):
324325
parser.add_option('--no-circular-check', dest='circular_check',
325326
action='store_false', default=True, regenerate=False,
326327
help="don't check for circular relationships between files")
328+
# --no-duplicate-basename-check disables the check for duplicate basenames
329+
# in a static_library/shared_library project. Visual C++ 2008 generator
330+
# doesn't support this configuration. Libtool on Mac also generates warnings
331+
# when duplicate basenames are passed into Make generator on Mac.
332+
# TODO(yukawa): Remove this option when these legacy generators are
333+
# deprecated.
334+
parser.add_option('--no-duplicate-basename-check',
335+
dest='duplicate_basename_check', action='store_false',
336+
default=True, regenerate=False,
337+
help="don't check for duplicate basenames")
327338
parser.add_option('--no-parallel', action='store_true', default=False,
328339
help='Disable multiprocessing')
329340
parser.add_option('-S', '--suffix', dest='suffix', default='',
@@ -499,7 +510,8 @@ def gyp_main(args):
499510
# Start with the default variables from the command line.
500511
[generator, flat_list, targets, data] = Load(
501512
build_files, format, cmdline_default_variables, includes, options.depth,
502-
params, options.check, options.circular_check)
513+
params, options.check, options.circular_check,
514+
options.duplicate_basename_check)
503515

504516
# TODO(mark): Pass |data| for now because the generator needs a list of
505517
# build files that came in. In the future, maybe it should just accept

gyp/pylib/gyp/common.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,20 @@ def QualifiedTarget(build_file, target, toolset):
131131

132132

133133
@memoize
134-
def RelativePath(path, relative_to):
134+
def RelativePath(path, relative_to, follow_path_symlink=True):
135135
# Assuming both |path| and |relative_to| are relative to the current
136136
# directory, returns a relative path that identifies path relative to
137137
# relative_to.
138+
# If |follow_symlink_path| is true (default) and |path| is a symlink, then
139+
# this method returns a path to the real file represented by |path|. If it is
140+
# false, this method returns a path to the symlink. If |path| is not a
141+
# symlink, this option has no effect.
138142

139143
# Convert to normalized (and therefore absolute paths).
140-
path = os.path.realpath(path)
144+
if follow_path_symlink:
145+
path = os.path.realpath(path)
146+
else:
147+
path = os.path.abspath(path)
141148
relative_to = os.path.realpath(relative_to)
142149

143150
# On Windows, we can't create a relative path to a different drive, so just

0 commit comments

Comments
 (0)