aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2021-10-26 16:27:56 -0400
committerAdam Langley <agl@google.com>2021-10-27 17:04:35 +0000
commit17c38b39eea2db29a4d09070cd399132a0dee23f (patch)
treeba1a4b256073ea9654ddc8124d0ec6da3a582849
parent69030a0ceabfe69c58cb2b83d9d4852333e3d0c2 (diff)
downloadboringssl-17c38b39eea2db29a4d09070cd399132a0dee23f.zip
boringssl-17c38b39eea2db29a4d09070cd399132a0dee23f.tar.gz
boringssl-17c38b39eea2db29a4d09070cd399132a0dee23f.tar.bz2
Switch DEPS actions on bots to Python 3.
In doing so, I think this fixes a bug on Windows where extract.py was digesting the archive in text mode. (Doesn't particularly matter, though by using the correct digest, we will end up re-extracting the files once.) Change-Id: Ia7effe5f9c228c1a702cba8e6380975b59261808 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/50166 Reviewed-by: Adam Langley <agl@google.com>
-rw-r--r--util/bot/DEPS12
-rw-r--r--util/bot/extract.py12
2 files changed, 12 insertions, 12 deletions
diff --git a/util/bot/DEPS b/util/bot/DEPS
index bad720f..46f484f 100644
--- a/util/bot/DEPS
+++ b/util/bot/DEPS
@@ -127,7 +127,7 @@ hooks = [
'name': 'cmake_win32_extract',
'pattern': '.',
'condition': 'host_os == "win"',
- 'action': [ 'python',
+ 'action': [ 'python3',
'boringssl/util/bot/extract.py',
'boringssl/util/bot/cmake-win32.zip',
'boringssl/util/bot/cmake-win32/',
@@ -149,7 +149,7 @@ hooks = [
'name': 'perl_win32_extract',
'pattern': '.',
'condition': 'host_os == "win"',
- 'action': [ 'python',
+ 'action': [ 'python3',
'boringssl/util/bot/extract.py',
'--no-prefix',
'boringssl/util/bot/perl-win32.zip',
@@ -172,7 +172,7 @@ hooks = [
'name': 'win_toolchain',
'pattern': '.',
'condition': 'host_os == "win"',
- 'action': [ 'python',
+ 'action': [ 'python3',
'boringssl/util/bot/vs_toolchain.py',
'update',
Var('vs_version'),
@@ -182,7 +182,7 @@ hooks = [
'name': 'clang',
'pattern': '.',
'condition': 'checkout_clang',
- 'action': [ 'python',
+ 'action': [ 'python3',
'boringssl/util/bot/update_clang.py',
],
},
@@ -200,7 +200,7 @@ hooks = [
'name': 'sde_linux64_extract',
'pattern': '.',
'condition': 'checkout_sde and host_os == "linux"',
- 'action': [ 'python',
+ 'action': [ 'python3',
'boringssl/util/bot/extract.py',
'boringssl/util/bot/sde-linux64.tar.bz2',
'boringssl/util/bot/sde-linux64/',
@@ -220,7 +220,7 @@ hooks = [
'name': 'sde_win32_extract',
'pattern': '.',
'condition': 'checkout_sde and host_os == "win"',
- 'action': [ 'python',
+ 'action': [ 'python3',
'boringssl/util/bot/extract.py',
'boringssl/util/bot/sde-win32.tar.bz2',
'boringssl/util/bot/sde-win32/',
diff --git a/util/bot/extract.py b/util/bot/extract.py
index 4680cfe..9b1b88a 100644
--- a/util/bot/extract.py
+++ b/util/bot/extract.py
@@ -96,7 +96,7 @@ def main(args):
# Skip archives that weren't downloaded.
return 0
- with open(archive) as f:
+ with open(archive, 'rb') as f:
sha256 = hashlib.sha256()
while True:
chunk = f.read(1024 * 1024)
@@ -109,7 +109,7 @@ def main(args):
if os.path.exists(stamp_path):
with open(stamp_path) as f:
if f.read().strip() == digest:
- print "Already up-to-date."
+ print("Already up-to-date.")
return 0
if archive.endswith('.zip'):
@@ -123,10 +123,10 @@ def main(args):
try:
if os.path.exists(output):
- print "Removing %s" % (output, )
+ print("Removing %s" % (output, ))
shutil.rmtree(output)
- print "Extracting %s to %s" % (archive, output)
+ print("Extracting %s to %s" % (archive, output))
prefix = None
num_extracted = 0
for entry in entries:
@@ -166,14 +166,14 @@ def main(args):
# Print every 100 files, so bots do not time out on large archives.
num_extracted += 1
if num_extracted % 100 == 0:
- print "Extracted %d files..." % (num_extracted,)
+ print("Extracted %d files..." % (num_extracted,))
finally:
entries.close()
with open(stamp_path, 'w') as f:
f.write(digest)
- print "Done. Extracted %d files." % (num_extracted,)
+ print("Done. Extracted %d files." % (num_extracted,))
return 0