Update CMake on the bots and switch to CIPD where available.

Newer versions of CMake have some fix for default libraries on
Windows/ARM64. (Not sure exactly what version, but the latest CMake does
seem to work.)

While trying to update the others, it turns out my workstation no longer
makes CMake builds compatible with the builders. It's also tedious that
updating CMake requires making builds myself. Fortunately, Chrome infra
is maintains some packages of third-party software in CIPD.

However, they don't make Windows CMake builds (filed
https://crbug.com/1180257 to request them), and they're stuck on 3.13.x
(blocked on https://crbug.com/1176531).

So, this CL switches to CIPD for Mac/Linux, with the latest version they
have available. It sticks with the old method (uploading copies of
upstream's packages) for Windows and grabs the latest version. When both
of the bugs above are fixed, hopefully things will be more uniform.

Change-Id: I710091fc60594165738a893b2be73cdcef54dfe2
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/45764
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/.gitignore b/.gitignore
index 07d8083..51782c9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,9 +11,7 @@
 util/bot/android_ndk
 util/bot/android_sdk/public
 util/bot/cmake-linux64
-util/bot/cmake-linux64.tar.gz
 util/bot/cmake-mac
-util/bot/cmake-mac.tar.gz
 util/bot/cmake-win32
 util/bot/cmake-win32.zip
 util/bot/golang
diff --git a/util/bot/DEPS b/util/bot/DEPS
index a5086ba..db7dfa1 100644
--- a/util/bot/DEPS
+++ b/util/bot/DEPS
@@ -21,43 +21,75 @@
   'checkout_libcxx': False,
   'vs_version': 'env',
 
-  'android_sdk_platform-tools_version': 'Jxtur3_L9RzY4q79K-AwIahwFW4oi5uYVD5URx9h62wC',
-}
+  # Run the following commands to see the latest builds in CIPD:
+  #
+  #  cipd describe infra/3pp/tools/cmake/linux-amd64 -version latest
+  #  cipd describe infra/3pp/tools/cmake/mac-amd64 -version latest
+  #
+  # TODO(https://crbug.com/1176531): Update to a newer CMake when available
+  # from CIPD. This is currently blocked on the linked bug.
+  'cmake_version': 'version:3.13.5',
 
-deps = {
+  # Update the following from
+  # https://chromium.googlesource.com/chromium/src/+/master/DEPS
+  'android_sdk_platform-tools_version': 'Jxtur3_L9RzY4q79K-AwIahwFW4oi5uYVD5URx9h62wC',
   # TODO(davidben): Before updating this, update the builders to specify
   # ANDROID_ARM_NEON=0. The NDK now defaults armeabi-v7a to assuming NEON, but
   # we wish to retain test coverage for non-NEON code. (Perhaps worth having
   # both configurations.)
+  'android_ndk_revision': '27c0a8d090c666a50e40fceb4ee5b40b1a2d3f87',
+  'libfuzzer_revision': 'debe7d2d1982e540fbd6bd78604bf001753f9e74',
+
+  # Update the following from
+  # https://chromium.googlesource.com/chromium/src/+/master/buildtools/DEPS
+  'libcxx_revision': 'd9040c75cfea5928c804ab7c235fed06a63f743a',
+  'libcxxabi_revision': '196ba1aaa8ac285d94f4ea8d9836390a45360533',
+}
+
+deps = {
   'boringssl/util/bot/android_ndk': {
-    'url': Var('chromium_git') + '/android_ndk.git' + '@' + '27c0a8d090c666a50e40fceb4ee5b40b1a2d3f87',
+    'url': Var('chromium_git') + '/android_ndk.git' + '@' + Var('android_ndk_revision'),
     'condition': 'checkout_android',
   },
 
   'boringssl/util/bot/android_sdk/public': {
-      'packages': [
-          {
-              'package': 'chromium/third_party/android_sdk/public/platform-tools',
-              'version': Var('android_sdk_platform-tools_version'),
-          },
-      ],
-      'condition': 'checkout_android',
-      'dep_type': 'cipd',
+    'packages': [{
+      'package': 'chromium/third_party/android_sdk/public/platform-tools',
+      'version': Var('android_sdk_platform-tools_version'),
+    }],
+    'condition': 'checkout_android',
+    'dep_type': 'cipd',
+  },
+
+  'boringssl/util/bot/cmake-linux64': {
+    'packages': [{
+      'package': 'infra/3pp/tools/cmake/linux-amd64',
+      'version': Var('cmake_version'),
+    }],
+    'condition': 'host_os == "linux"',
+    'dep_type': 'cipd',
+  },
+
+  'boringssl/util/bot/cmake-mac': {
+    'packages': [{
+      'package': 'infra/3pp/tools/cmake/mac-amd64',
+      'version': Var('cmake_version'),
+    }],
+    'condition': 'host_os == "mac"',
+    'dep_type': 'cipd',
   },
 
   'boringssl/util/bot/libFuzzer': {
-    'url': Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git' +'@' + 'debe7d2d1982e540fbd6bd78604bf001753f9e74',
+    'url': Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git' +'@' + Var('libfuzzer_revision'),
     'condition': 'checkout_fuzzer',
   },
 
-  # Update the following revisions from
-  # https://chromium.googlesource.com/chromium/src/+/master/buildtools/DEPS
   'boringssl/util/bot/libcxx': {
-    'url': Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + 'd9040c75cfea5928c804ab7c235fed06a63f743a',
+    'url': Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + Var('libcxx_revision'),
     'condition': 'checkout_libcxx',
   },
   'boringssl/util/bot/libcxxabi': {
-    'url': Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '196ba1aaa8ac285d94f4ea8d9836390a45360533',
+    'url': Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + Var('libcxxabi_revision'),
     'condition': 'checkout_libcxx',
   },
 }
@@ -68,50 +100,7 @@
 ]
 
 hooks = [
-  {
-    'name': 'cmake_linux64',
-    'pattern': '.',
-    'condition': 'host_os == "linux"',
-    'action': [ 'download_from_google_storage',
-                '--no_resume',
-                '--platform=linux*',
-                '--no_auth',
-                '--bucket', 'chromium-tools',
-                '-s', 'boringssl/util/bot/cmake-linux64.tar.gz.sha1',
-    ],
-  },
-  {
-    'name': 'cmake_linux64_extract',
-    'pattern': '.',
-    'condition': 'host_os == "linux"',
-    'action': [ 'python',
-                'boringssl/util/bot/extract.py',
-                'boringssl/util/bot/cmake-linux64.tar.gz',
-                'boringssl/util/bot/cmake-linux64/',
-    ],
-  },
-  {
-    'name': 'cmake_mac',
-    'pattern': '.',
-    'condition': 'host_os == "mac"',
-    'action': [ 'download_from_google_storage',
-                '--no_resume',
-                '--platform=darwin',
-                '--no_auth',
-                '--bucket', 'chromium-tools',
-                '-s', 'boringssl/util/bot/cmake-mac.tar.gz.sha1',
-    ],
-  },
-  {
-    'name': 'cmake_mac_extract',
-    'pattern': '.',
-    'condition': 'host_os == "mac"',
-    'action': [ 'python',
-                'boringssl/util/bot/extract.py',
-                'boringssl/util/bot/cmake-mac.tar.gz',
-                'boringssl/util/bot/cmake-mac/',
-    ],
-  },
+  # TODO(https://crbug.com/1180257): Use CIPD for CMake on Windows.
   {
     'name': 'cmake_win32',
     'pattern': '.',
diff --git a/util/bot/UPDATING b/util/bot/UPDATING
index 9ea123b..533eef8 100644
--- a/util/bot/UPDATING
+++ b/util/bot/UPDATING
@@ -8,9 +8,7 @@
 
 To update to newer revisions, follow these instructions:
 
-DEPS: Set all revisions to those used in Chromium, found at
-   https://chromium.googlesource.com/chromium/src/+/master/DEPS (Search for the
-   corresponding repository name.)
+DEPS: Update the variables as described in the comments.
 
 go/bootstrap.py: Set TOOLSET_VERSION to the latest release of Go, found at
     https://golang.org/dl/.
@@ -29,24 +27,11 @@
 
     upload_to_google_storage.py -b chromium-tools FILE
 
-cmake-linux64.tar.gz: Download the latest CMake source tarball, found at
-    https://cmake.org/download/. Build it with:
-
-        ./bootstrap --prefix=$PWD/cmake-linux64 && make && make install
-        tar -czf cmake-linux64.tar.gz cmake-linux64/
-
-    The current revision was built against cmake-3.10.0.tar.gz.
-
-cmake-mac.tar.gz: Follow the same instructions as above on a Mac, but replace
-    cmake-linux64 with cmake-mac.
-
-    The current revision was built against cmake-3.10.0.tar.gz.
-
 cmake-win32.zip: Update to the latest prebuilt release of CMake, found at
     https://cmake.org/download/. Use the file labeled "Windows win64-x64
     ZIP". The download will be named cmake-VERSION-win64-x64.zip.
 
-    The current revision is cmake-3.11.4-win64-x64.zip
+    The current revision is cmake-3.19.5-win64-x64.zip
 
 nasm-win32.exe: Update to the appropriate release of NASM, found at
     https://www.nasm.us/. Use the same version as Chromium, found at
diff --git a/util/bot/cmake-linux64.tar.gz.sha1 b/util/bot/cmake-linux64.tar.gz.sha1
deleted file mode 100644
index 52e17f0..0000000
--- a/util/bot/cmake-linux64.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-e32e920dc95a0ac58fe78f666d2ce69222b23edb
\ No newline at end of file
diff --git a/util/bot/cmake-mac.tar.gz.sha1 b/util/bot/cmake-mac.tar.gz.sha1
deleted file mode 100644
index cf90503..0000000
--- a/util/bot/cmake-mac.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-20ee0e2d2e11e2ea34caf78197e4784a4fc95181
\ No newline at end of file
diff --git a/util/bot/cmake-win32.zip.sha1 b/util/bot/cmake-win32.zip.sha1
index 574df8a..d641c17 100644
--- a/util/bot/cmake-win32.zip.sha1
+++ b/util/bot/cmake-win32.zip.sha1
@@ -1 +1 @@
-f4fac544e5d8392b3f2fcc967e22b473d7cf8e79
\ No newline at end of file
+b106d66bcdc8a71ea2cdf5446091327bfdb1bcd7
\ No newline at end of file