From 78142a6bf3dbf802e3140c1098cf3fda8d4be883 Mon Sep 17 00:00:00 2001 From: ccalvarin Date: Wed, 1 Aug 2018 19:25:22 -0700 Subject: Add a normal startup-option for setting the digest function. We continue to support the jvm property -Dbazel.DigestFunction, for backwards compatibility, but this will go away. The startup-option is marked experimental for now as we iron out issues. (note: leaving this out of release notes until the experimental tag is removed) As part of this refactor, the default constructor calls for FileSystem and derived classes will now use this default. This should remove the need for constructors that accept custom hash functions. RELNOTES: None. PiperOrigin-RevId: 207035217 --- .../lib/runtime/BlazeServerStartupOptions.java | 27 +++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java') diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java index 8fdd14082d..6d434f8d56 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java @@ -15,6 +15,7 @@ package com.google.devtools.build.lib.runtime; import com.google.common.collect.ImmutableMap; import com.google.devtools.build.lib.util.OptionsUtils; +import com.google.devtools.build.lib.vfs.DigestHashFunction; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.common.options.Converter; import com.google.devtools.common.options.Option; @@ -395,14 +396,28 @@ public class BlazeServerStartupOptions extends OptionsBase { public boolean clientDebug; @Option( - name = "connect_timeout_secs", - defaultValue = "30", // NOTE: only for documentation, value is set and used by the client. - documentationCategory = OptionDocumentationCategory.BAZEL_CLIENT_OPTIONS, - effectTags = {OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION}, - help = "The amount of time the client waits for each attempt to connect to the server" - ) + name = "connect_timeout_secs", + defaultValue = "30", // NOTE: only for documentation, value is set and used by the client. + documentationCategory = OptionDocumentationCategory.BAZEL_CLIENT_OPTIONS, + effectTags = {OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION}, + help = "The amount of time the client waits for each attempt to connect to the server") public int connectTimeoutSecs; + // TODO(b/109764197): Add OptionDocumentationCategory.BAZEL_CLIENT_OPTIONS & remove the + // experimental tag once this has been tested and is ready for use. + @Option( + name = "digest_function", + defaultValue = "null", + converter = DigestHashFunction.DigestFunctionConverter.class, + documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, + effectTags = { + OptionEffectTag.LOSES_INCREMENTAL_STATE, + OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION + }, + metadataTags = OptionMetadataTag.EXPERIMENTAL, + help = "The hash function to use when computing file digests.") + public DigestHashFunction digestHashFunction; + @Deprecated @Option( name = "expand_configs_in_place", -- cgit v1.2.3