From 37c70a125a0282d331a1ec92397b750d50367551 Mon Sep 17 00:00:00 2001 From: ccalvarin Date: Mon, 13 Aug 2018 10:31:15 -0700 Subject: Add easy access to MessageDigests in DigestHashFunction Move the message-digest cloning to DigestHashFunction and out of Fingerprint, to make it possible to configure Fingerprint to use different hash functions. We keep the default MD5 for now, we'd like it to use the global default but want to isolate the configuration change from any change adding potential contention. RELNOTES: None. PiperOrigin-RevId: 208502993 --- .../java/com/google/devtools/build/lib/sandbox/SandboxModule.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/sandbox') diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java index a177598036..0e0ba2d8bf 100644 --- a/src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java +++ b/src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java @@ -86,8 +86,11 @@ public final class SandboxModule extends BlazeModule { if (options.sandboxBase.isEmpty()) { return env.getOutputBase().getRelative("sandbox"); } else { - String dirName = String.format("%s-sandbox.%s", env.getRuntime().getProductName(), - Fingerprint.md5Digest(env.getOutputBase().toString())); + String dirName = + String.format( + "%s-sandbox.%s", + env.getRuntime().getProductName(), + Fingerprint.getHexDigest(env.getOutputBase().toString())); FileSystem fileSystem = env.getRuntime().getFileSystem(); Path resolvedSandboxBase = fileSystem.getPath(options.sandboxBase).resolveSymbolicLinks(); return resolvedSandboxBase.getRelative(dirName); -- cgit v1.2.3