libv8 5.2.361.43.1 → 5.3.332.38.0beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGELOG.md +4 -0
  4. data/README.md +1 -0
  5. data/Rakefile +4 -4
  6. data/ext/libv8/paths.rb +1 -1
  7. data/lib/libv8/version.rb +1 -1
  8. data/libv8.gemspec +1 -1
  9. data/patches/0001-Build-a-standalone-static-library.patch +4 -4
  10. data/patches/0002-Don-t-compile-unnecessary-stuff.patch +4 -4
  11. data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +4 -4
  12. data/patches/0004-Reinterpret-thread-hash-for-FreeBSD-too.patch +8 -8
  13. data/spec/location_spec.rb +1 -1
  14. data/vendor/depot_tools/README.gclient.md +67 -0
  15. data/vendor/depot_tools/README.git-cl.md +112 -0
  16. data/vendor/depot_tools/README.md +50 -36
  17. data/vendor/depot_tools/bootstrap/win/README.md +5 -5
  18. data/vendor/depot_tools/bootstrap/win/git_bootstrap.py +203 -0
  19. data/vendor/depot_tools/bootstrap/win/git_version.txt +1 -0
  20. data/vendor/depot_tools/bootstrap/win/git_version_bleeding_edge.txt +1 -0
  21. data/vendor/depot_tools/bootstrap/win/win_tools.bat +1 -148
  22. data/vendor/depot_tools/cit.py +27 -21
  23. data/vendor/depot_tools/codereview.settings +1 -1
  24. data/vendor/depot_tools/cpplint.py +1 -1
  25. data/vendor/depot_tools/fix_encoding.py +1 -1
  26. data/vendor/depot_tools/gclient.py +4 -3
  27. data/vendor/depot_tools/gclient_scm.py +20 -9
  28. data/vendor/depot_tools/gclient_utils.py +84 -13
  29. data/vendor/depot_tools/gerrit_util.py +1 -1
  30. data/vendor/depot_tools/git_cl.py +374 -218
  31. data/vendor/depot_tools/git_cl_completion.sh +34 -0
  32. data/vendor/depot_tools/git_common.py +11 -7
  33. data/vendor/depot_tools/infra/config/OWNERS +1 -0
  34. data/vendor/depot_tools/infra/config/cq.cfg +3 -12
  35. data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
  36. data/vendor/depot_tools/presubmit_canned_checks.py +4 -2
  37. data/vendor/depot_tools/presubmit_support.py +26 -40
  38. data/vendor/depot_tools/recipe_modules/bot_update/api.py +31 -11
  39. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/apply_gerrit_ref.json +26 -0
  40. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic.json +1 -1
  41. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_output_manifest.json +1 -1
  42. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +1 -1
  43. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/clobber.json +1 -1
  44. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/forced.json +1 -1
  45. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json +44 -0
  46. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_reset.json +1 -1
  47. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/no_shallow.json +1 -1
  48. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/off.json +1 -1
  49. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +1 -1
  50. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange.json +1 -1
  51. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2.json +1 -1
  52. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob.json +1 -1
  53. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail.json +1 -1
  54. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +1 -1
  55. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +3 -3
  56. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json +1 -1
  57. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8.json +1 -1
  58. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json +1 -1
  59. data/vendor/depot_tools/recipe_modules/bot_update/example.py +35 -18
  60. data/vendor/depot_tools/recipe_modules/bot_update/resources/apply_gerrit.py +33 -0
  61. data/vendor/depot_tools/recipe_modules/bot_update/resources/bot_update.py +45 -76
  62. data/vendor/depot_tools/recipe_modules/bot_update/test_api.py +13 -18
  63. data/vendor/depot_tools/recipe_modules/cipd/__init__.py +10 -0
  64. data/vendor/depot_tools/recipe_modules/cipd/api.py +244 -0
  65. data/vendor/depot_tools/recipe_modules/cipd/example.expected/basic.json +445 -0
  66. data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-failed.json +128 -0
  67. data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-many-instances.json +453 -0
  68. data/vendor/depot_tools/recipe_modules/cipd/example.expected/install-failed.json +31 -0
  69. data/vendor/depot_tools/recipe_modules/cipd/example.expected/mac64.json +445 -0
  70. data/vendor/depot_tools/recipe_modules/cipd/example.expected/win64.json +445 -0
  71. data/vendor/depot_tools/recipe_modules/cipd/example.py +115 -0
  72. data/vendor/depot_tools/recipe_modules/cipd/resources/bootstrap.py +218 -0
  73. data/vendor/depot_tools/recipe_modules/cipd/test_api.py +102 -0
  74. data/vendor/depot_tools/recipe_modules/gclient/api.py +34 -53
  75. data/vendor/depot_tools/recipe_modules/gclient/config.py +22 -128
  76. data/vendor/depot_tools/recipe_modules/gclient/example.expected/basic.json +44 -6
  77. data/vendor/depot_tools/recipe_modules/gclient/example.expected/revision.json +44 -6
  78. data/vendor/depot_tools/recipe_modules/gclient/example.expected/tryserver.json +44 -17
  79. data/vendor/depot_tools/recipe_modules/gclient/example.py +1 -1
  80. data/vendor/depot_tools/recipe_modules/gclient/test_api.py +4 -9
  81. data/vendor/depot_tools/recipe_modules/git/api.py +25 -7
  82. data/vendor/depot_tools/recipe_modules/git/example.expected/basic.json +3 -0
  83. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_branch.json +3 -0
  84. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_file_name.json +3 -0
  85. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_hash.json +3 -0
  86. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_ref.json +3 -0
  87. data/vendor/depot_tools/recipe_modules/git/example.expected/basic_submodule_update_force.json +3 -0
  88. data/vendor/depot_tools/recipe_modules/git/example.expected/can_fail_build.json +3 -0
  89. data/vendor/depot_tools/recipe_modules/git/example.expected/cannot_fail_build.json +3 -0
  90. data/vendor/depot_tools/recipe_modules/git/example.expected/cat-file_test.json +3 -0
  91. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_delta.json +3 -0
  92. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_failed.json +3 -0
  93. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output.json +3 -0
  94. data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json +3 -0
  95. data/vendor/depot_tools/recipe_modules/git/example.expected/curl_trace_file.json +2 -1
  96. data/vendor/depot_tools/recipe_modules/git/example.expected/git-cache-checkout.json +41 -3
  97. data/vendor/depot_tools/recipe_modules/git/example.expected/platform_win.json +7 -1
  98. data/vendor/depot_tools/recipe_modules/git/example.expected/rebase_failed.json +3 -0
  99. data/vendor/depot_tools/recipe_modules/git/example.expected/remote_not_origin.json +3 -0
  100. data/vendor/depot_tools/recipe_modules/git/example.expected/set_got_revision.json +3 -0
  101. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch.json +4 -1
  102. data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch_new.json +4 -1
  103. data/vendor/depot_tools/recipes.py +8 -2
  104. data/vendor/depot_tools/roll-dep-svn.bat +10 -10
  105. data/vendor/depot_tools/roll_dep.py +0 -1
  106. data/vendor/depot_tools/third_party/upload.py +1 -25
  107. data/vendor/depot_tools/upload_to_google_storage.py +1 -1
  108. metadata +24 -32
  109. data/release/armhf-linux/Vagrantfile +0 -97
  110. data/release/armhf-linux/initrd.img +0 -0
  111. data/release/armhf-linux/vmlinuz +0 -0
  112. data/release/x86-linux/Vagrantfile +0 -85
  113. data/release/x86_64-freebsd-10/Vagrantfile +0 -88
  114. data/release/x86_64-linux/Vagrantfile +0 -85
  115. data/vendor/depot_tools/README.codereview +0 -99
  116. data/vendor/depot_tools/README.gclient +0 -82
  117. data/vendor/depot_tools/README.git-cl +0 -52
  118. data/vendor/depot_tools/chrome-update-create-task.bat +0 -52
  119. data/vendor/depot_tools/chrome-update.bat +0 -5
  120. data/vendor/depot_tools/chrome-update.py +0 -91
  121. data/vendor/depot_tools/create-chromium-git-src +0 -200
  122. data/vendor/depot_tools/drover +0 -25
  123. data/vendor/depot_tools/drover.bat +0 -9
  124. data/vendor/depot_tools/drover.py +0 -648
  125. data/vendor/depot_tools/gcl +0 -8
  126. data/vendor/depot_tools/gcl.bat +0 -6
  127. data/vendor/depot_tools/gcl.py +0 -1523
  128. data/vendor/depot_tools/git-try +0 -9
  129. data/vendor/depot_tools/git_try.py +0 -76
  130. data/vendor/depot_tools/luci_hacks/README.md +0 -35
  131. data/vendor/depot_tools/luci_hacks/__init__.py +0 -0
  132. data/vendor/depot_tools/luci_hacks/luci_recipe_run.isolate +0 -12
  133. data/vendor/depot_tools/luci_hacks/luci_recipe_run.py +0 -81
  134. data/vendor/depot_tools/luci_hacks/trigger_luci_job.py +0 -128
  135. data/vendor/depot_tools/recipe_modules/bot_update/example.expected/svn_mode.json +0 -59
  136. data/vendor/depot_tools/trychange.py +0 -1265
