libv8 5.0.71.48.3 → 5.1.281.59.0beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/ext/libv8/location.rb +12 -9
  4. data/ext/libv8/patcher.rb +1 -1
  5. data/ext/libv8/paths.rb +1 -1
  6. data/lib/libv8/version.rb +1 -1
  7. data/patches/0001-Build-standalone-static-library.patch +26 -0
  8. data/patches/{disable-building-tests.patch → 0002-Disable-building-tests.patch} +17 -5
  9. data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +25 -0
  10. data/spec/location_spec.rb +1 -1
  11. data/vendor/depot_tools/.gitignore +1 -0
  12. data/vendor/depot_tools/PRESUBMIT.py +3 -1
  13. data/vendor/depot_tools/README +1 -6
  14. data/vendor/depot_tools/apply_issue.py +6 -0
  15. data/vendor/depot_tools/bootstrap/win/README.md +2 -2
  16. data/vendor/depot_tools/bootstrap/win/git.template.bat +1 -1
  17. data/vendor/depot_tools/bootstrap/win/win_tools.bat +12 -11
  18. data/vendor/depot_tools/codereview.settings +1 -1
  19. data/vendor/depot_tools/cpplint.py +353 -592
  20. data/vendor/depot_tools/fetch.py +10 -3
  21. data/vendor/depot_tools/fetch_configs/infra.py +4 -2
  22. data/vendor/depot_tools/fetch_configs/ios_internal.py +49 -0
  23. data/vendor/depot_tools/gclient.py +33 -7
  24. data/vendor/depot_tools/gclient_scm.py +14 -11
  25. data/vendor/depot_tools/gclient_utils.py +14 -3
  26. data/vendor/depot_tools/git-gs +3 -3
  27. data/vendor/depot_tools/git_cache.py +8 -4
  28. data/vendor/depot_tools/git_cl.py +221 -98
  29. data/vendor/depot_tools/git_footers.py +76 -39
  30. data/vendor/depot_tools/git_map_branches.py +12 -10
  31. data/vendor/depot_tools/infra/config/cq.cfg +0 -11
  32. data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
  33. data/vendor/depot_tools/presubmit_canned_checks.py +31 -19
  34. data/vendor/depot_tools/presubmit_support.py +0 -13
  35. data/vendor/depot_tools/recipe_modules/bot_update/resources/bot_update.py +19 -2
  36. data/vendor/depot_tools/recipe_modules/depot_tools/api.py +4 -0
  37. data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/basic.json +49 -0
  38. data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/win.json +49 -0
  39. data/vendor/depot_tools/recipe_modules/depot_tools/example.py +38 -0
  40. data/vendor/depot_tools/recipe_modules/gclient/api.py +1 -0
  41. data/vendor/depot_tools/recipe_modules/gclient/config.py +19 -0
  42. data/vendor/depot_tools/recipe_modules/gclient/example.expected/basic.json +1 -0
  43. data/vendor/depot_tools/recipe_modules/gclient/example.expected/revision.json +1 -0
  44. data/vendor/depot_tools/recipe_modules/gclient/example.expected/tryserver.json +1 -0
  45. data/vendor/depot_tools/recipe_modules/gclient/example.py +3 -0
  46. data/vendor/depot_tools/recipe_modules/git_cl/api.py +22 -6
  47. data/vendor/depot_tools/recipe_modules/git_cl/example.expected/basic.json +27 -9
  48. data/vendor/depot_tools/recipe_modules/git_cl/example.py +9 -7
  49. data/vendor/depot_tools/recipe_modules/presubmit/api.py +5 -2
  50. data/vendor/depot_tools/recipe_modules/tryserver/__init__.py +1 -0
  51. data/vendor/depot_tools/recipe_modules/tryserver/api.py +31 -0
  52. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/basic_tags.json +59 -0
  53. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch.json +26 -0
  54. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch_new.json +26 -0
  55. data/vendor/depot_tools/recipe_modules/tryserver/example.py +32 -3
  56. data/vendor/depot_tools/roll_dep.py +6 -2
  57. data/vendor/depot_tools/third_party/upload.py +17 -9
  58. data/vendor/depot_tools/update_depot_tools +11 -0
  59. data/vendor/depot_tools/update_depot_tools.bat +11 -0
  60. data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +52 -9
  61. data/vendor/depot_tools/win_toolchain/package_from_installed.py +64 -57
  62. metadata +12 -10
  63. data/patches/build-standalone-static-library.patch +0 -14
  64. data/patches/fPIC-for-static.patch +0 -13
  65. data/vendor/depot_tools/git-lkgr +0 -208
  66. data/vendor/depot_tools/hammer +0 -28
  67. data/vendor/depot_tools/hammer.bat +0 -23
