Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3137e46

Browse filesBrowse files
Imran Iqbalrvagg
authored andcommitted
tools: 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: #3487 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
1 parent d2b5dcb commit 3137e46
Copy full SHA for 3137e46

File tree

Expand file treeCollapse file tree

13 files changed

+103
-44
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

13 files changed

+103
-44
lines changed
Open diff view settings
Collapse file

‎tools/gyp/PRESUBMIT.py‎

Copy file name to clipboardExpand all lines: tools/gyp/PRESUBMIT.py
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,13 @@ def CheckChangeOnCommit(input_api, output_api):
125125

126126

127127
TRYBOTS = [
128-
'gyp-win32',
129-
'gyp-win64',
130-
'gyp-linux',
131-
'gyp-mac',
128+
'linux_try',
129+
'mac_try',
130+
'win_try',
132131
]
133132

134133

135134
def GetPreferredTryMasters(_, change):
136135
return {
137-
'tryserver.nacl': { t: set(['defaulttests']) for t in TRYBOTS },
136+
'client.gyp': { t: set(['defaulttests']) for t in TRYBOTS },
138137
}
Collapse file

‎tools/gyp/gyp_main.py‎

Copy file name to clipboardExpand all lines: tools/gyp/gyp_main.py
+5-7Lines 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())
Collapse file

‎tools/gyp/pylib/gyp/MSVSSettings.py‎

Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/MSVSSettings.py
+1-4Lines 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
Collapse file

‎tools/gyp/pylib/gyp/MSVSSettings_test.py‎

Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/MSVSSettings_test.py
+1-1Lines 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',
Collapse file

‎tools/gyp/pylib/gyp/common.py‎

Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/common.py
+9-2Lines 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
Collapse file

