Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ar = { version = "0.6", optional = true }
atty = "0.2.6"
base64 = "0.11.0"
bincode = "1"
blake3 = "0.1.1"
byteorder = "1.0"
bytes = "0.4"
chrono = { version = "0.4", optional = true }
Expand Down Expand Up @@ -59,7 +60,7 @@ redis = { version = "0.9.0", optional = true }
regex = "1"
reqwest = { version = "0.9.11", optional = true }
retry = "0.4.0"
ring = "0.14.6"
ring = { version = "0.14.6", optional = true }
sha-1 = { version = "0.8", optional = true }
sha2 = { version = "0.8", optional = true }
serde = "1.0"
Expand Down Expand Up @@ -130,7 +131,7 @@ all = ["dist-client", "redis", "s3", "memcached", "gcs", "azure"]
azure = ["chrono", "hyper", "hyperx", "url", "hmac", "md-5", "sha2"]
s3 = ["chrono", "hyper", "hyperx", "reqwest", "simple-s3", "hmac", "sha-1"]
simple-s3 = []
gcs = ["chrono", "hyper", "hyperx", "reqwest", "untrusted", "url"]
gcs = ["chrono", "hyper", "hyperx", "reqwest", "ring", "untrusted", "url"]
memcached = ["memcached-rs"]
# Enable features that require unstable features of Nightly Rust.
unstable = []
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ impl pkg::ToolchainPackager for CToolchainPackager {
}

/// The cache is versioned by the inputs to `hash_key`.
pub const CACHE_VERSION: &[u8] = b"7";
pub const CACHE_VERSION: &[u8] = b"8";

lazy_static! {
/// Environment variables that are factored into the cache key.
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ LLVM version: 6.0",
let c = get_compiler_info(&creator, &f.bins[0], &[], &pool)
.wait()
.unwrap();
// sha-1 digest of an empty file.
// digest of an empty file.
assert_eq!(CompilerKind::C(CCompilerKind::GCC), c.kind());
}

Expand Down
6 changes: 3 additions & 3 deletions src/compiler/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub struct Rust {
host: String,
/// The path to the rustc sysroot.
sysroot: PathBuf,
/// The SHA-1 digests of all the shared libraries in rustc's $sysroot/lib (or /bin on Windows).
/// The digests of all the shared libraries in rustc's $sysroot/lib (or /bin on Windows).
compiler_shlibs_digests: Vec<String>,
/// A shared, caching reader for rlib dependencies
#[cfg(feature = "dist-client")]
Expand All @@ -102,7 +102,7 @@ pub struct RustHasher {
host: String,
/// The path to the rustc sysroot.
sysroot: PathBuf,
/// The SHA-1 digests of all the shared libraries in rustc's $sysroot/lib (or /bin on Windows).
/// The digests of all the shared libraries in rustc's $sysroot/lib (or /bin on Windows).
compiler_shlibs_digests: Vec<String>,
/// A shared, caching reader for rlib dependencies
#[cfg(feature = "dist-client")]
Expand Down Expand Up @@ -187,7 +187,7 @@ lazy_static! {
}

/// Version number for cache key.
const CACHE_VERSION: &[u8] = b"4";
const CACHE_VERSION: &[u8] = b"5";

/// Get absolute paths for all source files listed in rustc's dep-info output.
fn get_source_files<T>(
Expand Down
14 changes: 7 additions & 7 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::mock_command::{CommandChild, RunCommand};
use byteorder::{BigEndian, ByteOrder};
use futures::{future, Future};
use futures_cpupool::CpuPool;
use ring::digest::{Context, SHA512};
use blake3::Hasher as blake3_Hasher;
use serde::Serialize;
use std::ffi::{OsStr, OsString};
use std::fs::File;
Expand All @@ -32,17 +32,17 @@ use crate::errors::*;

#[derive(Clone)]
pub struct Digest {
inner: Context,
inner: blake3_Hasher,
}

impl Digest {
pub fn new() -> Digest {
Digest {
inner: Context::new(&SHA512),
inner: blake3_Hasher::new(),
}
}

/// Calculate the SHA-512 digest of the contents of `path`, running
/// Calculate the BLAKE3 digest of the contents of `path`, running
/// the actual hash computation on a background thread in `pool`.
pub fn file<T>(path: T, pool: &CpuPool) -> SFuture<String>
where
Expand All @@ -51,7 +51,7 @@ impl Digest {
Self::reader(path.as_ref().to_owned(), pool)
}

/// Calculate the SHA-512 digest of the contents read from `reader`.
/// Calculate the BLAKE3 digest of the contents read from `reader`.
pub fn reader_sync<R: Read>(reader: R) -> Result<String> {
let mut m = Digest::new();
let mut reader = BufReader::new(reader);
Expand All @@ -68,7 +68,7 @@ impl Digest {
Ok(m.finish())
}

/// Calculate the SHA-512 digest of the contents of `path`, running
/// Calculate the BLAKE3 digest of the contents of `path`, running
/// the actual hash computation on a background thread in `pool`.
pub fn reader(path: PathBuf, pool: &CpuPool) -> SFuture<String> {
Box::new(pool.spawn_fn(move || -> Result<_> {
Expand All @@ -83,7 +83,7 @@ impl Digest {
}

pub fn finish(self) -> String {
hex(self.inner.finish().as_ref())
hex(self.inner.finalize().as_bytes())
}
}

Expand Down