@@ -19,6 +19,32 @@
19
19
  "@@@STEP_LINK@Applied issue 12853011@https://codereview.chromium.org/12853011@@@"
20
20
  ]
21
21
  },
22
+ {
23
+ "cmd": [
24
+ "RECIPE_PACKAGE_REPO[depot_tools]/git_cl.py",
25
+ "description",
26
+ "-d",
27
+ "--rietveld",
28
+ "https://codereview.chromium.org/12853011"
29
+ ],
30
+ "name": "git_cl description",
31
+ "stdout": "/path/to/tmp/"
32
+ },
33
+ {
34
+ "cmd": [
35
+ "python",
36
+ "-u",
37
+ "RECIPE_PACKAGE_REPO[depot_tools]/git_footers.py",
38
+ "--json",
39
+ "/path/to/tmp/json"
40
+ ],
41
+ "name": "parse description",
42
+ "stdin": "foobar",
43
+ "~followup_annotations": [
44
+ "@@@STEP_LOG_LINE@json.output (invalid)@null@@@",
45
+ "@@@STEP_LOG_END@json.output (invalid)@@@"
46
+ ]
47
+ },
22
48
  {
23
49
  "cmd": [
24
50
  "git",
@@ -19,6 +19,32 @@
19
19
  "@@@STEP_LINK@Applied issue 12853011@https://codereview.chromium.org/12853011@@@"
20
20
  ]
21
21
  },
22
+ {
23
+ "cmd": [
24
+ "RECIPE_PACKAGE_REPO[depot_tools]/git_cl.py",
25
+ "description",
26
+ "-d",
27
+ "--rietveld",
28
+ "https://codereview.chromium.org/12853011"
29
+ ],
30
+ "name": "git_cl description",
31
+ "stdout": "/path/to/tmp/"
32
+ },
33
+ {
34
+ "cmd": [
35
+ "python",
36
+ "-u",
37
+ "RECIPE_PACKAGE_REPO[depot_tools]/git_footers.py",
38
+ "--json",
39
+ "/path/to/tmp/json"
40
+ ],
41
+ "name": "parse description",
42
+ "stdin": "foobar",
43
+ "~followup_annotations": [
44
+ "@@@STEP_LOG_LINE@json.output (invalid)@null@@@",
45
+ "@@@STEP_LOG_END@json.output (invalid)@@@"
46
+ ]
47
+ },
22
48
  {
23
49
  "cmd": [
24
50
  "git",
@@ -3,17 +3,30 @@
3
3
  # found in the LICENSE file.
4
4
 
5
5
  DEPS = [
6
+ 'recipe_engine/json',
7
+ 'recipe_engine/raw_io',
6
8
  'recipe_engine/path',
7
9
  'recipe_engine/platform',
8
10
  'recipe_engine/properties',
9
11
  'recipe_engine/python',
12
+ 'recipe_engine/step',
10
13
  'tryserver',
11
14
  ]
12
15
 
13
16
 
14
17
  def RunSteps(api):
15
18
  api.path['checkout'] = api.path['slave_build']
19
+ if api.properties.get('patch_text'):
20
+ api.step('patch_text test', [
21
+ 'echo', str(api.tryserver.get_footers(api.properties['patch_text']))])
22
+ api.step('patch_text test', [
23
+ 'echo', str(api.tryserver.get_footer(
24
+ 'Foo', api.properties['patch_text']))])
25
+ return
26
+
16
27
  api.tryserver.maybe_apply_issue()
28
+ if api.tryserver.can_apply_issue:
29
+ api.tryserver.get_footers()
17
30
  api.tryserver.get_files_affected_by_patch(
18
31
  api.properties.get('test_patch_root'))
19
32
 
@@ -30,6 +43,8 @@ def RunSteps(api):
30
43
 
31
44
 
32
45
  def GenTests(api):
46
+ description_step = api.override_step_data(
47
+ 'git_cl description', stdout=api.raw_io.output('foobar'))
33
48
  yield (api.test('with_svn_patch') +
34
49
  api.properties(patch_url='svn://checkout.url'))
35
50
 
@@ -41,13 +56,27 @@ def GenTests(api):
41
56
  patch_ref='johndoe#123.diff'))