‎tools/gyp/pylib/gyp/generator/analyzer.py‎

Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/generator/analyzer.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files,
338338
sources = _ExtractSources(target_name, target_dicts[target_name],
339339
toplevel_dir)
340340
for source in sources:
341-
if source in files:
341+
if _ToGypPath(os.path.normpath(source)) in files:
342342
print 'target', target_name, 'matches', source
343343
target.match_status = MATCH_STATUS_MATCHES
344344
matching_targets.append(target)
@@ -498,7 +498,7 @@ def _WasGypIncludeFileModified(params, files):
498498
files."""
499499
if params['options'].includes:
500500
for include in params['options'].includes:
501-
if _ToGypPath(include) in files:
501+
if _ToGypPath(os.path.normpath(include)) in files:
502502
print 'Include file modified, assuming all changed', include
503503
return True
504504
return False
Collapse file

‎tools/gyp/pylib/gyp/generator/make.py‎

Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/generator/make.py
+11-7Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,10 @@ def CalculateGeneratorInputInfo(params):
211211

212212
LINK_COMMANDS_AIX = """\
213213
quiet_cmd_alink = AR($(TOOLSET)) $@
214-
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
214+
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)
215215
216216
quiet_cmd_alink_thin = AR($(TOOLSET)) $@
217-
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
217+
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)
218218
219219
quiet_cmd_link = LINK($(TOOLSET)) $@
220220
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
@@ -273,9 +273,9 @@ def CalculateGeneratorInputInfo(params):
273273
%(make_global_settings)s
274274
275275
CC.target ?= %(CC.target)s
276-
CFLAGS.target ?= $(CFLAGS)
276+
CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS)
277277
CXX.target ?= %(CXX.target)s
278-
CXXFLAGS.target ?= $(CXXFLAGS)
278+
CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
279279
LINK.target ?= %(LINK.target)s
280280
LDFLAGS.target ?= $(LDFLAGS)
281281
AR.target ?= $(AR)
@@ -286,9 +286,9 @@ def CalculateGeneratorInputInfo(params):
286286
# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
287287
# to replicate this environment fallback in make as well.
288288
CC.host ?= %(CC.host)s
289-
CFLAGS.host ?=
289+
CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
290290
CXX.host ?= %(CXX.host)s
291-
CXXFLAGS.host ?=
291+
CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
292292
LINK.host ?= %(LINK.host)s
293293
LDFLAGS.host ?=
294294
AR.host ?= %(AR.host)s
@@ -365,7 +365,7 @@ def CalculateGeneratorInputInfo(params):
365365
366366
quiet_cmd_copy = COPY $@
367367
# send stderr to /dev/null to ignore messages when linking directories.
368-
cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@")
368+
cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@")
369369
370370
%(link_commands)s
371371
"""
@@ -2010,6 +2010,7 @@ def CalculateMakefilePath(build_file, base_name):
20102010
srcdir_prefix = '$(srcdir)/'
20112011

20122012
flock_command= 'flock'
2013+
copy_archive_arguments = '-af'
20132014
header_params = {
20142015
'default_target': default_target,
20152016
'builddir': builddir_name,
@@ -2019,6 +2020,7 @@ def CalculateMakefilePath(build_file, base_name):
20192020
'link_commands': LINK_COMMANDS_LINUX,
20202021
'extra_commands': '',
20212022
'srcdir': srcdir,
2023+
'copy_archive_args': copy_archive_arguments,
20222024
}
20232025
if flavor == 'mac':
20242026
flock_command = './gyp-mac-tool flock'
@@ -2043,7 +2045,9 @@ def CalculateMakefilePath(build_file, base_name):
20432045
'flock': 'lockf',
20442046
})
20452047
elif flavor == 'aix':
2048+
copy_archive_arguments = '-pPRf'
20462049
header_params.update({
2050+
'copy_archive_args': copy_archive_arguments,
20472051
'link_commands': LINK_COMMANDS_AIX,
20482052
'flock': './gyp-flock-tool flock',
20492053
'flock_index': 2,
Collapse file

‎tools/gyp/pylib/gyp/generator/msvs.py‎

Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/generator/msvs.py
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ def _import_OrderedDict():
8787
'msvs_requires_importlibrary',
8888
'msvs_enable_winphone',
8989
'msvs_application_type_revision',
90+
'msvs_target_platform_version',
91+
'msvs_target_platform_minversion',
9092
]
9193

9294

@@ -2644,6 +2646,17 @@ def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name):
26442646
else:
26452647
properties[0].append(['ApplicationTypeRevision', '8.1'])
26462648

2649+
if spec.get('msvs_target_platform_version'):
2650+
target_platform_version = spec.get('msvs_target_platform_version')
2651+
properties[0].append(['WindowsTargetPlatformVersion',
2652+
target_platform_version])
2653+
if spec.get('msvs_target_platform_minversion'):
2654+
target_platform_minversion = spec.get('msvs_target_platform_minversion')
2655+
properties[0].append(['WindowsTargetPlatformMinVersion',
2656+
target_platform_minversion])
2657+
else:
2658+
properties[0].append(['WindowsTargetPlatformMinVersion',
2659+
target_platform_version])
26472660
if spec.get('msvs_enable_winphone'):
26482661
properties[0].append(['ApplicationType', 'Windows Phone'])
26492662
else:
Collapse file

‎tools/gyp/pylib/gyp/generator/ninja.py‎

Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/generator/ninja.py
+15-4Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,11 @@ def WriteSourcesForArch(self, ninja_file, config_name, config, sources,
921921
os.environ.get('CFLAGS', '').split() + cflags_c)
922922
cflags_cc = (os.environ.get('CPPFLAGS', '').split() +
923923
os.environ.get('CXXFLAGS', '').split() + cflags_cc)
924+
elif self.toolset == 'host':
925+
cflags_c = (os.environ.get('CPPFLAGS_host', '').split() +
926+
os.environ.get('CFLAGS_host', '').split() + cflags_c)
927+
cflags_cc = (os.environ.get('CPPFLAGS_host', '').split() +
928+
os.environ.get('CXXFLAGS_host', '').split() + cflags_cc)
924929

925930
defines = config.get('defines', []) + extra_defines
926931
self.WriteVariableList(ninja_file, 'defines',
@@ -1672,7 +1677,7 @@ def CommandWithWrapper(cmd, wrappers, prog):
16721677

16731678
def GetDefaultConcurrentLinks():
16741679
"""Returns a best-guess for a number of concurrent links."""
1675-
pool_size = int(os.getenv('GYP_LINK_CONCURRENCY', 0))
1680+
pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0))
16761681
if pool_size:
16771682
return pool_size
16781683

@@ -1696,8 +1701,10 @@ class MEMORYSTATUSEX(ctypes.Structure):
16961701
stat.dwLength = ctypes.sizeof(stat)
16971702
ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))
16981703

1699-
mem_limit = max(1, stat.ullTotalPhys / (4 * (2 ** 30))) # total / 4GB
1700-
hard_cap = max(1, int(os.getenv('GYP_LINK_CONCURRENCY_MAX', 2**32)))
1704+
# VS 2015 uses 20% more working set than VS 2013 and can consume all RAM
1705+
# on a 64 GB machine.
1706+
mem_limit = max(1, stat.ullTotalPhys / (5 * (2 ** 30))) # total / 5GB
1707+
hard_cap = max(1, int(os.environ.get('GYP_LINK_CONCURRENCY_MAX', 2**32)))
17011708
return min(mem_limit, hard_cap)
17021709
elif sys.platform.startswith('linux'):
17031710
if os.path.exists("/proc/meminfo"):
@@ -2275,7 +2282,11 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
22752282
if flavor == 'mac':
22762283
gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec)
22772284

2278-
build_file = gyp.common.RelativePath(build_file, options.toplevel_dir)
2285+
# If build_file is a symlink, we must not follow it because there's a chance
2286+
# it could point to a path above toplevel_dir, and we cannot correctly deal
2287+
# with that case at the moment.
2288+
build_file = gyp.common.RelativePath(build_file, options.toplevel_dir,
2289+
False)
22792290

22802291
qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name,
22812292
toolset)
Collapse file

‎tools/gyp/pylib/gyp/input.py‎

Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/input.py
+12-8Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def IsPathSection(section):
5757
# If section ends in one of the '=+?!' characters, it's applied to a section
5858
# without the trailing characters. '/' is notably absent from this list,
5959
# because there's no way for a regular expression to be treated as a path.
60-
while section[-1:] in '=+?!':
60+
while section and section[-1:] in '=+?!':
6161
section = section[:-1]
6262

6363
if section in path_sections:
@@ -893,20 +893,24 @@ def ExpandVariables(input, phase, variables, build_file):
893893
else:
894894
# Fix up command with platform specific workarounds.
895895
contents = FixupPlatformCommand(contents)
896-
p = subprocess.Popen(contents, shell=use_shell,
897-
stdout=subprocess.PIPE,
898-
stderr=subprocess.PIPE,
899-
stdin=subprocess.PIPE,
900-
cwd=build_file_dir)
896+
try:
897+
p = subprocess.Popen(contents, shell=use_shell,
898+
stdout=subprocess.PIPE,
899+
stderr=subprocess.PIPE,
900+
stdin=subprocess.PIPE,
901+
cwd=build_file_dir)
902+
except Exception, e:
903+
raise GypError("%s while executing command '%s' in %s" %
904+
(e, contents, build_file))
901905

902906
p_stdout, p_stderr = p.communicate('')
903907

904908
if p.wait() != 0 or p_stderr:
905909
sys.stderr.write(p_stderr)
906910
# Simulate check_call behavior, since check_call only exists
907911
# in python 2.5 and later.
908-
raise GypError("Call to '%s' returned exit status %d." %
909-
(contents, p.returncode))
912+
raise GypError("Call to '%s' returned exit status %d while in %s." %
913+
(contents, p.returncode, build_file))
910914
replacement = p_stdout.rstrip()
911915

912916
cached_command_results[cache_key] = replacement

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.