@@ -0,0 +1,218 @@
1
+ # Copyright 2015 The Chromium Authors. All rights reserved.
2
+ # Use of this source code is governed by a BSD-style license that can be
3
+ # found in the LICENSE file.
4
+
5
+ import argparse
6
+ import errno
7
+ import hashlib
8
+ import json
9
+ import os
10
+ import sys
11
+ import tempfile
12
+ import time
13
+ import traceback
14
+ import urllib
15
+ import urllib2
16
+
17
+
18
+ # Default package repository URL.
19
+ CIPD_BACKEND_URL = 'https://chrome-infra-packages.appspot.com'
20
+
21
+ # ./cipd resolve \
22
+ # infra/tools/cipd/ \
23
+ # -version=git_revision:768586a9aa72fe6a41a8a0205ed56ceb1495625c
24
+ CLIENT_VERSIONS = {
25
+ 'linux-386': '3f5d6d3906c3b2c6a057d1ab1634ac06aa418708',
26
+ 'linux-amd64': '1ea0b6b254ad3f546c826dd3e437798ace2c2480',
27
+ 'mac-amd64': 'c111be343c692e5285113a6b1c999887adbb268e',
28
+ 'windows-386': 'dc3d1bd5b4b93945640bac4bb047c333a8fa12fd',
29
+ 'windows-amd64': 'bccdb9a605037e3dd2a8a64e79e08f691a6f159d',
30
+ }
31
+
32
+
33
+ class CipdBootstrapError(Exception):
34
+ """Raised by install_cipd_client on fatal error."""
35
+
36
+ def install_cipd_client(path, package, version):
37
+ """Installs CIPD client to <path>/cipd.
38
+
39
+ Args:
40
+ path: root directory to install CIPD client into.
41
+ package: cipd client package name, e.g. infra/tools/cipd/linux-amd64.
42
+ version: version of the package to install.
43
+
44
+ Returns:
45
+ Absolute path to CIPD executable.
46
+ """
47
+ print 'Ensuring CIPD client is up-to-date'
48
+ version_file = os.path.join(path, 'VERSION')
49
+ bin_file = os.path.join(path, 'cipd')
50
+
51
+ # Resolve version to concrete instance ID, e.g "live" -> "abcdef0123....".
52
+ instance_id = call_cipd_api(
53
+ 'repo/v1/instance/resolve',
54
+ {'package_name': package, 'version': version})['instance_id']
55
+ print 'CIPD client %s => %s' % (version, instance_id)
56
+
57
+ # Already installed?
58
+ installed_instance_id = (read_file(version_file) or '').strip()
59
+ if installed_instance_id == instance_id and os.path.exists(bin_file):
60
+ return bin_file, instance_id
61
+
62
+ # Resolve instance ID to an URL to fetch client binary from.
63
+ client_info = call_cipd_api(
64
+ 'repo/v1/client',
65
+ {'package_name': package, 'instance_id': instance_id})
66
+ print 'CIPD client binary info:\n%s' % dump_json(client_info)
67
+
68
+ # Fetch the client. It is ~10 MB, so don't bother and fetch it into memory.
69
+ status, raw_client_bin = fetch_url(client_info['client_binary']['fetch_url'])
70
+ if status != 200:
71
+ print 'Failed to fetch client binary, HTTP %d' % status
72
+ raise CipdBootstrapError('Failed to fetch client binary, HTTP %d' % status)
73
+ digest = hashlib.sha1(raw_client_bin).hexdigest()
74
+ if digest != client_info['client_binary']['sha1']:
75
+ raise CipdBootstrapError('Client SHA1 mismatch')
76
+
77
+ # Success.
78
+ print 'Fetched CIPD client %s:%s at %s' % (package, instance_id, bin_file)
79
+ write_file(bin_file, raw_client_bin)
80
+ os.chmod(bin_file, 0755)
81
+ write_file(version_file, instance_id + '\n')
82
+ return bin_file, instance_id
83
+
84
+
85
+ def call_cipd_api(endpoint, query):
86
+ """Sends GET request to CIPD backend, parses JSON response."""
87
+ url = '%s/_ah/api/%s' % (CIPD_BACKEND_URL, endpoint)
88
+ if query:
89
+ url += '?' + urllib.urlencode(query)
90
+ status, body = fetch_url(url)
91
+ if status != 200:
92
+ raise CipdBootstrapError('Server replied with HTTP %d' % status)
93
+ try:
94
+ body = json.loads(body)
95
+ except ValueError:
96
+ raise CipdBootstrapError('Server returned invalid JSON')
97
+ status = body.get('status')
98
+ if status != 'SUCCESS':
99
+ m = body.get('error_message') or '<no error message>'
100
+ raise CipdBootstrapError('Server replied with error %s: %s' % (status, m))
101
+ return body
102
+
103
+
104
+ def fetch_url(url, headers=None):
105
+ """Sends GET request (with retries).
106
+
107
+ Args:
108
+ url: URL to fetch.
109
+ headers: dict with request headers.
110
+
111
+ Returns:
112
+ (200, reply body) on success.
113
+ (HTTP code, None) on HTTP 401, 403, or 404 reply.
114
+
115
+ Raises:
116
+ Whatever urllib2 raises.
117
+ """
118
+ req = urllib2.Request(url)
119
+ req.add_header('User-Agent', 'cipd recipe bootstrap.py')
120
+ for k, v in (headers or {}).iteritems():
121
+ req.add_header(str(k), str(v))
122
+ i = 0
123
+ while True:
124
+ i += 1
125
+ try:
126
+ print 'GET %s' % url
127
+ return 200, urllib2.urlopen(req, timeout=60).read()
128
+ except Exception as e:
129
+ if isinstance(e, urllib2.HTTPError):
130
+ print 'Failed to fetch %s, server returned HTTP %d' % (url, e.code)
131
+ if e.code in (401, 403, 404):
132
+ return e.code, None
133
+ else:
134
+ print 'Failed to fetch %s' % url
135
+ if i == 20:
136
+ raise
137
+ print 'Retrying in %d sec.' % i
138
+ time.sleep(i)
139
+
140
+
141
+ def ensure_directory(path):
142
+ """Creates a directory."""
143
+ # Handle a case where a file is being converted into a directory.
144
+ chunks = path.split(os.sep)
145
+ for i in xrange(len(chunks)):
146
+ p = os.sep.join(chunks[:i+1])
147
+ if os.path.exists(p) and not os.path.isdir(p):
148
+ os.remove(p)
149
+ break
150
+ try:
151
+ os.makedirs(path)
152
+ except OSError as e:
153
+ if e.errno != errno.EEXIST:
154
+ raise
155
+
156
+
157
+ def read_file(path):
158
+ """Returns contents of a file or None if missing."""
159
+ try:
160
+ with open(path, 'r') as f:
161
+ return f.read()
162
+ except IOError as e:
163
+ if e.errno == errno.ENOENT:
164
+ return None
165
+ raise
166
+
167
+
168
+ def write_file(path, data):
169
+ """Puts a file on disk, atomically."""
170
+ ensure_directory(os.path.dirname(path))
171
+ fd, temp_file = tempfile.mkstemp(dir=os.path.dirname(path))
172
+ with os.fdopen(fd, 'w') as f:
173
+ f.write(data)
174
+ if not sys.platform in ('linux2', 'darwin'):
175
+ # On windows we should remove destination file if it exists.
176
+ if os.path.exists(path):
177
+ os.remove(path)
178
+ # At this point we may crash, and it's OK, as next time we'll just
179
+ # re-install CIPD from scratch.
180
+ os.rename(temp_file, path)
181
+
182
+
183
+ def dump_json(obj):
184
+ """Pretty-formats object to JSON."""
185
+ return json.dumps(obj, indent=2, sort_keys=True, separators=(',',':'))
186
+
187
+
188
+ def main(args):
189
+ parser = argparse.ArgumentParser('bootstrap cipd')
190
+ parser.add_argument('--json-output', default=None)
191
+ parser.add_argument('--version', default=None)
192
+ parser.add_argument('--platform', required=True)
193
+ parser.add_argument('--dest-directory', required=True)
194
+ opts = parser.parse_args(args)
195
+
196
+ package = "infra/tools/cipd/%s" % opts.platform
197
+ version = opts.version or CLIENT_VERSIONS[opts.platform]
198
+
199
+ try:
200
+ exe_path, instance_id = install_cipd_client(opts.dest_directory,
201
+ package, version)
202
+ result = {
203
+ 'executable': exe_path,
204
+ 'instance_id': instance_id
205
+ }
206
+ if opts.json_output:
207
+ with open(opts.json_output, 'w') as f:
208
+ json.dump(result, f)
209
+ except Exception as e:
210
+ print 'Exception installing cipd: %s' % e
211
+ _exc_type, _exc_value, exc_traceback = sys.exc_info()
212
+ traceback.print_tb(exc_traceback)
213
+ return 1
214
+
215
+ return 0
216
+
217
+ if __name__ == '__main__':
218
+ sys.exit(main(sys.argv[1:]))
@@ -0,0 +1,102 @@
1
+ # Copyright 2015 The Chromium Authors. All rights reserved.
2
+ # Use of this source code is governed by a BSD-style license that can be
3
+ # found in the LICENSE file.
4
+
5
+ from recipe_engine import recipe_test_api
6
+
7
+
8
+ class CIPDTestApi(recipe_test_api.RecipeTestApi):
9
+ def make_resolved_version(self, v):
10
+ if not v:
11
+ return '40-chars-fake-of-the-package-instance_id'
12
+ if len(v) == 40:
13
+ return v
14
+ # Truncate or pad to 40 chars.
15
+ prefix = 'resolved-instance_id-of-'
16
+ if len(v) + len(prefix) >= 40:
17
+ return '%s%s' % (prefix, v[:40-len(prefix)])
18
+ return '%s%s%s' % (prefix, v, '-' * (40 - len(prefix) - len(v)))
19
+
20
+ def make_pin(self, package_name, version=None):
21
+ return {
22
+ 'package': package_name,
23
+ 'instance_id': self.make_resolved_version(version),
24
+ }
25
+
26
+ def _resultify(self, result, error=None, retcode=None):
27
+ dic = {'result': result}
28
+ if error:
29
+ dic['error'] = error
30
+ return self.m.json.output(dic, retcode=retcode)
31
+
32
+ def make_test_executable(self):
33
+ return str(self.m.path['slave_build'].join('cipd', 'cipd'))
34
+
35
+ def example_error(self, error, retcode=None):
36
+ return self._resultify(
37
+ result=None,
38
+ error=error,
39
+ retcode=1 if retcode is None else retcode)
40
+
41
+ def example_install_client(self, package_name, version=None, retcode=None):
42
+ return self.m.json.output({
43
+ 'executable': self.make_test_executable(),
44
+ 'instance_id': self.make_resolved_version(version),
45
+ }, retcode=retcode)
46
+
47
+ def example_build(self, package_name, version=None):
48
+ return self._resultify(self.make_pin(package_name, version))
49
+
50
+ example_register = example_build
51
+
52
+ def example_ensure(self, packages):
53
+ return self._resultify([self.make_pin(name, version)
54
+ for name, version in sorted(packages.items())])
55
+
56
+ def example_set_tag(self, package_name, version):
57
+ return self._resultify({
58
+ 'package': package_name,
59
+ 'pin': self.make_pin(package_name, version)
60
+ })
61
+
62
+ example_set_ref = example_set_tag
63
+
64
+ def example_search(self, package_name, instances=None):
65
+ if instances is None:
66
+ # Return one instance by default.
67
+ return self._resultify([self.make_pin(package_name)])
68
+ if isinstance(instances, int):
69
+ instances = ['instance_id_%i' % (i+1) for i in xrange(instances)]
70
+ return self._resultify([self.make_pin(package_name, instance)
71
+ for instance in instances])
72
+
73
+ def example_describe(self, package_name, version=None,
74
+ test_data_refs=None, test_data_tags=None,
75
+ user='user:44-blablbla@developer.gserviceaccount.com',
76
+ tstamp=1446574210):
77
+ assert not test_data_tags or all(':' in tag for tag in test_data_tags)
78
+ return self._resultify({
79
+ 'pin': self.make_pin(package_name, version),
80
+ 'registered_by': user,
81
+ 'registered_ts': tstamp,
82
+ 'refs': [
83
+ {
84
+ 'ref': ref,
85
+ 'modified_by': user,
86
+ 'modified_ts': tstamp,
87
+ }
88
+ for ref in (['latest'] if test_data_refs is None else test_data_refs)
89
+ ],
90
+ 'tags': [
91
+ {
92
+ 'tag': tag,
93
+ 'registered_by': user,
94
+ 'registered_ts': tstamp,
95
+ }
96
+ for tag in ([
97
+ 'buildbot_build:some.waterfall/builder/1234',
98
+ 'git_repository:https://chromium.googlesource.com/some/repo',
99
+ 'git_revision:397a2597cdc237f3026e6143b683be4b9ab60540',
100
+ ] if test_data_tags is None else test_data_tags)
101
+ ],
102
+ })
@@ -151,40 +151,30 @@ class GclientApi(recipe_api.RecipeApi):
151
151
  test_data_paths = set(cfg.got_revision_mapping.keys() +
152
152
  [s.name for s in cfg.solutions])