42
57
 
43
58
  yield (api.test('with_rietveld_patch') +
44
- api.properties.tryserver())
59
+ api.properties.tryserver() +
60
+ description_step)
45
61
 
46
62
  yield (api.test('with_wrong_patch') + api.platform('win', 32))
47
63
 
48
-
49
64
  yield (api.test('with_rietveld_patch_new') +
50
- api.properties.tryserver(test_patch_root='sub/project'))
65
+ api.properties.tryserver(test_patch_root='sub/project') +
66
+ description_step)
51
67
 
52
68
  yield (api.test('with_wrong_patch_new') + api.platform('win', 32) +
53
69
  api.properties(test_patch_root='sub\\project'))
70
+
71
+ yield (api.test('basic_tags') +
72
+ api.properties(
73
+ patch_text='hihihi\nfoo:bar\nbam:baz',
74
+ footer='foo'
75
+ ) +
76
+ api.step_data(
77
+ 'parse description',
78
+ api.json.output({'Foo': ['bar']})) +
79
+ api.step_data(
80
+ 'parse description (2)',
81
+ api.json.output({'Foo': ['bar']}))
82
+ )
@@ -22,6 +22,10 @@ class Error(Exception):
22
22
  pass
23
23
 
24
24
 
25
+ class AlreadyRolledError(Error):
26
+ pass
27
+
28
+
25
29
  def check_output(*args, **kwargs):
26
30
  """subprocess.check_output() passing shell=True on Windows for git."""
27
31
  kwargs.setdefault('shell', NEED_SHELL)
