GeezerVison is showing github.com — tools: update gyp to b3cef02 · nodejs/node@3137e46
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: tools/gyp/PRESUBMIT.py +4-5Lines changed: 4 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -125,14 +125,13 @@ def CheckChangeOnCommit(input_api, output_api): | 125 | 125 |
| 126 | 126 |
| 127 | 127 | TRYBOTS = [ | 128 | | - 'gyp-win32', | 129 | | - 'gyp-win64', | 130 | | - 'gyp-linux', | 131 | | - 'gyp-mac', | | 128 | + 'linux_try', | | 129 | + 'mac_try', | | 130 | + 'win_try', | 132 | 131 | ] | 133 | 132 |
| 134 | 133 |
| 135 | 134 | def GetPreferredTryMasters(_, change): | 136 | 135 | return { | 137 | | - 'tryserver.nacl': { t: set(['defaulttests']) for t in TRYBOTS }, | | 136 | + 'client.gyp': { t: set(['defaulttests']) for t in TRYBOTS }, | 138 | 137 | } |
Collapse file Copy file name to clipboardExpand all lines: tools/gyp/gyp_main.py +5-7Lines changed: 5 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | # Use of this source code is governed by a BSD-style license that can be | 5 | 5 | # found in the LICENSE file. | 6 | 6 |
| | 7 | +import os | 7 | 8 | import sys | 8 | 9 |
| 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 | 16 | 14 |
| 17 | 15 | if __name__ == '__main__': | 18 | 16 | sys.exit(gyp.script_main()) |
Collapse file Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/MSVSSettings.py +1-4Lines changed: 1 addition & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -708,10 +708,7 @@ def _ValidateSettings(validators, settings, stderr): | 708 | 708 | _MSBuildOnly(_compile, 'BuildingInIDE', _boolean) | 709 | 709 | _MSBuildOnly(_compile, 'CompileAsManaged', | 710 | 710 | _Enumeration([], new=['false', | 711 | | - 'true', # /clr | 712 | | - 'Pure', # /clr:pure | 713 | | - 'Safe', # /clr:safe | 714 | | - 'OldSyntax'])) # /clr:oldSyntax | | 711 | + 'true'])) # /clr | 715 | 712 | _MSBuildOnly(_compile, 'CreateHotpatchableImage', _boolean) # /hotpatch | 716 | 713 | _MSBuildOnly(_compile, 'MultiProcessorCompilation', _boolean) # /MP | 717 | 714 | _MSBuildOnly(_compile, 'PreprocessOutputPath', _string) # /Fi | |
Collapse file Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/MSVSSettings_test.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -296,7 +296,7 @@ def testValidateMSBuildSettings_settings(self): | 296 | 296 | 'BuildingInIDE': 'true', | 297 | 297 | 'CallingConvention': 'Cdecl', | 298 | 298 | 'CompileAs': 'CompileAsC', | 299 | | - 'CompileAsManaged': 'Pure', | | 299 | + 'CompileAsManaged': 'true', | 300 | 300 | 'CreateHotpatchableImage': 'true', | 301 | 301 | 'DebugInformationFormat': 'ProgramDatabase', | 302 | 302 | 'DisableLanguageExtensions': 'true', | |
Collapse file Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/common.py +9-2Lines changed: 9 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -131,13 +131,20 @@ def QualifiedTarget(build_file, target, toolset): | 131 | 131 |
| 132 | 132 |
| 133 | 133 | @memoize | 134 | | -def RelativePath(path, relative_to): | | 134 | +def RelativePath(path, relative_to, follow_path_symlink=True): | 135 | 135 | # Assuming both |path| and |relative_to| are relative to the current | 136 | 136 | # directory, returns a relative path that identifies path relative to | 137 | 137 | # 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. | 138 | 142 |
| 139 | 143 | # 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) | 141 | 148 | relative_to = os.path.realpath(relative_to) | 142 | 149 |
| 143 | 150 | # On Windows, we can't create a relative path to a different drive, so just | |
Collapse file Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/generator/analyzer.py +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -338,7 +338,7 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, | 338 | 338 | sources = _ExtractSources(target_name, target_dicts[target_name], | 339 | 339 | toplevel_dir) | 340 | 340 | for source in sources: | 341 | | - if source in files: | | 341 | + if _ToGypPath(os.path.normpath(source)) in files: | 342 | 342 | print 'target', target_name, 'matches', source | 343 | 343 | target.match_status = MATCH_STATUS_MATCHES | 344 | 344 | matching_targets.append(target) | @@ -498,7 +498,7 @@ def _WasGypIncludeFileModified(params, files): | 498 | 498 | files.""" | 499 | 499 | if params['options'].includes: | 500 | 500 | for include in params['options'].includes: | 501 | | - if _ToGypPath(include) in files: | | 501 | + if _ToGypPath(os.path.normpath(include)) in files: | 502 | 502 | print 'Include file modified, assuming all changed', include | 503 | 503 | return True | 504 | 504 | return False | |
Collapse file Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/generator/make.py +11-7Lines changed: 11 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -211,10 +211,10 @@ def CalculateGeneratorInputInfo(params): | 211 | 211 |
| 212 | 212 | LINK_COMMANDS_AIX = """\ | 213 | 213 | 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,$^) | 215 | 215 |
| 216 | 216 | 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,$^) | 218 | 218 |
| 219 | 219 | quiet_cmd_link = LINK($(TOOLSET)) $@ | 220 | 220 | cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) | @@ -273,9 +273,9 @@ def CalculateGeneratorInputInfo(params): | 273 | 273 | %(make_global_settings)s | 274 | 274 |
| 275 | 275 | CC.target ?= %(CC.target)s | 276 | | -CFLAGS.target ?= $(CFLAGS) | | 276 | +CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS) | 277 | 277 | CXX.target ?= %(CXX.target)s | 278 | | -CXXFLAGS.target ?= $(CXXFLAGS) | | 278 | +CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS) | 279 | 279 | LINK.target ?= %(LINK.target)s | 280 | 280 | LDFLAGS.target ?= $(LDFLAGS) | 281 | 281 | AR.target ?= $(AR) | @@ -286,9 +286,9 @@ def CalculateGeneratorInputInfo(params): | 286 | 286 | # TODO(evan): move all cross-compilation logic to gyp-time so we don't need | 287 | 287 | # to replicate this environment fallback in make as well. | 288 | 288 | CC.host ?= %(CC.host)s | 289 | | -CFLAGS.host ?= | | 289 | +CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host) | 290 | 290 | CXX.host ?= %(CXX.host)s | 291 | | -CXXFLAGS.host ?= | | 291 | +CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host) | 292 | 292 | LINK.host ?= %(LINK.host)s | 293 | 293 | LDFLAGS.host ?= | 294 | 294 | AR.host ?= %(AR.host)s | @@ -365,7 +365,7 @@ def CalculateGeneratorInputInfo(params): | 365 | 365 |
| 366 | 366 | quiet_cmd_copy = COPY $@ | 367 | 367 | # 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 "$<" "$@") | 369 | 369 |
| 370 | 370 | %(link_commands)s | 371 | 371 | """ | @@ -2010,6 +2010,7 @@ def CalculateMakefilePath(build_file, base_name): | 2010 | 2010 | srcdir_prefix = '$(srcdir)/' | 2011 | 2011 |
| 2012 | 2012 | flock_command= 'flock' | | 2013 | + copy_archive_arguments = '-af' | 2013 | 2014 | header_params = { | 2014 | 2015 | 'default_target': default_target, | 2015 | 2016 | 'builddir': builddir_name, | @@ -2019,6 +2020,7 @@ def CalculateMakefilePath(build_file, base_name): | 2019 | 2020 | 'link_commands': LINK_COMMANDS_LINUX, | 2020 | 2021 | 'extra_commands': '', | 2021 | 2022 | 'srcdir': srcdir, | | 2023 | + 'copy_archive_args': copy_archive_arguments, | 2022 | 2024 | } | 2023 | 2025 | if flavor == 'mac': | 2024 | 2026 | flock_command = './gyp-mac-tool flock' | @@ -2043,7 +2045,9 @@ def CalculateMakefilePath(build_file, base_name): | 2043 | 2045 | 'flock': 'lockf', | 2044 | 2046 | }) | 2045 | 2047 | elif flavor == 'aix': | | 2048 | + copy_archive_arguments = '-pPRf' | 2046 | 2049 | header_params.update({ | | 2050 | + 'copy_archive_args': copy_archive_arguments, | 2047 | 2051 | 'link_commands': LINK_COMMANDS_AIX, | 2048 | 2052 | 'flock': './gyp-flock-tool flock', | 2049 | 2053 | 'flock_index': 2, | |
Collapse file Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/generator/msvs.py +13Lines changed: 13 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -87,6 +87,8 @@ def _import_OrderedDict(): | 87 | 87 | 'msvs_requires_importlibrary', | 88 | 88 | 'msvs_enable_winphone', | 89 | 89 | 'msvs_application_type_revision', | | 90 | + 'msvs_target_platform_version', | | 91 | + 'msvs_target_platform_minversion', | 90 | 92 | ] | 91 | 93 |
| 92 | 94 |
| @@ -2644,6 +2646,17 @@ def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name): | 2644 | 2646 | else: | 2645 | 2647 | properties[0].append(['ApplicationTypeRevision', '8.1']) | 2646 | 2648 |
| | 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]) | 2647 | 2660 | if spec.get('msvs_enable_winphone'): | 2648 | 2661 | properties[0].append(['ApplicationType', 'Windows Phone']) | 2649 | 2662 | else: | |
Collapse file Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/generator/ninja.py +15-4Lines changed: 15 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -921,6 +921,11 @@ def WriteSourcesForArch(self, ninja_file, config_name, config, sources, | 921 | 921 | os.environ.get('CFLAGS', '').split() + cflags_c) | 922 | 922 | cflags_cc = (os.environ.get('CPPFLAGS', '').split() + | 923 | 923 | 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) | 924 | 929 |
| 925 | 930 | defines = config.get('defines', []) + extra_defines | 926 | 931 | self.WriteVariableList(ninja_file, 'defines', | @@ -1672,7 +1677,7 @@ def CommandWithWrapper(cmd, wrappers, prog): | 1672 | 1677 |
| 1673 | 1678 | def GetDefaultConcurrentLinks(): | 1674 | 1679 | """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)) | 1676 | 1681 | if pool_size: | 1677 | 1682 | return pool_size | 1678 | 1683 |
| @@ -1696,8 +1701,10 @@ class MEMORYSTATUSEX(ctypes.Structure): | 1696 | 1701 | stat.dwLength = ctypes.sizeof(stat) | 1697 | 1702 | ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) | 1698 | 1703 |
| 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))) | 1701 | 1708 | return min(mem_limit, hard_cap) | 1702 | 1709 | elif sys.platform.startswith('linux'): | 1703 | 1710 | if os.path.exists("/proc/meminfo"): | @@ -2275,7 +2282,11 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, | 2275 | 2282 | if flavor == 'mac': | 2276 | 2283 | gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) | 2277 | 2284 |
| 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) | 2279 | 2290 |
| 2280 | 2291 | qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name, | 2281 | 2292 | toolset) | |
Collapse file Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/input.py +12-8Lines changed: 12 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -57,7 +57,7 @@ def IsPathSection(section): | 57 | 57 | # If section ends in one of the '=+?!' characters, it's applied to a section | 58 | 58 | # without the trailing characters. '/' is notably absent from this list, | 59 | 59 | # 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 '=+?!': | 61 | 61 | section = section[:-1] | 62 | 62 |
| 63 | 63 | if section in path_sections: | @@ -893,20 +893,24 @@ def ExpandVariables(input, phase, variables, build_file): | 893 | 893 | else: | 894 | 894 | # Fix up command with platform specific workarounds. | 895 | 895 | 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)) | 901 | 905 |
| 902 | 906 | p_stdout, p_stderr = p.communicate('') | 903 | 907 |
| 904 | 908 | if p.wait() != 0 or p_stderr: | 905 | 909 | sys.stderr.write(p_stderr) | 906 | 910 | # Simulate check_call behavior, since check_call only exists | 907 | 911 | # 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)) | 910 | 914 | replacement = p_stdout.rstrip() | 911 | 915 |
| 912 | 916 | cached_command_results[cache_key] = replacement | |
|