153
153
  step_test_data = lambda: (
154
- self.test_api.output_json(test_data_paths, cfg.GIT_MODE))
154
+ self.test_api.output_json(test_data_paths))
155
155
  try:
156
- if not cfg.GIT_MODE:
157
- args = ['sync', '--nohooks', '--force', '--verbose']
158
- if cfg.delete_unversioned_trees:
159
- args.append('--delete_unversioned_trees')
160
- if with_branch_heads:
161
- args.append('--with_branch_heads')
162
- self('sync', args + revisions + ['--output-json', self.m.json.output()],
163
- step_test_data=step_test_data,
164
- **kwargs)
165
- else:
166
- # clean() isn't used because the gclient sync flags passed in checkout()
167
- # do much the same thing, and they're more correct than doing a separate
168
- # 'gclient revert' because it makes sure the other args are correct when
169
- # a repo was deleted and needs to be re-cloned (notably
170
- # --with_branch_heads), whereas 'revert' uses default args for clone
171
- # operations.
172
- #
173
- # TODO(mmoss): To be like current official builders, this step could
174
- # just delete the whole <slave_name>/build/ directory and start each
175
- # build from scratch. That might be the least bad solution, at least
176
- # until we have a reliable gclient method to produce a pristine working
177
- # dir for git-based builds (e.g. maybe some combination of 'git
178
- # reset/clean -fx' and removing the 'out' directory).
179
- j = '-j2' if self.m.platform.is_win else '-j8'
180
- args = ['sync', '--verbose', '--with_branch_heads', '--nohooks', j,
181
- '--reset', '--force', '--upstream', '--no-nag-max']
182
- if cfg.delete_unversioned_trees:
183
- args.append('--delete_unversioned_trees')
184
- self('sync', args + revisions +
185
- ['--output-json', self.m.json.output()],
186
- step_test_data=step_test_data,
187
- **kwargs)
156
+ # clean() isn't used because the gclient sync flags passed in checkout()
157
+ # do much the same thing, and they're more correct than doing a separate
158
+ # 'gclient revert' because it makes sure the other args are correct when
159
+ # a repo was deleted and needs to be re-cloned (notably
160
+ # --with_branch_heads), whereas 'revert' uses default args for clone
161
+ # operations.
162
+ #
163
+ # TODO(mmoss): To be like current official builders, this step could
164
+ # just delete the whole <slave_name>/build/ directory and start each
165
+ # build from scratch. That might be the least bad solution, at least
166
+ # until we have a reliable gclient method to produce a pristine working
167
+ # dir for git-based builds (e.g. maybe some combination of 'git
168
+ # reset/clean -fx' and removing the 'out' directory).
169
+ j = '-j2' if self.m.platform.is_win else '-j8'
170
+ args = ['sync', '--verbose', '--with_branch_heads', '--nohooks', j,
171
+ '--reset', '--force', '--upstream', '--no-nag-max']
172
+ if cfg.delete_unversioned_trees:
173
+ args.append('--delete_unversioned_trees')
174
+ self('sync', args + revisions +
175
+ ['--output-json', self.m.json.output()],
176
+ step_test_data=step_test_data,
177
+ **kwargs)
188
178
  finally:
