From 7924245eb13e5bd45d6c34f1c6d81fbdb46ac9dc Mon Sep 17 00:00:00 2001 From: Son Luong Ngoc Date: Fri, 13 Oct 2023 10:00:20 +0200 Subject: [PATCH] remote_exec.proto: support ZSTD with dictionary Closes #272 --- .../execution/v2/remote_execution.proto | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/build/bazel/remote/execution/v2/remote_execution.proto b/build/bazel/remote/execution/v2/remote_execution.proto index b7ae5bc4..5a50947d 100644 --- a/build/bazel/remote/execution/v2/remote_execution.proto +++ b/build/bazel/remote/execution/v2/remote_execution.proto @@ -1948,7 +1948,7 @@ message Compressor { // not need to advertise it. IDENTITY = 0; - // Zstandard compression. + // Zstandard compression without dictionary. ZSTD = 1; // RFC 1951 Deflate. This format is identical to what is used by ZIP @@ -1961,9 +1961,30 @@ message Compressor { // Brotli compression. BROTLI = 3; + + // Zstandard compression with dictionary. + // + // When this is used, the server MUST advertise the dictionaries by + // including + // [ZstdDictionaryRegistry][build.bazel.remote.execution.v2.ZstdDictionaryRegistry] + // digest in CacheCapabilities. + ZSTD_DICT = 4; } } +message ZstdDictionaryRegistry { + // Each file respresent a single Zstandard dictionary + // with name being the `dictId` that was added to the header + // of the compressed file. + // + // A special file with name `default` is used to represent the + // default dictionary that is used when no `dictId` is specified. + // Clients SHOULD prefer to use the default dictionary when possible. + // + // The `default` dictionary MUST be present. + repeated FileNode dictionaries = 1; +} + // Capabilities of the remote cache system. message CacheCapabilities { // All the digest functions supported by the remote cache. @@ -1997,6 +2018,11 @@ message CacheCapabilities { // [BatchUpdateBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs] // requests. repeated Compressor.Value supported_batch_update_compressors = 7; + + // The digest of the + // [ZstdDictionaryRegistry][build.bazel.remote.execution.v2.ZstdDictionaryRegistry] + // that contains all the dictionaries supported by the remote cache. + Digest zstd_dictionary_registry = 8; } // Capabilities of the remote execution system.