summaryrefslogtreecommitdiff
path: root/build_extra
diff options
context:
space:
mode:
Diffstat (limited to 'build_extra')
-rw-r--r--build_extra/rust/get_version_hash.py14
-rw-r--r--build_extra/rust/rust.gni10
2 files changed, 8 insertions, 16 deletions
diff --git a/build_extra/rust/get_version_hash.py b/build_extra/rust/get_version_hash.py
deleted file mode 100644
index 7d37cbf9b..000000000
--- a/build_extra/rust/get_version_hash.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2018 the Deno authors. All rights reserved. MIT license.
-
-# This script computes the sha256sum of the first command line argument, and
-# writes a few hex digits of it to stdout. It is used by rust.gni to derive a
-# unique string (without dots/special characters) from a crate version number.
-
-from hashlib import sha256
-import sys
-
-if len(sys.argv) != 2:
- raise Exception('Expected exactly one argument.')
-
-hash = sha256(sys.argv[1]).hexdigest()
-sys.stdout.write(hash[0:8])
diff --git a/build_extra/rust/rust.gni b/build_extra/rust/rust.gni
index 586953917..1600602e0 100644
--- a/build_extra/rust/rust.gni
+++ b/build_extra/rust/rust.gni
@@ -120,8 +120,14 @@ template("run_rustc") {
if (defined(crate_version)) {
# Compute the sha256sum of the version number. See comments below.
# Note that we do this only if there are multiple versions of this crate.
- hash =
- exec_script("get_version_hash.py", [ crate_version ], "trim string")
+ hash = exec_script("//tools/sha256sum.py",
+ [
+ "--input",
+ crate_version,
+ "--format",
+ "%.8s",
+ ],
+ "trim string")
args += [
# In our build setup, all crates are built in the same directory. The