aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/sandbox
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2018-08-13 10:31:15 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-08-13 10:33:11 -0700
commit37c70a125a0282d331a1ec92397b750d50367551 (patch)
tree6a93a272bbed696544410a13405255d66aa5cddd /src/main/java/com/google/devtools/build/lib/sandbox
parent6ab4e16b89aca166fdee85628e264eb6ca5288af (diff)
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
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/sandbox')
-rw-r--r--src/main/java/com/google/devtools/build/lib/sandbox/SandboxModule.java7
1 files changed, 5 insertions, 2 deletions
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);