189
179
  result = self.m.step.active_result
190
180
  data = result.json.output
@@ -239,25 +229,16 @@ class GclientApi(recipe_api.RecipeApi):
239
229
 
240
230
  sync_step = None
241
231
  try:
242
- if not cfg.GIT_MODE:
243
- try:
244
- if revert:
245
- self.revert(**kwargs)
246
- finally:
247
- sync_step = self.sync(cfg, with_branch_heads=with_branch_heads,
248
- **kwargs)
249
- else:
250
- sync_step = self.sync(cfg, with_branch_heads=with_branch_heads,
251
- **kwargs)
252
-
253
- cfg_cmds = [
254
- ('user.name', 'local_bot'),
255
- ('user.email', 'local_bot@example.com'),
256
- ]
257
- for var, val in cfg_cmds:
258
- name = 'recurse (git config %s)' % var
259
- self(name, ['recurse', 'git', 'config', var, val], **kwargs)
260
-
232
+ sync_step = self.sync(cfg, with_branch_heads=with_branch_heads,
233
+ **kwargs)
234
+
235
+ cfg_cmds = [
236
+ ('user.name', 'local_bot'),
237
+ ('user.email', 'local_bot@example.com'),
238
+ ]
239
+ for var, val in cfg_cmds:
240
+ name = 'recurse (git config %s)' % var
241
+ self(name, ['recurse', 'git', 'config', var, val], **kwargs)
261
242
  finally:
262
243
  cwd = kwargs.get('cwd', self.m.path['slave_build'])
263
244
  if 'checkout' not in self.m.path:
@@ -266,7 +247,7 @@ class GclientApi(recipe_api.RecipeApi):
266
247
 
267
248
  return sync_step
268
249
 
269
- def revert(self, **kwargs):
250
+ def revert(self, **kwargs): # pragma: no cover
270
251
  """Return a gclient_safe_revert step."""
271
252
  # Not directly calling gclient, so don't use self().
272
253
  alias = self.spec_alias
@@ -10,17 +10,16 @@ from recipe_engine.config import ConfigList, Dict, Single, Static, Set, List
10
10
  from . import api as gclient_api
11
11
 
12
12
 
13
- def BaseConfig(USE_MIRROR=True, GIT_MODE=False, CACHE_DIR=None,
13
+ def BaseConfig(USE_MIRROR=True, CACHE_DIR=None,
14
14
  PATCH_PROJECT=None, BUILDSPEC_VERSION=None,
15
15
  **_kwargs):
16
- deps = '.DEPS.git' if GIT_MODE else 'DEPS'
17
16
  cache_dir = str(CACHE_DIR) if CACHE_DIR else None
18
17
  return ConfigGroup(
19
18
  solutions = ConfigList(
20
19
  lambda: ConfigGroup(
21
20
  name = Single(basestring),
22
21
  url = Single(basestring),
23
- deps_file = Single(basestring, empty_val=deps, required=False,
22
+ deps_file = Single(basestring, empty_val='.DEPS.git', required=False,
24
23
  hidden=False),
25
24
  managed = Single(bool, empty_val=True, required=False, hidden=False),
26
25
  custom_deps = Dict(value_type=(basestring, types.NoneType)),
@@ -86,7 +85,6 @@ def BaseConfig(USE_MIRROR=True, GIT_MODE=False, CACHE_DIR=None,
86
85
  required=False,
87
86
  hidden=True),
88
87
 
89
- GIT_MODE = Static(bool(GIT_MODE)),
90
88
  USE_MIRROR = Static(bool(USE_MIRROR)),
91
89
  # TODO(tandrii): remove PATCH_PROJECT field.
92
90
  # DON'T USE THIS. WILL BE REMOVED.
@@ -96,43 +94,18 @@ def BaseConfig(USE_MIRROR=True, GIT_MODE=False, CACHE_DIR=None,
96
94
 
97
95
  config_ctx = config_item_context(BaseConfig)
98
96
 
99
- def ChromiumSvnSubURL(c, *pieces):
100
- BASES = ('https://src.chromium.org',
101
- 'svn://svn-mirror.golo.chromium.org')
102
- return '/'.join((BASES[c.USE_MIRROR],) + pieces)
103
-
104
97
  def ChromiumGitURL(_c, *pieces):
105
98
  return '/'.join(('https://chromium.googlesource.com',) + pieces)
106
99
 
107
100
  def ChromiumSrcURL(c):
108
- # TODO(phajdan.jr): Move to proper repo and add coverage.
109
- if c.GIT_MODE: # pragma: no cover
110
- return ChromiumGitURL(c, 'chromium', 'src.git')
111
- else:
112
- return ChromiumSvnSubURL(c, 'chrome', 'trunk', 'src')
113
-
114
- def BlinkURL(c):
115
- # TODO(phajdan.jr): Move to proper repo and add coverage.
116
- if c.GIT_MODE: # pragma: no cover
117
- return ChromiumGitURL(c, 'chromium', 'blink.git')
118
- else:
119
- return ChromiumSvnSubURL(c, 'blink', 'trunk')
120
-
121
- def ChromeSvnSubURL(c, *pieces):
122
- BASES = ('svn://svn.chromium.org',
123
- 'svn://svn-mirror.golo.chromium.org')
124
- return '/'.join((BASES[c.USE_MIRROR],) + pieces)
101
+ return ChromiumGitURL(c, 'chromium', 'src.git')
125
102
 
126
103
  # TODO(phajdan.jr): Move to proper repo and add coverage.
127
104
  def ChromeInternalGitURL(_c, *pieces): # pragma: no cover
128
105
  return '/'.join(('https://chrome-internal.googlesource.com',) + pieces)
129
106
 
130
107
  def ChromeInternalSrcURL(c):
131
- # TODO(phajdan.jr): Move to proper repo and add coverage.
132
- if c.GIT_MODE: # pragma: no cover
133
- return ChromeInternalGitURL(c, 'chrome', 'src-internal.git')
134
- else:
135
- return ChromeSvnSubURL(c, 'chrome-internal', 'trunk', 'src-internal')
108
+ return ChromeInternalGitURL(c, 'chrome', 'src-internal.git')
136
109
 
137
110
  def mirror_only(c, obj, default=None):
138
111
  return obj if c.USE_MIRROR else (default or obj.__class__())
@@ -142,11 +115,7 @@ def chromium_bare(c):
142
115
  s = c.solutions.add()
143
116
  s.name = 'src'
144
117
  s.url = ChromiumSrcURL(c)
145
- s.custom_vars = mirror_only(c, {
146
- 'googlecode_url': 'svn://svn-mirror.golo.chromium.org/%s',
147
- 'nacl_trunk': 'svn://svn-mirror.golo.chromium.org/native_client/trunk',
148
- 'sourceforge_url': 'svn://svn-mirror.golo.chromium.org/%(repo)s',
149
- 'webkit_trunk': BlinkURL(c)})
118
+ s.custom_vars = {}
150
119
  m = c.got_revision_mapping
151
120
  m['src'] = 'got_revision'
152
121
  m['src/native_client'] = 'got_nacl_revision'
@@ -165,14 +134,15 @@ def chromium_bare(c):
165
134
  p['parent_got_webrtc_revision'] = 'webrtc_revision'
166
135
 
167
136
  p = c.patch_projects
168
- p['v8'] = ('src/v8', 'HEAD')
169
- p['buildtools'] = ('src/buildtools', 'HEAD')
170
137
  p['angle/angle'] = ('src/third_party/angle', None)
171
138
  p['blink'] = ('src/third_party/WebKit', None)
139
+ p['buildtools'] = ('src/buildtools', 'HEAD')
172
140
  p['catapult'] = ('src/third_party/catapult', 'HEAD')
141
+ p['flac'] = ('src/third_party/flac', 'HEAD')
142
+ p['icu'] = ('src/third_party/icu', 'HEAD')
173
143
  p['pdfium'] = ('src/third_party/pdfium', 'HEAD')
174
144
  p['skia'] = ('src/third_party/skia', 'HEAD')
175
- p['flac'] = ('src/third_party/flac', 'HEAD')
145
+ p['v8'] = ('src/v8', 'HEAD')
176
146
  p['webrtc'] = ('src/third_party/webrtc', 'HEAD')
177
147
 
178
148
  @config_ctx(includes=['chromium_bare'])
@@ -186,24 +156,12 @@ def chromium(c):
186
156
 
187
157
  @config_ctx(includes=['chromium'])
188
158
  def chromium_lkcr(c):
189
- # TODO(phajdan.jr): Add git hashes for LKCR crbug.com/349277.
190
- if c.GIT_MODE:
191
- raise BadConf('Git has problems with safesync_url and LKCR, '
192
- 'crbug.com/349277 crbug.com/109191') # pragma: no cover
193
159
  s = c.solutions[0]
194
- s.safesync_url = 'https://build.chromium.org/p/chromium/lkcr-status/lkgr'
195
- # TODO(hinoka): Once lkcr exists and is a tag, it should just be lkcr
196
- # rather than origin/lkcr.
197
160
  s.revision = 'origin/lkcr'
198
161
 
199
162
  @config_ctx(includes=['chromium'])
200
163
  def chromium_lkgr(c):
201
164
  s = c.solutions[0]
202
- safesync_url = 'https://chromium-status.appspot.com/lkgr'
203
- if c.GIT_MODE: # pragma: no cover
204
- safesync_url = 'https://chromium-status.appspot.com/git-lkgr'
205
- raise BadConf('Git has problems with safesync_url, crbug.com/109191.')
206
- s.safesync_url = safesync_url
207
165
  s.revision = 'origin/lkgr'
208
166
 
209
167
  @config_ctx(includes=['chromium_bare'])
@@ -286,46 +244,6 @@ def v8_bleeding_edge_git(c):
286
244
  def v8_canary(c):
287
245
  c.revisions['src/v8'] = 'origin/canary'
288
246
 
289
- @config_ctx(includes=['chromium'])
290
- def oilpan(c): # pragma: no cover
291
- if c.GIT_MODE:
292
- raise BadConf("Oilpan requires SVN for now")
293
- c.solutions[0].custom_vars = {
294
- 'webkit_trunk': ChromiumSvnSubURL(c, 'blink', 'branches', 'oilpan')
295
- }
296
- c.solutions[0].custom_vars['sourceforge_url'] = mirror_only(
297
- c,
298
- 'svn://svn-mirror.golo.chromium.org/%(repo)s',
299
- 'svn://svn.chromium.org/%(repo)s'
300
- )
301
-
302
- c.revisions['src/third_party/WebKit'] = 'HEAD'
303
- c.solutions[0].revision = '197341'
304
-
305
- c.solutions[0].custom_deps = {
306
- 'src/chrome/tools/test/reference_build/chrome_linux' :
307
- ChromiumSvnSubURL(c, 'blink', 'branches', 'oilpan', 'Tools',
308
- 'reference_build', 'chrome_linux')
309
- }
310
- del c.got_revision_mapping['src']
311
- c.got_revision_mapping['src/third_party/WebKit/Source'] = 'got_revision'
312
-
313
- @config_ctx(includes=['oilpan', 'chrome_internal'])
314
- def oilpan_internal(c): # pragma: no cover
315
- # Add back the oilpan data dependencies
316
- needed_components_internal = [
317
- "src/data/memory_test",
318
- "src/data/mozilla_js_tests",
319
- "src/data/page_cycler",
320
- "src/data/tab_switching",
321
- "src/webkit/data/bmp_decoder",
322
- "src/webkit/data/ico_decoder",
323
- "src/webkit/data/test_shell/plugins",
324
- "src/webkit/data/xbm_decoder",
325
- ]
326
- for key in needed_components_internal:
327
- del c.solutions[1].custom_deps[key]
328
-
329
247
  @config_ctx()
330
248
  def nacl(c):
331
249
  s = c.solutions.add()
@@ -360,49 +278,39 @@ def gyp(c):
360
278
  m = c.got_revision_mapping
361
279
  m['gyp'] = 'got_revision'
362
280
 
363
- @config_ctx(config_vars={'GIT_MODE': True})
364
- def build(c): # pragma: no cover
365
- if not c.GIT_MODE:
366
- raise BadConf('build only supports git')
281
+ @config_ctx()
282
+ def build(c):
367
283
  s = c.solutions.add()
368
284
  s.name = 'build'
369
285
  s.url = ChromiumGitURL(c, 'chromium', 'tools', 'build.git')
370
286
  m = c.got_revision_mapping
371
287
  m['build'] = 'got_revision'
372
288
 
373
- @config_ctx(config_vars={'GIT_MODE': True})
289
+ @config_ctx()
374
290
  def depot_tools(c): # pragma: no cover
375
- if not c.GIT_MODE:
376
- raise BadConf('depot_tools only supports git')
377
291
  s = c.solutions.add()
378
292
  s.name = 'depot_tools'
379
293
  s.url = ChromiumGitURL(c, 'chromium', 'tools', 'depot_tools.git')
380
294
  m = c.got_revision_mapping
381
295
  m['depot_tools'] = 'got_revision'
382
296
 
383
- @config_ctx(config_vars={'GIT_MODE': True})
297
+ @config_ctx()
384
298
  def skia(c): # pragma: no cover
385
- if not c.GIT_MODE:
386
- raise BadConf('skia only supports git')
387
299
  s = c.solutions.add()
388
300
  s.name = 'skia'
389
301
  s.url = 'https://skia.googlesource.com/skia.git'
390
302
  m = c.got_revision_mapping
391
303
  m['skia'] = 'got_revision'
392
304
 
393
- @config_ctx(config_vars={'GIT_MODE': True})
394
- def chrome_golo(c): # pragma: no cover
395
- if not c.GIT_MODE:
396
- raise BadConf('chrome_golo only supports git')
305
+ @config_ctx()
306
+ def chrome_golo(c): # pragma: no cover
397
307
  s = c.solutions.add()
398
308
  s.name = 'chrome_golo'
399
309
  s.url = 'https://chrome-internal.googlesource.com/chrome-golo/chrome-golo.git'
400
310
  c.got_revision_mapping['chrome_golo'] = 'got_revision'
401
311
 
402
- @config_ctx(config_vars={'GIT_MODE': True})
312
+ @config_ctx()
403
313
  def build_internal(c):
404
- if not c.GIT_MODE: # pragma: no cover
405
- raise BadConf('build_internal only supports git')
406
314
  s = c.solutions.add()
407
315
  s.name = 'build_internal'
408
316
  s.url = 'https://chrome-internal.googlesource.com/chrome/tools/build.git'
@@ -413,10 +321,8 @@ def build_internal(c):
413
321
  build(c)
414
322
  c.got_revision_mapping['build'] = 'got_build_revision'
415
323
 
416
- @config_ctx(config_vars={'GIT_MODE': True})
324
+ @config_ctx()
417
325
  def build_internal_scripts_slave(c):
418
- if not c.GIT_MODE: # pragma: no cover
419
- raise BadConf('build_internal_scripts_slave only supports git')
420
326
  s = c.solutions.add()
421
327
  s.name = 'build_internal/scripts/slave'
422
328
  s.url = ('https://chrome-internal.googlesource.com/'
@@ -455,7 +361,6 @@ def internal_deps(c):
455
361
  @config_ctx(includes=['chromium', 'chrome_internal'])
456
362
  def perf(c):
457
363
  s = c.solutions[0]
458
- s.custom_vars['llvm_url'] = 'svn://svn-mirror.golo.chromium.org/llvm-project'
459
364
  s.managed = False
460
365
  needed_components_internal = [
461
366
  "src/data/page_cycler",
@@ -547,7 +452,7 @@ def dart(c):
547
452
  soln.deps_file = 'DEPS'
548
453
  soln.managed = False
549
454
 
550
- @config_ctx(config_vars={'GIT_MODE': True})
455
+ @config_ctx()
551
456
  def infra(c):
552
457
  soln = c.solutions.add()
553
458
  soln.name = 'infra'
@@ -560,7 +465,7 @@ def infra(c):
560
465
  p['recipes-py'] = ('infra/recipes-py', 'HEAD')
561
466
  p['recipe_engine'] = ('infra/recipes-py', 'HEAD')
562
467
 
563
- @config_ctx(config_vars={'GIT_MODE': True})
468
+ @config_ctx()
564
469
  def infra_internal(c): # pragma: no cover
565
470
  soln = c.solutions.add()
566
471
  soln.name = 'infra_internal'
@@ -611,7 +516,7 @@ def recipes_py(c):
611
516
  del m['infra']
612
517
  m['infra/recipes-py'] = 'got_revision'
613
518
 
614
- @config_ctx(config_vars={'GIT_MODE': True})
519
+ @config_ctx()
615
520
  def recipes_py_bare(c):
616
521
  soln = c.solutions.add()
617
522
  soln.name = 'recipes-py'
@@ -619,17 +524,6 @@ def recipes_py_bare(c):
619
524
  'luci/recipes-py')
620
525
  c.got_revision_mapping['recipes-py'] = 'got_revision'
621
526
 
622
- @config_ctx()
623
- def chrome_from_buildspec(c): # pragma: no cover
624
- soln = c.solutions.add()
625
- soln.name = 'chrome_from_buildspec'
626
- # This URL has to be augmented with the appropriate bucket by the recipe using
627
- # it.
628
- soln.url = ('svn://svn-mirror.golo.chromium.org/chrome-internal/trunk/tools/'
629
- 'buildspec/build/')
630
- soln.custom_vars['svn_url'] = 'svn://svn-mirror.golo.chromium.org'
631
- soln.custom_deps = {}
632
-
633
527
  @config_ctx()
634
528
  def catapult(c):
635
529
  soln = c.solutions.add()
@@ -638,7 +532,7 @@ def catapult(c):
638
532
  'catapult-project/catapult.git')
639
533
  c.got_revision_mapping['catapult'] = 'got_revision'
640
534
 
641
- @config_ctx(includes=['infra_internal'], config_vars={'GIT_MODE': True})
535
+ @config_ctx(includes=['infra_internal'])
642
536
  def infradata_master_manager(c):
643
537
  soln = c.solutions.add()
644
538
  soln.name = 'infra-data-master-manager'
@@ -688,4 +582,4 @@ def chromedriver(c):
688
582
  """Add Selenium Java tests to the gclient solution."""
689
583
  c.solutions[0].custom_deps[
690
584
  'src/chrome/test/chromedriver/third_party/java_tests'] = (
691
- ChromiumGitURL(c, 'chromium', 'deps', 'webdriver'))
585
+ ChromiumGitURL(c, 'chromium', 'deps', 'webdriver'))