@@ -109,7 +113,7 @@ def roll(root, deps_dir, roll_to, key, reviewers, bug, no_log, log_limit,
109
113
  print('Found new revision %s' % roll_to)
110
114
 
111
115
  if roll_to == head:
112
- raise Error('No revision to roll!')
116
+ raise AlreadyRolledError('No revision to roll!')
113
117
 
114
118
  commit_range = '%s..%s' % (head[:9], roll_to[:9])
115
119
 
@@ -213,7 +217,7 @@ def main():
213
217
 
214
218
  except Error as e:
215
219
  sys.stderr.write('error: %s\n' % e)
216
- return 1
220
+ return 2 if isinstance(e, AlreadyRolledError) else 1
217
221
 
218
222
  return 0
219
223
 
@@ -944,7 +944,6 @@ class VersionControlSystem(object):
944
944
  raise NotImplementedError(
945
945
  "abstract method -- subclass %s must override" % self.__class__)
946
946
 
947
-
948
947
  def GetBaseFiles(self, diff):
949
948
  """Helper that calls GetBase file for each file in the patch.
950
949
 
@@ -963,7 +962,6 @@ class VersionControlSystem(object):
963
962
  files[filename] = self.GetBaseFile(filename)
964
963
  return files
965
964
 
966
-
967
965
  def UploadBaseFiles(self, issue, rpc_server, patch_list, patchset, options,
968
966
  files):
969
967
  """Uploads the base files (and if necessary, the current ones as well)."""
@@ -1033,7 +1031,6 @@ class VersionControlSystem(object):
1033
1031
  for t in threads:
1034
1032
  print t.get(timeout=60)
1035
1033
 
1036
-
1037
1034
  def IsImage(self, filename):
1038
1035
  """Returns true if the filename has an image extension."""
1039
1036
  mimetype = mimetypes.guess_type(filename)[0]
@@ -1048,6 +1045,10 @@ class VersionControlSystem(object):
1048
1045
  # http://selenic.com/hg/file/848a6658069e/mercurial/util.py#l229
1049
1046
  return bool(data and "\0" in data)
1050
1047
 
1048
+ def GetMostRecentCommitSummary(self):
1049
+ """Returns a one line summary of the current commit."""
1050
+ return ""
1051
+
1051
1052
 
1052
1053
  class SubversionVCS(VersionControlSystem):
1053
1054
  """Implementation of the VersionControlSystem interface for Subversion."""
@@ -1511,6 +1512,9 @@ class GitVCS(VersionControlSystem):
1511
1512
  new_content = None
1512
1513
  return (base_content, new_content, is_binary, status)
1513
1514
 
1515
+ def GetMostRecentCommitSummary(self):
1516
+ return RunShell(["git", "log", "-1", "--format=%s"], silent_ok=True).strip()
1517
+
1514
1518
 
1515
1519
  class CVSVCS(VersionControlSystem):
1516
1520
  """Implementation of the VersionControlSystem interface for CVS."""
@@ -2435,12 +2439,16 @@ def RealMain(argv, data=None):
2435
2439
  file = open(options.file, 'r')
2436
2440
  message = file.read()
2437
2441
  file.close()
2438
- if options.issue:
2439
- prompt = "Title describing this patch set: "
2440
- else:
2441
- prompt = "New issue subject: "
2442
- title = (
2443
- title or message.split('\n', 1)[0].strip() or raw_input(prompt).strip())
2442
+ title = title or message.split('\n', 1)[0].strip()
2443
+ if not title:
2444
+ if options.issue:
2445
+ prompt = "Title describing this patch set"
2446
+ else:
2447
+ prompt = "New issue subject"
2448
+ title_default = vcs.GetMostRecentCommitSummary()
2449
+ if title_default:
2450
+ prompt += " [%s]" % title_default
2451
+ title = raw_input(prompt + ": ").strip() or title_default
2444
2452
  if not title and not options.issue:
2445
2453
  ErrorExit("A non-empty title is required for a new issue")
2446
2454
  # For existing issues, it's fine to give a patchset an empty name. Rietveld
@@ -160,6 +160,17 @@ fi
160
160
  # We're on POSIX. We can now safely look for svn checkout.
161
161
  if [ "X$DEPOT_TOOLS_UPDATE" != "X0" -a -e "$base_dir/.svn" ]
162
162
  then
163
+ echo "========================"
164
+ echo "WARNING: You have an SVN checkout of depot_tools!"
165
+ echo
166
+ echo "depot_tools is migrating to Git on June 6, 2016. If you still have an"
167
+ echo "SVN checkout then, you will STOP RECEIVING UPDATES to depot_tools."
168
+ echo
169
+ echo "Before that date, please follow the instructions here[1] to get a Git"
170
+ echo "copy of depot_tools."
171
+ echo
172
+ echo "[1]: https://www.chromium.org/developers/how-tos/install-depot-tools"
173
+ echo "========================"
163
174
  # Update the root directory to stay up-to-date with the latest depot_tools.
164
175
  BEFORE_REVISION=$(get_svn_revision)
165
176
  if echo $* | grep -e --force > /dev/null; then
@@ -38,6 +38,17 @@ goto :EOF
38
38
 
39
39
 
40
40
  :SVN_UPDATE
41
+ echo ========================
42
+ echo WARNING: You have an SVN checkout of depot_tools!
43
+ echo.
44
+ echo depot_tools is migrating to Git on June 6, 2016. If you still have an
45
+ echo SVN checkout then, you will STOP RECEIVING UPDATES to depot_tools.
46
+ echo.
47
+ echo Before that date, please follow the instructions here[1] to get a Git
48
+ echo copy of depot_tools.
49
+ echo.
50
+ echo [1]: https://www.chromium.org/developers/how-tos/install-depot-tools
51
+ echo ========================
41
52
  FOR %%A IN (%*) DO (
42
53
  IF "%%A" == "--force" (
43
54
  call svn -q revert -R "%DEPOT_TOOLS_DIR%."
@@ -72,12 +72,24 @@ def GetFileList(root):
72
72
  assert not os.path.isabs(root)
73
73
  assert os.path.normpath(root) == root
74
74
  file_list = []
75
+ # Ignore WER ReportQueue entries that vctip/cl leave in the bin dir if/when
76
+ # they crash. Also ignores the content of the win_sdk/debuggers/x(86|64)/sym/
77
+ # directories as this is just the temporarily location that Windbg might use
78
+ # to store the symbol files.
79
+ #
80
+ # Note: These files are only created on a Windows host, so the
81
+ # ignored_directories list isn't relevant on non-Windows hosts.
82
+
83
+ ignored_directories = ['wer\\reportqueue',
84
+ 'win_sdk\\debuggers\\x86\\sym\\',
85
+ 'win_sdk\\debuggers\\x64\\sym\\']
75
86
  for base, _, files in os.walk(root):
76
87
  paths = [os.path.join(base, f) for f in files]
77
- # Ignore WER ReportQueue entries that vctip/cl leave in the bin dir if/when
78
- # they crash.
79
- file_list.extend(x.lower() for x in paths if 'WER\\ReportQueue' not in x)
80
- return sorted(file_list, key=lambda s: s.replace('/', '\\'))
88
+ for p in paths:
89
+ if any(ignored_dir in p.lower() for ignored_dir in ignored_directories):
90
+ continue
91
+ file_list.append(p)
92
+ return sorted(file_list, key=lambda s: s.replace('/', '\\').lower())
81
93
 
82
94
 
83
95
  def MakeTimestampsFileName(root, sha1):
@@ -119,6 +131,25 @@ def CalculateHash(root, expected_hash):
119
131
  disk != vc_dir and os.path.getmtime(disk) != cached[1]):
120
132
  matches = False
121
133
  break
134
+ elif os.path.exists(timestamps_file):
135
+ # Print some information about the extra/missing files. Don't do this if we
136
+ # don't have a timestamp file, as all the files will be considered as
137
+ # missing.
138
+ timestamps_data_files = []
139
+ for f in timestamps_data['files']:
140
+ timestamps_data_files.append(f[0])
141
+ missing_files = [f for f in timestamps_data_files if f not in file_list]
142
+ if len(missing_files):
143
+ print ('Some files are missing from the %s version of the toolchain:' %
144
+ expected_hash)
145
+ for f in missing_files:
146
+ print '\t%s' % f
147
+ extra_files = [f for f in file_list if f not in timestamps_data_files]
148
+ if len(extra_files):
149
+ print ('There\'s some extra files in the %s version of the toolchain:' %
150
+ expected_hash)
151
+ for f in extra_files:
152
+ print '\t%s' % f
122
153
  if matches:
123
154
  return timestamps_data['sha1']
124
155
 
@@ -131,20 +162,32 @@ def CalculateHash(root, expected_hash):
131
162
  if expected_hash:
132
163
  path_without_hash = path_without_hash.replace(
133
164
  os.path.join(root, expected_hash).replace('/', '\\'), root)
134
- digest.update(path_without_hash)
165
+ digest.update(path_without_hash.lower())
135
166
  with open(path, 'rb') as f:
136
167
  digest.update(f.read())
168
+
169
+ # Save the timestamp file if the calculated hash is the expected one.
170
+ if digest.hexdigest() == expected_hash:
171
+ SaveTimestampsAndHash(root, digest.hexdigest())
137
172
  return digest.hexdigest()
138
173
 
139
174
 
140
- def CalculateToolchainHashes(root):
175
+ def CalculateToolchainHashes(root, remove_corrupt_toolchains):
141
176
  """Calculate the hash of the different toolchains installed in the |root|
142
177
  directory."""
143
178
  hashes = []
144
179
  dir_list = [
145
180
  d for d in os.listdir(root) if os.path.isdir(os.path.join(root, d))]
146
181
  for d in dir_list:
147
- hashes.append(CalculateHash(root, d))
182
+ toolchain_hash = CalculateHash(root, d)
183
+ if toolchain_hash != d:
184
+ print ('The hash of a version of the toolchain has an unexpected value ('
185
+ '%s instead of %s)%s.' % (toolchain_hash, d,
186
+ ', removing it' if remove_corrupt_toolchains else ''))
187
+ if remove_corrupt_toolchains:
188
+ RemoveToolchain(root, d, True)
189
+ else:
190
+ hashes.append(toolchain_hash)
148
191
  return hashes
149
192
 
150
193
 
@@ -425,7 +468,7 @@ def main():
425
468
  # Typically this script is only run when the .sha1 one file is updated, but
426
469
  # directly calling "gclient runhooks" will also run it, so we cache
427
470
  # based on timestamps to make that case fast.
428
- current_hashes = CalculateToolchainHashes(target_dir)
471
+ current_hashes = CalculateToolchainHashes(target_dir, True)
429
472
  if desired_hash not in current_hashes:
430
473
  should_use_gs = False
431
474
  if (HaveSrcInternalAccess() or
@@ -479,7 +522,7 @@ def main():
479
522
  json.dump(data, f)
480
523
 
481
524
  if got_new_toolchain:
482
- current_hashes = CalculateToolchainHashes(target_dir)
525
+ current_hashes = CalculateToolchainHashes(target_dir, False)
483
526
  if desired_hash not in current_hashes:
484
527
  print >> sys.stderr, (
485
528
  'Got wrong hash after pulling a new toolchain. '
@@ -39,7 +39,7 @@ VS_VERSION = None
39
39
  WIN_VERSION = None
40
40
 
41
41
 
42
- def BuildFileList():
42
+ def BuildFileList(override_dir):
43
43
  result = []
44
44
 
45
45
  # Subset of VS corresponding roughly to VC.
@@ -49,13 +49,23 @@ def BuildFileList():
49
49
  'DIA SDK/include',
50
50
  'DIA SDK/lib',
51
51
  'VC/atlmfc',
52
- 'VC/bin',
53
52
  'VC/crt',
54
- 'VC/include',
55
- 'VC/lib',
56
53
  'VC/redist',
57
54
  ]
58
55
 
56
+ if override_dir:
57
+ paths += [
58
+ (os.path.join(override_dir, 'bin'), 'VC/bin'),
59
+ (os.path.join(override_dir, 'include'), 'VC/include'),
60
+ (os.path.join(override_dir, 'lib'), 'VC/lib'),
61
+ ]
62
+ else:
63
+ paths += [
64
+ 'VC/bin',
65
+ 'VC/include',
66
+ 'VC/lib',
67
+ ]
68
+
59
69
  if VS_VERSION == '2013':
60
70
  paths += [
61
71
  ('VC/redist/x86/Microsoft.VC120.CRT', 'sys32'),
@@ -92,14 +102,18 @@ def BuildFileList():
92
102
 
93
103
  for path in paths:
94
104
  src = path[0] if isinstance(path, tuple) else path
95
- combined = os.path.join(vs_path, src)
105
+ # Note that vs_path is ignored if src is an absolute path.
106
+ # normpath is needed to change '/' to '\\' characters.
107
+ combined = os.path.normpath(os.path.join(vs_path, src))
96
108
  assert os.path.exists(combined) and os.path.isdir(combined)
97
109
  for root, _, files in os.walk(combined):
98
110
  for f in files:
99
111
  final_from = os.path.normpath(os.path.join(root, f))
100
112
  if isinstance(path, tuple):
113
+ assert final_from.startswith(combined)
114
+ dest = final_from[len(combined) + 1:]
101
115
  result.append(
102
- (final_from, os.path.normpath(os.path.join(path[1], f))))
116
+ (final_from, os.path.normpath(os.path.join(path[1], dest))))
103
117
  else:
104
118
  assert final_from.startswith(vs_path)
105
119
  dest = final_from[len(vs_path) + 1:]
@@ -140,61 +154,44 @@ def BuildFileList():
140
154
  result.append((combined, to))
141
155
 
142
156
  if VS_VERSION == '2015':
143
- # The Windows 10 Universal C Runtime installers are needed when packaging
144
- # VS 2015. They can be download from here:
145
- # https://support.microsoft.com/en-us/kb/2999226
146
- # and they must be downloaded to the current user's downloads directory.
147
- # The versions needed are those for 64-bit Windows 7, Windows 8, and
148
- # Windows 8.1. The 64-bit Server 2008 R2, Server 2012, and Server 2012 R2
149
- # versions are identical (same name and contents).
150
- universal_runtime_installers = [
151
- 'Windows6.1-KB2999226-x64.msu',
152
- 'Windows8-RT-KB2999226-x64.msu',
153
- 'Windows8.1-KB2999226-x64.msu',
157
+ # Copy the x86 ucrt DLLs to all directories with 32-bit binaries that are
158
+ # added to the path by SetEnv.cmd, and to sys32.
159
+ ucrt_paths = glob.glob(os.path.join(sdk_path, r'redist\ucrt\dlls\x86\*'))
160
+ for ucrt_path in ucrt_paths:
161
+ ucrt_file = os.path.split(ucrt_path)[1]
162
+ for dest_dir in [ r'win_sdk\bin\x86', 'sys32' ]:
163
+ result.append((ucrt_path, os.path.join(dest_dir, ucrt_file)))
164
+
165
+ # Copy the x64 ucrt DLLs to all directories with 64-bit binaries that are
166
+ # added to the path by SetEnv.cmd, and to sys64.
167
+ ucrt_paths = glob.glob(os.path.join(sdk_path, r'redist\ucrt\dlls\x64\*'))
168
+ for ucrt_path in ucrt_paths:
169
+ ucrt_file = os.path.split(ucrt_path)[1]
170
+ for dest_dir in [ r'VC\bin\amd64_x86', r'VC\bin\amd64',
171
+ r'win_sdk\bin\x64', 'sys64']:
172
+ result.append((ucrt_path, os.path.join(dest_dir, ucrt_file)))
173
+
174
+ system_crt_files = [
175
+ # Needed to let debug binaries run.
176
+ 'ucrtbased.dll',
154
177
  ]
155
-
156
- for installer in universal_runtime_installers:
157
- result.append((os.path.join(os.environ['userprofile'], 'downloads',
158
- installer),
159
- os.path.join('installers', installer)))
160
-
161
- if VS_VERSION == '2015':
162
- # Copy the x86 ucrt DLLs to all directories with 32-bit binaries that are
163
- # added to the path by SetEnv.cmd, and to sys32.
164
- ucrt_paths = glob.glob(os.path.join(sdk_path, r'redist\ucrt\dlls\x86\*'))
165
- for ucrt_path in ucrt_paths:
166
- ucrt_file = os.path.split(ucrt_path)[1]
167
- for dest_dir in [ r'win_sdk\bin\x86', 'sys32' ]:
168
- result.append((ucrt_path, os.path.join(dest_dir, ucrt_file)))
169
-
170
- # Copy the x64 ucrt DLLs to all directories with 64-bit binaries that are
171
- # added to the path by SetEnv.cmd, and to sys64.
172
- ucrt_paths = glob.glob(os.path.join(sdk_path, r'redist\ucrt\dlls\x64\*'))
173
- for ucrt_path in ucrt_paths:
174
- ucrt_file = os.path.split(ucrt_path)[1]
175
- for dest_dir in [ r'VC\bin\amd64_x86', r'VC\bin\amd64',
176
- r'win_sdk\bin\x64', 'sys64']:
177
- result.append((ucrt_path, os.path.join(dest_dir, ucrt_file)))
178
-
179
- system_crt_files = [
180
- # Needed to let debug binaries run.
181
- 'ucrtbased.dll',
182
- ]
183
- bitness = platform.architecture()[0]
184
- # When running 64-bit python the x64 DLLs will be in System32
185
- x64_path = 'System32' if bitness == '64bit' else 'Sysnative'
186
- x64_path = os.path.join(r'C:\Windows', x64_path)
187
- for system_crt_file in system_crt_files:
188
- result.append((os.path.join(r'C:\Windows\SysWOW64', system_crt_file),
189
- os.path.join('sys32', system_crt_file)))
190
- result.append((os.path.join(x64_path, system_crt_file),
191
- os.path.join('sys64', system_crt_file)))
178
+ bitness = platform.architecture()[0]
179
+ # When running 64-bit python the x64 DLLs will be in System32
180
+ x64_path = 'System32' if bitness == '64bit' else 'Sysnative'
181
+ x64_path = os.path.join(r'C:\Windows', x64_path)
182
+ for system_crt_file in system_crt_files:
183
+ result.append((os.path.join(r'C:\Windows\SysWOW64', system_crt_file),
184
+ os.path.join('sys32', system_crt_file)))
185
+ result.append((os.path.join(x64_path, system_crt_file),
186
+ os.path.join('sys64', system_crt_file)))
192
187
 
193
188
  # Generically drop all arm stuff that we don't need, and
194
- # drop .msi files because we don't need installers.
189
+ # drop .msi files because we don't need installers, and drop windows.winmd
190
+ # because it is unneeded and is different on every machine.
195
191
  return [(f, t) for f, t in result if 'arm\\' not in f.lower() and
196
192
  'arm64\\' not in f.lower() and
197
- not f.lower().endswith('.msi')]
193
+ not f.lower().endswith('.msi') and
194
+ not f.lower().endswith('windows.winmd')]
198
195
 
199
196
 
200
197
  def GenerateSetEnvCmd(target_dir):
@@ -329,6 +326,9 @@ def main():
329
326
  parser.add_option('-d', '--dryrun', action='store_true', dest='dryrun',
330
327
  default=False,
331
328
  help='scan for file existence and prints statistics')
329
+ parser.add_option('--override', action='store', type='string',
330
+ dest='override_dir', default=None,
331
+ help='Specify alternate bin/include/lib directory')
332
332
  (options, args) = parser.parse_args()
333
333
 
334
334
  if len(args) != 1 or args[0] not in ('2013', '2015'):
@@ -336,13 +336,20 @@ def main():
336
336
  parser.print_help();
337
337
  return 1
338
338
 
339
+ if options.override_dir:
340
+ if (not os.path.exists(os.path.join(options.override_dir, 'bin')) or
341
+ not os.path.exists(os.path.join(options.override_dir, 'include')) or
342
+ not os.path.exists(os.path.join(options.override_dir, 'lib'))):
343
+ print 'Invalid override directory - must contain bin/include/lib dirs'
344
+ return 1
345
+
339
346
  global VS_VERSION
340
347
  VS_VERSION = args[0]
341
348
  global WIN_VERSION
342
349
  WIN_VERSION = options.winver
343
350
 
344
351
  print 'Building file list for VS %s Windows %s...' % (VS_VERSION, WIN_VERSION)
345
- files = BuildFileList()
352
+ files = BuildFileList(options.override_dir)
346
353
 
347
354
  AddEnvSetup(files)
348
355