libv8 7.3.492.27.1 → 7.3.492.27.3beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/ext/libv8/builder.rb +1 -2
- data/lib/libv8/version.rb +1 -1
- data/vendor/depot_tools/.gitignore +4 -1
- data/vendor/depot_tools/autoninja.bat +8 -0
- data/vendor/depot_tools/autoninja.py +1 -1
- data/vendor/depot_tools/cipd_manifest.txt +2 -2
- data/vendor/depot_tools/cipd_manifest.versions +52 -52
- data/vendor/depot_tools/gclient.py +4 -1
- data/vendor/depot_tools/gclient_scm.py +17 -6
- data/vendor/depot_tools/git_cache.py +109 -128
- data/vendor/depot_tools/git_cl.py +98 -26
- data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
- data/vendor/depot_tools/man/src/filter_demo_output.py +1 -1
- data/vendor/depot_tools/metrics.README.md +3 -3
- data/vendor/depot_tools/metrics.py +3 -2
- data/vendor/depot_tools/metrics_utils.py +1 -11
- data/vendor/depot_tools/owners.py +109 -32
- data/vendor/depot_tools/patch.py +1 -1
- data/vendor/depot_tools/recipes/README.recipes.md +23 -20
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +67 -51
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/clobber.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_rebase_patch_ref.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_reset.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/input_commit_with_id_without_repo.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/multiple_patch_refs.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json +8 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_HEAD.json +57 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_branch_head.json +59 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit.json +57 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_master.json +59 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/refs.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/reset_root_solution_revision.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +9 -2
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +8 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json +8 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json +8 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json +11 -2
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json +9 -2
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json +8 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +8 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +8 -1
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name.json +0 -7
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_tags.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +92 -3
- data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +2 -2
- data/vendor/depot_tools/scm.py +1 -1
- data/vendor/depot_tools/upload_to_google_storage.py +1 -1
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5321dc353de2410898c5ac90db9b9a56cdd0f07b0fe29477679717159b3ccbb8
|
4
|
+
data.tar.gz: 7893a2e6e871e59cf156828f6825fa24ba0634ac93bdf44f0835b1104b5d695e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4beb86a19489d3066056a91870da1b01d0137208158a371f4397cd7ba0b84c1c916c9efefc333c4f7c5a0f9e22314da25c16ffe16fc25df05f262490dd14993d
|
7
|
+
data.tar.gz: 0025be7136ef59e550b8e529937b3c7793933732d8314be414ec093092b2c599c5ee2abbdf1cd1c6e3c0286ffb0ab33d2d96c77aa6bab8a0deb021e6f22f1762
|
data/CHANGELOG.md
CHANGED
data/ext/libv8/builder.rb
CHANGED
@@ -23,8 +23,7 @@ module Libv8
|
|
23
23
|
v8_use_external_startup_data=false
|
24
24
|
target_cpu="#{libv8_arch}"
|
25
25
|
v8_target_cpu="#{libv8_arch}"
|
26
|
-
treat_warnings_as_errors=false
|
27
|
-
v8_enable_i18n_support=false).join(' ')
|
26
|
+
treat_warnings_as_errors=false).join(' ')
|
28
27
|
end
|
29
28
|
|
30
29
|
def generate_gn_args
|
data/lib/libv8/version.rb
CHANGED
@@ -3,9 +3,17 @@
|
|
3
3
|
:: Use of this source code is governed by a BSD-style license that can be
|
4
4
|
:: found in the LICENSE file.
|
5
5
|
|
6
|
+
setlocal
|
7
|
+
|
6
8
|
REM Set unique build ID.
|
7
9
|
FOR /f "usebackq tokens=*" %%a in (`python -c "import uuid; print uuid.uuid4()"`) do set AUTONINJA_BUILD_ID=%%a
|
8
10
|
|
11
|
+
REM If a build performance summary has been requested then also set NINJA_STATUS
|
12
|
+
REM to trigger more verbose status updates. In particular this makes it possible
|
13
|
+
REM to see how quickly process creation is happening - often a critical clue on
|
14
|
+
REM Windows. The trailing space is intentional.
|
15
|
+
if "%NINJA_SUMMARIZE_BUILD%" == "1" set NINJA_STATUS=[%%r processes, %%f/%%t @ %%o/s : %%es ]
|
16
|
+
|
9
17
|
REM Execute whatever is printed by autoninja.py.
|
10
18
|
REM Also print it to reassure that the right settings are being used.
|
11
19
|
FOR /f "usebackq tokens=*" %%a in (`python %~dp0autoninja.py "%*"`) do echo %%a & %%a
|
@@ -60,7 +60,7 @@ try:
|
|
60
60
|
with open(os.path.join(output_dir, 'args.gn')) as file_handle:
|
61
61
|
for line in file_handle:
|
62
62
|
# This regex pattern copied from create_installer_archive.py
|
63
|
-
m = re.match('^\s*use_goma\s*=\s*true(\s*$|\s*#.*$)', line)
|
63
|
+
m = re.match(r'^\s*use_goma\s*=\s*true(\s*$|\s*#.*$)', line)
|
64
64
|
if m:
|
65
65
|
use_goma = True
|
66
66
|
except IOError:
|
@@ -22,10 +22,10 @@ $VerifiedPlatform linux-mips64 linux-mips64le linux-mipsle
|
|
22
22
|
infra/tools/luci/vpython/${platform} git_revision:0bff6ebf817352838b0e6f65fd6460b38c505c9c
|
23
23
|
|
24
24
|
# LUCI editor
|
25
|
-
infra/tools/luci/led/${platform} git_revision:
|
25
|
+
infra/tools/luci/led/${platform} git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
26
26
|
|
27
27
|
# LUCI config generator
|
28
|
-
infra/tools/luci/lucicfg/${platform} git_revision:
|
28
|
+
infra/tools/luci/lucicfg/${platform} git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
29
29
|
|
30
30
|
# Mac toolchain installer
|
31
31
|
infra/tools/mac_toolchain/${os=mac}-${arch} git_revision:edd5644be66d37cdf82978efb0e5d6504d0d552f
|
@@ -106,108 +106,108 @@ infra/tools/luci-auth/windows-amd64
|
|
106
106
|
GBs8p3OBQPPVvztd0oS5qFhvEy5JVvPZFnbod0DZ-FAC
|
107
107
|
|
108
108
|
infra/tools/luci/led/linux-386
|
109
|
-
git_revision:
|
110
|
-
|
109
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
110
|
+
f65Ck-56x8iB11aHOos87RPvnGb8lBCu50osiuvAGP4C
|
111
111
|
|
112
112
|
infra/tools/luci/led/linux-amd64
|
113
|
-
git_revision:
|
114
|
-
|
113
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
114
|
+
tuF6k0Pgjv8ko9_v3T_hq9tFRtDI9eGKoRnAIvIY2aIC
|
115
115
|
|
116
116
|
infra/tools/luci/led/linux-arm64
|
117
|
-
git_revision:
|
118
|
-
|
117
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
118
|
+
m5ywbTNqVtvJVZ55jAcOPo2BkPdlPvZcErIYO6YFiqgC
|
119
119
|
|
120
120
|
infra/tools/luci/led/linux-armv6l
|
121
|
-
git_revision:
|
122
|
-
|
121
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
122
|
+
SpQmAAVXem9w9WcWHtfjysdHL4Siu-D6VMCOL1n78wwC
|
123
123
|
|
124
124
|
infra/tools/luci/led/linux-mips64
|
125
|
-
git_revision:
|
126
|
-
|
125
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
126
|
+
zh_JUvzlUX4KEgRsWTe821QE4sBg9RmPdrQvsnwnGHwC
|
127
127
|
|
128
128
|
infra/tools/luci/led/linux-mips64le
|
129
|
-
git_revision:
|
130
|
-
|
129
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
130
|
+
In3IWJ0mtOmF6FSA4LSQky_W1pcy1sToc_nSYMRK-vAC
|
131
131
|
|
132
132
|
infra/tools/luci/led/linux-mipsle
|
133
|
-
git_revision:
|
134
|
-
|
133
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
134
|
+
kRFA9I-L-NnF7X1OsqDWnr2lkOuzgfuRKTY4OP138VUC
|
135
135
|
|
136
136
|
infra/tools/luci/led/linux-ppc64
|
137
|
-
git_revision:
|
138
|
-
|
137
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
138
|
+
tizc_x9nS4mPurDy435pqD7hZI18YxN0WWeEIjqzbY8C
|
139
139
|
|
140
140
|
infra/tools/luci/led/linux-ppc64le
|
141
|
-
git_revision:
|
142
|
-
|
141
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
142
|
+
LXH0gMErZY7zzVZVS9QB_C1TPUpmzxm4JkrYtNWznhMC
|
143
143
|
|
144
144
|
infra/tools/luci/led/linux-s390x
|
145
|
-
git_revision:
|
146
|
-
|
145
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
146
|
+
srzPKRFkTHYC-_U-IOnwub8MlgwW0T4KqxJuUZ8-tbIC
|
147
147
|
|
148
148
|
infra/tools/luci/led/mac-amd64
|
149
|
-
git_revision:
|
150
|
-
|
149
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
150
|
+
FqWvQqAPxJBKARcF-afsNyJTlmNsvO0q_0EyBlilAZUC
|
151
151
|
|
152
152
|
infra/tools/luci/led/windows-386
|
153
|
-
git_revision:
|
154
|
-
|
153
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
154
|
+
apfJayXPEbugi7-gIWUH_F9BsYU30MjlDxHnikvxV6kC
|
155
155
|
|
156
156
|
infra/tools/luci/led/windows-amd64
|
157
|
-
git_revision:
|
158
|
-
|
157
|
+
git_revision:201038605be27025b386bfa5e7c9b4945aa6027d
|
158
|
+
cbmSVvGk8oz4_2tLG-j3JOsJ89ZWfJW_tMURj4GSQGgC
|
159
159
|
|
160
160
|
infra/tools/luci/lucicfg/linux-386
|
161
|
-
git_revision:
|
162
|
-
|
161
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
162
|
+
oKHGrFGwV6d8u7cZlNn0pxLt8S6WGfdaDxeec7xtHnUC
|
163
163
|
|
164
164
|
infra/tools/luci/lucicfg/linux-amd64
|
165
|
-
git_revision:
|
166
|
-
|
165
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
166
|
+
ElPoPGvTKN2_SqCk1xQz_8a27V-BdFQ3vCIWr-WPbpYC
|
167
167
|
|
168
168
|
infra/tools/luci/lucicfg/linux-arm64
|
169
|
-
git_revision:
|
170
|
-
|
169
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
170
|
+
s9djXyOsGamo8iSBK0xnRfkgiQvXkpKi2fUKoDMjFs4C
|
171
171
|
|
172
172
|
infra/tools/luci/lucicfg/linux-armv6l
|
173
|
-
git_revision:
|
174
|
-
|
173
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
174
|
+
SM5jr0ti1apt7NvZuC-nShMkFdxImG5QOZu2_oTojlgC
|
175
175
|
|
176
176
|
infra/tools/luci/lucicfg/linux-mips64
|
177
|
-
git_revision:
|
178
|
-
|
177
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
178
|
+
1v1wY1kcotYt6PiNRCVv7XRGVmExcal4BIyYLdEphucC
|
179
179
|
|
180
180
|
infra/tools/luci/lucicfg/linux-mips64le
|
181
|
-
git_revision:
|
182
|
-
|
181
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
182
|
+
JRxI8uGklbokPTFKnLXDg7SkP7wIeBtk2fpgKMKXfIYC
|
183
183
|
|
184
184
|
infra/tools/luci/lucicfg/linux-mipsle
|
185
|
-
git_revision:
|
186
|
-
|
185
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
186
|
+
sNRitF-m4rPbAp7Qc1zCsKXlQ-w_mwWdpoSC5Lfj8SQC
|
187
187
|
|
188
188
|
infra/tools/luci/lucicfg/linux-ppc64
|
189
|
-
git_revision:
|
190
|
-
|
189
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
190
|
+
oW72rSZzoVtNy6tKT68QJpnRTQXZIAZ9FYgWkWQdxVEC
|
191
191
|
|
192
192
|
infra/tools/luci/lucicfg/linux-ppc64le
|
193
|
-
git_revision:
|
194
|
-
|
193
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
194
|
+
EWYwgpUcB38JJsONXAluKK1PNRwbdn1InprRgiIURcUC
|
195
195
|
|
196
196
|
infra/tools/luci/lucicfg/linux-s390x
|
197
|
-
git_revision:
|
198
|
-
|
197
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
198
|
+
177EmZFtynwRGm6ym5dOIfrXAT_aJNLbn6GF3hdchYwC
|
199
199
|
|
200
200
|
infra/tools/luci/lucicfg/mac-amd64
|
201
|
-
git_revision:
|
202
|
-
|
201
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
202
|
+
4S8vkAdhJeKzYv0qKMYXL13eiFICS80bTL7DbhTWSgsC
|
203
203
|
|
204
204
|
infra/tools/luci/lucicfg/windows-386
|
205
|
-
git_revision:
|
206
|
-
|
205
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
206
|
+
e8HjDgXAimjOzOejNtRm0Ni8qCJKUIkTTmBmzCBJWNsC
|
207
207
|
|
208
208
|
infra/tools/luci/lucicfg/windows-amd64
|
209
|
-
git_revision:
|
210
|
-
|
209
|
+
git_revision:1399f5bdee4cf1c0826b64cf103418b1b9e7c15b
|
210
|
+
B-6hDi0Z_r1xBDh9uBaIJlwbRZMNDrfRQFUyaU8ps5oC
|
211
211
|
|
212
212
|
infra/tools/luci/vpython/linux-386
|
213
213
|
git_revision:0bff6ebf817352838b0e6f65fd6460b38c505c9c
|
@@ -125,6 +125,8 @@ except NameError:
|
|
125
125
|
basestring = str
|
126
126
|
|
127
127
|
|
128
|
+
DEPOT_TOOLS_DIR = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
|
129
|
+
|
128
130
|
# Singleton object to represent an unset cache_dir (as opposed to a disabled
|
129
131
|
# one, e.g. if a spec explicitly says `cache_dir = None`.)
|
130
132
|
UNSET_CACHE_DIR = object()
|
@@ -3100,7 +3102,8 @@ def disable_buffering():
|
|
3100
3102
|
|
3101
3103
|
def path_contains_tilde():
|
3102
3104
|
for element in os.environ['PATH'].split(os.pathsep):
|
3103
|
-
if element.startswith('
|
3105
|
+
if element.startswith('~') and os.path.abspath(
|
3106
|
+
os.path.realpath(os.path.expanduser(element))) == DEPOT_TOOLS_DIR:
|
3104
3107
|
return True
|
3105
3108
|
return False
|
3106
3109
|
|
@@ -370,11 +370,7 @@ class GitWrapper(SCMWrapper):
|
|
370
370
|
return ref
|
371
371
|
self.Print('Failed to find a remote ref that contains %s. '
|
372
372
|
'Candidate refs were %s.' % (commit, remote_refs))
|
373
|
-
|
374
|
-
# This means that apply_path_ref will try to find the merge-base between the
|
375
|
-
# patch and the commit (which is most likely the commit) and cherry-pick
|
376
|
-
# everything in between.
|
377
|
-
return commit
|
373
|
+
return None
|
378
374
|
|
379
375
|
def apply_patch_ref(self, patch_repo, patch_ref, target_branch, options,
|
380
376
|
file_list):
|
@@ -419,7 +415,22 @@ class GitWrapper(SCMWrapper):
|
|
419
415
|
pass
|
420
416
|
|
421
417
|
base_rev = self._Capture(['rev-parse', 'HEAD'])
|
422
|
-
|
418
|
+
|
419
|
+
if target_branch:
|
420
|
+
# Convert the target branch to a remote ref if possible.
|
421
|
+
remote_ref = scm.GIT.RefToRemoteRef(target_branch, self.remote)
|
422
|
+
if remote_ref:
|
423
|
+
target_branch = ''.join(remote_ref)
|
424
|
+
else:
|
425
|
+
target_branch = self._GetTargetBranchForCommit(base_rev)
|
426
|
+
|
427
|
+
# Fallback to the commit we got.
|
428
|
+
# This means that apply_path_ref will try to find the merge-base between the
|
429
|
+
# patch and the commit (which is most likely the commit) and cherry-pick
|
430
|
+
# everything in between.
|
431
|
+
if not target_branch:
|
432
|
+
target_branch = base_rev
|
433
|
+
|
423
434
|
self.Print('===Applying patch ref===')
|
424
435
|
self.Print('Patch ref is %r @ %r. Target branch for patch is %r. '
|
425
436
|
'Current HEAD is %r. Current dir is %r' % (
|
@@ -13,11 +13,11 @@ import logging
|
|
13
13
|
import optparse
|
14
14
|
import os
|
15
15
|
import re
|
16
|
+
import subprocess
|
17
|
+
import sys
|
16
18
|
import tempfile
|
17
19
|
import threading
|
18
20
|
import time
|
19
|
-
import subprocess
|
20
|
-
import sys
|
21
21
|
|
22
22
|
try:
|
23
23
|
import urlparse
|
@@ -258,6 +258,10 @@ class Mirror(object):
|
|
258
258
|
# Not recognized.
|
259
259
|
return None
|
260
260
|
|
261
|
+
@property
|
262
|
+
def _gs_path(self):
|
263
|
+
return 'gs://%s/v2/%s' % (self.bootstrap_bucket, self.basedir)
|
264
|
+
|
261
265
|
@classmethod
|
262
266
|
def FromPath(cls, path):
|
263
267
|
return cls(cls.CacheDirToUrl(path))
|
@@ -372,87 +376,54 @@ class Mirror(object):
|
|
372
376
|
"""
|
373
377
|
if not self.bootstrap_bucket:
|
374
378
|
return False
|
375
|
-
|
376
|
-
(sys.platform.startswith('win') and
|
377
|
-
not gclient_utils.FindExecutable('7z')) or
|
378
|
-
(not gclient_utils.FindExecutable('unzip')) or
|
379
|
-
('ZIP64_SUPPORT' not in subprocess.check_output(["unzip", "-v"]))
|
380
|
-
)
|
381
|
-
|
382
|
-
gs_folder = 'gs://%s/%s' % (self.bootstrap_bucket, self.basedir)
|
379
|
+
|
383
380
|
gsutil = Gsutil(self.gsutil_exe, boto_path=None)
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
#
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
381
|
+
|
382
|
+
# Get the most recent version of the directory.
|
383
|
+
# This is determined from the most recent version of a .ready file.
|
384
|
+
# The .ready file is only uploaded when an entire directory has been
|
385
|
+
# uploaded to GS.
|
386
|
+
_, ls_out, ls_err = gsutil.check_call('ls', self._gs_path)
|
387
|
+
|
388
|
+
ready_file_pattern = re.compile(r'.*/(\d+).ready$')
|
389
|
+
|
390
|
+
objects = set(ls_out.strip().splitlines())
|
391
|
+
ready_dirs = []
|
392
|
+
|
393
|
+
for name in objects:
|
394
|
+
m = ready_file_pattern.match(name)
|
395
|
+
# Given <path>/<number>.ready,
|
396
|
+
# we are interested in <path>/<number> directory
|
397
|
+
|
398
|
+
if m and (name[:-len('.ready')] + '/') in objects:
|
399
|
+
ready_dirs.append((int(m.group(1)), name[:-len('.ready')]))
|
400
|
+
|
401
|
+
if not ready_dirs:
|
405
402
|
self.print('No bootstrap file for %s found in %s, stderr:\n %s' %
|
406
403
|
(self.mirror_path, self.bootstrap_bucket,
|
407
|
-
|
404
|
+
' '.join((ls_err or '').splitlines(True))))
|
408
405
|
return False
|
409
|
-
|
406
|
+
latest_dir = max(ready_dirs)[1]
|
410
407
|
|
411
|
-
# Download zip file to a temporary directory.
|
412
408
|
try:
|
409
|
+
# create new temporary directory locally
|
413
410
|
tempdir = tempfile.mkdtemp(prefix='_cache_tmp', dir=self.GetCachePath())
|
414
|
-
self.
|
411
|
+
self.RunGit(['init', '--bare'], cwd=tempdir)
|
412
|
+
self.print('Downloading files in %s/* into %s.' %
|
413
|
+
(latest_dir, tempdir))
|
415
414
|
with self.print_duration_of('download'):
|
416
|
-
code = gsutil.call('cp',
|
415
|
+
code = gsutil.call('-m', 'cp', '-r', latest_dir + "/*",
|
416
|
+
tempdir)
|
417
417
|
if code:
|
418
418
|
return False
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
with self.print_duration_of('unzip'):
|
423
|
-
if not python_fallback:
|
424
|
-
if sys.platform.startswith('win'):
|
425
|
-
cmd = ['7z', 'x', '-o%s' % directory, '-tzip', filename]
|
426
|
-
else:
|
427
|
-
cmd = ['unzip', filename, '-d', directory]
|
428
|
-
retcode = subprocess.call(cmd)
|
429
|
-
else:
|
430
|
-
try:
|
431
|
-
with zipfile.ZipFile(filename, 'r') as f:
|
432
|
-
f.printdir()
|
433
|
-
f.extractall(directory)
|
434
|
-
except Exception as e:
|
435
|
-
self.print('Encountered error: %s' % str(e), file=sys.stderr)
|
436
|
-
retcode = 1
|
437
|
-
else:
|
438
|
-
retcode = 0
|
439
|
-
finally:
|
440
|
-
# Clean up the downloaded zipfile.
|
441
|
-
#
|
442
|
-
# This is somehow racy on Windows.
|
443
|
-
# Catching OSError because WindowsError isn't portable and
|
444
|
-
# pylint complains.
|
445
|
-
exponential_backoff_retry(
|
446
|
-
lambda: gclient_utils.rm_file_or_tree(tempdir),
|
447
|
-
excs=(OSError,),
|
448
|
-
name='rmtree [%s]' % (tempdir,),
|
449
|
-
printerr=self.print)
|
450
|
-
|
451
|
-
if retcode:
|
452
|
-
self.print(
|
453
|
-
'Extracting bootstrap zipfile %s failed.\n'
|
454
|
-
'Resuming normal operations.' % filename)
|
419
|
+
except Exception as e:
|
420
|
+
self.print('Encountered error: %s' % str(e), file=sys.stderr)
|
421
|
+
gclient_utils.rmtree(tempdir)
|
455
422
|
return False
|
423
|
+
# delete the old directory
|
424
|
+
if os.path.exists(directory):
|
425
|
+
gclient_utils.rmtree(directory)
|
426
|
+
self.Rename(tempdir, directory)
|
456
427
|
return True
|
457
428
|
|
458
429
|
def contains_revision(self, revision):
|
@@ -503,47 +474,50 @@ class Mirror(object):
|
|
503
474
|
% os.path.join(self.mirror_path, 'config'))
|
504
475
|
|
505
476
|
def _ensure_bootstrapped(self, depth, bootstrap, force=False):
|
506
|
-
tempdir = None
|
507
477
|
pack_dir = os.path.join(self.mirror_path, 'objects', 'pack')
|
508
478
|
pack_files = []
|
509
|
-
|
510
479
|
if os.path.isdir(pack_dir):
|
511
480
|
pack_files = [f for f in os.listdir(pack_dir) if f.endswith('.pack')]
|
512
481
|
self.print('%s has %d .pack files, re-bootstrapping if >%d' %
|
513
|
-
|
482
|
+
(self.mirror_path, len(pack_files), GC_AUTOPACKLIMIT))
|
514
483
|
|
515
484
|
should_bootstrap = (force or
|
516
485
|
not self.exists() or
|
517
486
|
len(pack_files) > GC_AUTOPACKLIMIT)
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
487
|
+
|
488
|
+
if not should_bootstrap:
|
489
|
+
if depth and os.path.exists(os.path.join(self.mirror_path, 'shallow')):
|
490
|
+
logging.warn(
|
491
|
+
'Shallow fetch requested, but repo cache already exists.')
|
492
|
+
return
|
493
|
+
|
494
|
+
if self.exists():
|
495
|
+
# Re-bootstrapping an existing mirror; preserve existing fetch spec.
|
496
|
+
self._preserve_fetchspec()
|
497
|
+
else:
|
498
|
+
if os.path.exists(self.mirror_path):
|
499
|
+
# If the mirror path exists but self.exists() returns false, we're
|
500
|
+
# in an unexpected state. Nuke the previous mirror directory and
|
501
|
+
# start fresh.
|
527
502
|
gclient_utils.rmtree(self.mirror_path)
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
503
|
+
os.mkdir(self.mirror_path)
|
504
|
+
|
505
|
+
bootstrapped = (not depth and bootstrap and
|
506
|
+
self.bootstrap_repo(self.mirror_path))
|
507
|
+
|
508
|
+
if not bootstrapped:
|
509
|
+
if not self.exists() or not self.supported_project():
|
510
|
+
# Bootstrap failed due to:
|
511
|
+
# 1. No previous cache.
|
512
|
+
# 2. Project doesn't have a bootstrap folder.
|
532
513
|
# Start with a bare git dir.
|
533
|
-
self.RunGit(['init', '--bare'], cwd=
|
514
|
+
self.RunGit(['init', '--bare'], cwd=self.mirror_path)
|
534
515
|
else:
|
535
516
|
# Bootstrap failed, previous cache exists; warn and continue.
|
536
517
|
logging.warn(
|
537
518
|
'Git cache has a lot of pack files (%d). Tried to re-bootstrap '
|
538
519
|
'but failed. Continuing with non-optimized repository.'
|
539
520
|
% len(pack_files))
|
540
|
-
gclient_utils.rmtree(tempdir)
|
541
|
-
tempdir = None
|
542
|
-
else:
|
543
|
-
if depth and os.path.exists(os.path.join(self.mirror_path, 'shallow')):
|
544
|
-
logging.warn(
|
545
|
-
'Shallow fetch requested, but repo cache already exists.')
|
546
|
-
return tempdir
|
547
521
|
|
548
522
|
def _fetch(self, rundir, verbose, depth, reset_fetch_config):
|
549
523
|
self.config(rundir, reset_fetch_config)
|
@@ -579,49 +553,57 @@ class Mirror(object):
|
|
579
553
|
if not ignore_lock:
|
580
554
|
lockfile.lock()
|
581
555
|
|
582
|
-
tempdir = None
|
583
556
|
try:
|
584
|
-
|
585
|
-
|
586
|
-
self._fetch(rundir, verbose, depth, reset_fetch_config)
|
557
|
+
self._ensure_bootstrapped(depth, bootstrap)
|
558
|
+
self._fetch(self.mirror_path, verbose, depth, reset_fetch_config)
|
587
559
|
except ClobberNeeded:
|
588
560
|
# This is a major failure, we need to clean and force a bootstrap.
|
589
|
-
gclient_utils.rmtree(
|
561
|
+
gclient_utils.rmtree(self.mirror_path)
|
590
562
|
self.print(GIT_CACHE_CORRUPT_MESSAGE)
|
591
|
-
|
592
|
-
|
593
|
-
self._fetch(tempdir, verbose, depth, reset_fetch_config)
|
563
|
+
self._ensure_bootstrapped(depth, bootstrap, force=True)
|
564
|
+
self._fetch(self.mirror_path, verbose, depth, reset_fetch_config)
|
594
565
|
finally:
|
595
|
-
if tempdir:
|
596
|
-
if os.path.exists(self.mirror_path):
|
597
|
-
gclient_utils.rmtree(self.mirror_path)
|
598
|
-
self.Rename(tempdir, self.mirror_path)
|
599
566
|
if not ignore_lock:
|
600
567
|
lockfile.unlock()
|
601
568
|
|
602
569
|
def update_bootstrap(self, prune=False):
|
603
|
-
# The
|
570
|
+
# The folder is <git number>
|
604
571
|
gen_number = subprocess.check_output(
|
605
572
|
[self.git_exe, 'number', 'master'], cwd=self.mirror_path).strip()
|
573
|
+
gsutil = Gsutil(path=self.gsutil_exe, boto_path=None)
|
574
|
+
|
575
|
+
src_name = self.mirror_path
|
576
|
+
dest_name = '%s/%s' % (self._gs_path, gen_number)
|
577
|
+
|
578
|
+
# check to see if folder already exists in gs
|
579
|
+
_, ls_out, ls_err = gsutil.check_call('ls', dest_name)
|
580
|
+
_, ls_out_ready, ls_err_ready = (
|
581
|
+
gsutil.check_call('ls', dest_name + '.ready'))
|
582
|
+
|
583
|
+
# only printing out errors because the folder/ready file
|
584
|
+
# might not exist yet, so it will error no matter what
|
585
|
+
if ls_err:
|
586
|
+
print('Failed to check GS:\n%s' % (ls_err))
|
587
|
+
if ls_err_ready:
|
588
|
+
print('Failed to check GS:\n%s' % (ls_err_ready))
|
589
|
+
|
590
|
+
if not (ls_out == '' and ls_out_ready == ''):
|
591
|
+
print('Cache %s already exists' % dest_name)
|
592
|
+
return
|
593
|
+
|
606
594
|
# Run Garbage Collect to compress packfile.
|
607
595
|
self.RunGit(['gc', '--prune=all'])
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
if prune:
|
620
|
-
_, ls_out, _ = gsutil.check_call('ls', gs_folder)
|
621
|
-
for filename in ls_out.splitlines():
|
622
|
-
if filename == dest_name:
|
623
|
-
continue
|
624
|
-
gsutil.call('rm', filename)
|
596
|
+
|
597
|
+
gsutil.call('-m', 'cp', '-r', src_name, dest_name)
|
598
|
+
|
599
|
+
#TODO(karenqian): prune old caches
|
600
|
+
|
601
|
+
# create .ready file and upload
|
602
|
+
_, ready_file_name = tempfile.mkstemp(suffix='.ready')
|
603
|
+
try:
|
604
|
+
gsutil.call('cp', ready_file_name, '%s.ready' % (dest_name))
|
605
|
+
finally:
|
606
|
+
os.remove(ready_file_name)
|
625
607
|
|
626
608
|
@staticmethod
|
627
609
|
def DeleteTmpPackFiles(path):
|
@@ -701,11 +683,10 @@ def CMDupdate_bootstrap(parser, args):
|
|
701
683
|
return 1
|
702
684
|
|
703
685
|
parser.add_option('--prune', action='store_true',
|
704
|
-
help='Prune all other cached
|
686
|
+
help='Prune all other cached bundles of the same repo.')
|
705
687
|
|
706
688
|
# First, we need to ensure the cache is populated.
|
707
689
|
populate_args = args[:]
|
708
|
-
populate_args.append('--no-bootstrap')
|
709
690
|
CMDpopulate(parser, populate_args)
|
710
691
|
|
711
692
|
# Get the repo directory.
|