summaryrefslogtreecommitdiff
path: root/tools/prebuilt.py
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-12-18 21:09:30 -0500
committerGitHub <noreply@github.com>2018-12-18 21:09:30 -0500
commitaa66ef98ea6144abd2d2714fef1dfc8046e01775 (patch)
treeeec266ba13ca4ee8c2c57095ae9e2867dc254ac5 /tools/prebuilt.py
parent3dbd18af0950400eed7063bef7cb1f7ff27c4a01 (diff)
travis: Set CARGO_HOME to third_party/rust_crates (#1370)
Adds prebuilt hyperfine and sccache binaries Only build test_cc for LSAN Add Cargo.lock Only run benchmarks in master
Diffstat (limited to 'tools/prebuilt.py')
-rw-r--r--tools/prebuilt.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/prebuilt.py b/tools/prebuilt.py
new file mode 100644
index 000000000..d30b232be
--- /dev/null
+++ b/tools/prebuilt.py
@@ -0,0 +1,37 @@
+import sys
+import os
+from util import run, root_path
+from third_party import tp, google_env
+
+
+def download_prebuilt(sha1_file):
+ run([
+ "python",
+ tp('depot_tools/download_from_google_storage.py'),
+ '--platform=' + sys.platform,
+ '--no_auth',
+ '--bucket=denoland',
+ '--sha1_file',
+ sha1_file,
+ ],
+ env=google_env())
+
+
+def load_sccache():
+ if sys.platform == 'win32':
+ p = "prebuilt/win/sccache.exe"
+ elif sys.platform.startswith('linux'):
+ p = "prebuilt/linux64/sccache"
+ elif sys.platform == 'darwin':
+ p = "prebuilt/mac/sccache"
+ download_prebuilt(p + ".sha1")
+ return os.path.join(root_path, p)
+
+
+def load_hyperfine():
+ if sys.platform == 'win32':
+ download_prebuilt("prebuilt/win/hyperfine.exe.sha1")
+ elif sys.platform.startswith('linux'):
+ download_prebuilt("prebuilt/linux64/hyperfine.sha1")
+ elif sys.platform == 'darwin':
+ download_prebuilt("prebuilt/mac/hyperfine.sha1")