From c5c53b9d048b463eecda070d8e031da737d56b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Mon, 11 Oct 2021 17:16:03 -0500 Subject: [PATCH 01/30] compilation --- .bazelversion | 2 +- .gitignore | 1 + Examples/.bazelrc | 2 ++ .../BazelXCBBuildService/Package.resolved | 8 ++--- Examples/WORKSPACE | 12 +++---- Package.swift | 2 +- .../XCBProtocol_13_0/Build/SDKVariant.swift | 1 + external/com_github_apple_swift_nio.BUILD | 35 +++++++++++++++++++ repositories.bzl | 6 ++-- 9 files changed, 54 insertions(+), 15 deletions(-) create mode 100644 Examples/.bazelrc create mode 120000 Sources/XCBProtocol_13_0/Build/SDKVariant.swift diff --git a/.bazelversion b/.bazelversion index 40c341b..6aba2b2 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -3.6.0 +4.2.0 diff --git a/.gitignore b/.gitignore index 03671ac..68902ab 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /bazel-* /Examples/bazel-* /.vscode +.build \ No newline at end of file diff --git a/Examples/.bazelrc b/Examples/.bazelrc new file mode 100644 index 0000000..6d8a102 --- /dev/null +++ b/Examples/.bazelrc @@ -0,0 +1,2 @@ +build --use_top_level_targets_for_symlinks +build --macos_cpus=arm64,x86_64 diff --git a/Examples/BazelXCBBuildService/Package.resolved b/Examples/BazelXCBBuildService/Package.resolved index 1700e65..5eb8dcb 100644 --- a/Examples/BazelXCBBuildService/Package.resolved +++ b/Examples/BazelXCBBuildService/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/apple/swift-log.git", "state": { "branch": null, - "revision": "74d7b91ceebc85daf387ebb206003f78813f71aa", - "version": "1.2.0" + "revision": "5d66f7ba25daf4f94100e7022febf3c75e37a6c7", + "version": "1.4.2" } }, { @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/apple/swift-nio.git", "state": { "branch": null, - "revision": "c5fa0b456524cd73dc3ddbb263d4f46c20b86ca3", - "version": "2.17.0" + "revision": "6aa9347d9bc5bbfe6a84983aec955c17ffea96ef", + "version": "2.33.0" } }, { diff --git a/Examples/WORKSPACE b/Examples/WORKSPACE index dc967d2..0a296ab 100644 --- a/Examples/WORKSPACE +++ b/Examples/WORKSPACE @@ -6,20 +6,20 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_apple_support", - sha256 = "36d60bce680446ab534b141c47f2aef6b9c598267ef3450b7d74b9d81e1fd6bd", - url = "https://github.com/bazelbuild/apple_support/releases/download/0.9.0/apple_support.0.9.0.tar.gz", + sha256 = "76df040ade90836ff5543888d64616e7ba6c3a7b33b916aa3a4b68f342d1b447", + url = "https://github.com/bazelbuild/apple_support/releases/download/0.11.0/apple_support.0.11.0.tar.gz", ) http_archive( name = "build_bazel_rules_apple", - sha256 = "55f4dc1c9bf21bb87442665f4618cff1f1343537a2bd89252078b987dcd9c382", - url = "https://github.com/bazelbuild/rules_apple/releases/download/0.20.0/rules_apple.0.20.0.tar.gz", + sha256 = "0052d452af7742c8f3a4e0929763388a66403de363775db7e90adecb2ba4944b", + url = "https://github.com/bazelbuild/rules_apple/releases/download/0.31.2/rules_apple.0.31.3.tar.gz", ) http_archive( name = "build_bazel_rules_swift", - sha256 = "d2f38c33dc82cf3160c59342203d31a030e53ebe8f4c7365add7a549223f9c62", - url = "https://github.com/bazelbuild/rules_swift/releases/download/0.15.0/rules_swift.0.15.0.tar.gz", + sha256 = "653e8756001616500b110fd156694de7899278bb7480aba22b2f156438a1d810", + url = "https://github.com/bazelbuild/rules_swift/releases/download/0.22.0/rules_swift.0.22.0.tar.gz", ) load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") diff --git a/Package.swift b/Package.swift index f7f4d69..2a1650a 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( dependencies: [ // Make sure to update the versions used in the `repositories.bzl` file if you change them here .package(url: "https://github.com/apple/swift-log", .exact("1.4.2")), - .package(url: "https://github.com/apple/swift-nio", .exact("2.30.0")), + .package(url: "https://github.com/apple/swift-nio", .exact("2.33.0")), ], targets: [ .target( diff --git a/Sources/XCBProtocol_13_0/Build/SDKVariant.swift b/Sources/XCBProtocol_13_0/Build/SDKVariant.swift new file mode 120000 index 0000000..903d1ec --- /dev/null +++ b/Sources/XCBProtocol_13_0/Build/SDKVariant.swift @@ -0,0 +1 @@ +../../XCBProtocol_11_4/Build/SDKVariant.swift \ No newline at end of file diff --git a/external/com_github_apple_swift_nio.BUILD b/external/com_github_apple_swift_nio.BUILD index e87c71d..5bdefad 100644 --- a/external/com_github_apple_swift_nio.BUILD +++ b/external/com_github_apple_swift_nio.BUILD @@ -10,6 +10,40 @@ swift_library( ":CNIODarwin", ":CNIOLinux", ":NIOConcurrencyHelpers", + ":NIOCore", + ":NIOEmbedded", + ":NIOPosix", + ], +) + +swift_library( + name = "NIOEmbedded", + srcs = glob(["Sources/NIOEmbedded/**/*.swift"]), + deps = [ + ":_NIODataStructures", + ":NIOCore", + ], +) + +swift_library( + name = "_NIODataStructures", + srcs = glob(["Sources/_NIODataStructures/**/*.swift"]), + deps = [], +) + +swift_library( + name = "NIOPosix", + srcs = glob(["Sources/NIOPosix/**/*.swift"]), + deps = [ + ":NIOCore", + ], +) + +swift_library( + name = "NIOCore", + srcs = glob(["Sources/NIOCore/**/*.swift"]), + deps = [ + ":NIOConcurrencyHelpers", ], ) @@ -44,6 +78,7 @@ objc_library( "Sources/CNIODarwin/include/**/*.h", ]), includes = ["Sources/CNIODarwin/include"], + defines = ["__APPLE_USE_RFC_3542"], ) objc_library( diff --git a/repositories.bzl b/repositories.bzl index 2a19e49..8f72301 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -22,9 +22,9 @@ def xcbbuildserviceproxy_dependencies(): http_archive, build_file = "@com_github_target_xcbbuildserviceproxy//:external/com_github_apple_swift_nio.BUILD", name = "com_github_apple_swift_nio", - sha256 = "40b115e77e8af3ffbe84be344c30c0964763e318e1d3dfe0a80da0e2ae17d614", - strip_prefix = "swift-nio-2.30.0", + sha256 = "4a654952046a46ad8f09d359e6c02e7fa04ab09f492ae35f5d6d7c769f3f008a", + strip_prefix = "swift-nio-2.33.0", urls = [ - "https://github.com/apple/swift-nio/archive/2.30.0.tar.gz", + "https://github.com/apple/swift-nio/archive/2.33.0.tar.gz", ], ) From 882782e9e8caf725d43052477e1690872bc878bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Mon, 11 Oct 2021 17:17:42 -0500 Subject: [PATCH 02/30] xcode 13 code --- Examples/BazelXCBBuildService/Package.swift | 2 +- .../BazelXCBBuildService/Sources/BazelBuild.swift | 12 +++++++----- .../Sources/RequestHandler.swift | 6 +++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Examples/BazelXCBBuildService/Package.swift b/Examples/BazelXCBBuildService/Package.swift index ba9a6ea..a97dd75 100644 --- a/Examples/BazelXCBBuildService/Package.swift +++ b/Examples/BazelXCBBuildService/Package.swift @@ -25,7 +25,7 @@ let package = Package( "SwiftProtobuf", "XCBBuildServiceProxy", "XCBProtocol", - "XCBProtocol_12_0", + "XCBProtocol_13_0", ], path: "Sources" ), diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift index 9253113..8a1b641 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift @@ -1,6 +1,7 @@ import Foundation import XCBBuildServiceProxy import XCBProtocol +@_exported import XCBProtocol_13_0 // swiftformat:disable braces @@ -89,7 +90,7 @@ final class BazelBuild { self.buildContext = buildContext - switch buildRequest.buildCommand { + switch buildRequest.buildCommand.command { case .cleanBuildFolder: self.buildProcess = CleanBuildFolderProcess( buildProductsPath: buildRequest.parameters.arenaInfo.buildProductsPath, @@ -114,7 +115,7 @@ final class BazelBuild { /// - Returns: `true` if the target shouldn't be build for the `buildRequest`. /// e.g. test targets are set in Xcode 11.3 for SwiftUI previews, even though we don't need to build them. static func shouldSkipTarget(_ target: Target, buildRequest: BuildRequest) -> Bool { - guard buildRequest.buildCommand == .preview else { return false } + guard buildRequest.buildCommand.command == .preview else { return false } return target.name.hasSuffix("Testing") || target.name == "TestingCore" @@ -146,7 +147,7 @@ final class BazelBuild { let developerDir = baseEnvironment["DEVELOPER_DIR"]! let platformDir = "\(developerDir)/Platforms/\(parameters.activeRunDestination.platform.directoryName)" let platformDeveloperDir = "\(platformDir)/Developer" - let sdkRoot = "\(platformDeveloperDir)/SDKs/\(parameters.activeRunDestination.sdkVariant.directoryName)" + let sdkRoot = "\(platformDeveloperDir)/SDKs/\(parameters.activeRunDestination.sdkVariant)" //TODO: .directoryName let environment = Self.generateEnvironment( baseEnvironment: baseEnvironment, @@ -466,7 +467,7 @@ final class BazelBuild { let parameters = installTarget?.parameters ?? buildRequest.parameters let platformDir = "\(developerDir)/Platforms/\(parameters.activeRunDestination.platform.directoryName)" let platformDeveloperDir = "\(platformDir)/Developer" - let sdkRoot = "\(platformDeveloperDir)/SDKs/\(parameters.activeRunDestination.sdkVariant.directoryName)" + let sdkRoot = "\(platformDeveloperDir)/SDKs/\(parameters.activeRunDestination.sdkVariant)" //TODO: .directoryName let configuration = parameters.configuration let commandLineString = startProcessHandler( @@ -810,7 +811,8 @@ private extension BuildOperationProjectInfo { self.init( name: parsedProject.name, path: parsedProject.path, - isPackage: parsedProject.isPackage + isPackage: parsedProject.isPackage, + isNameUniqueInWorkspace: true ) } } diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index 1e9c678..d004e1a 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -4,9 +4,9 @@ import NIO import XCBBuildServiceProxy import XCBProtocol -@_exported import XCBProtocol_12_0 -typealias BazelXCBBuildServiceRequestPayload = XCBProtocol_12_0.RequestPayload -typealias BazelXCBBuildServiceResponsePayload = XCBProtocol_12_0.ResponsePayload +@_exported import XCBProtocol_13_0 +typealias BazelXCBBuildServiceRequestPayload = XCBProtocol_13_0.RequestPayload +typealias BazelXCBBuildServiceResponsePayload = XCBProtocol_13_0.ResponsePayload final class RequestHandler: HybridXCBBuildServiceRequestHandler { typealias Context = HybridXCBBuildServiceRequestHandlerContext From 367294a73201455c4aeaf5c3a073f64cca2c3b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 18:29:53 -0500 Subject: [PATCH 03/30] updated proto files --- .../proto/build_event_stream.pb.swift | 3601 ++++---- .../src/main/protobuf/command_line.pb.swift | 247 +- .../main/protobuf/failure_details.pb.swift | 7779 +++++++++++++++-- .../main/protobuf/invocation_policy.pb.swift | 708 +- .../src/main/protobuf/option_filters.pb.swift | 23 +- 5 files changed, 9677 insertions(+), 2681 deletions(-) mode change 100755 => 100644 Examples/BazelXCBBuildService/BEP/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.pb.swift mode change 100755 => 100644 Examples/BazelXCBBuildService/BEP/src/main/protobuf/command_line.pb.swift mode change 100755 => 100644 Examples/BazelXCBBuildService/BEP/src/main/protobuf/failure_details.pb.swift mode change 100755 => 100644 Examples/BazelXCBBuildService/BEP/src/main/protobuf/invocation_policy.pb.swift mode change 100755 => 100644 Examples/BazelXCBBuildService/BEP/src/main/protobuf/option_filters.pb.swift diff --git a/Examples/BazelXCBBuildService/BEP/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.pb.swift b/Examples/BazelXCBBuildService/BEP/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.pb.swift old mode 100755 new mode 100644 index 0ea8e35..13b6e99 --- a/Examples/BazelXCBBuildService/BEP/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.pb.swift +++ b/Examples/BazelXCBBuildService/BEP/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.pb.swift @@ -1,4 +1,5 @@ // DO NOT EDIT. +// swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto @@ -6,6 +7,20 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ +// Copyright 2016 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import Foundation import SwiftProtobuf @@ -16,13 +31,15 @@ import src_main_protobuf_invocation_policy_proto // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that your are building against the same version of the API +// Please ensure that you are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } +/// Enumeration type characterizing the size of a test, as specified by the +/// test rule. public enum BuildEventStream_TestSize: SwiftProtobuf.Enum { public typealias RawValue = Int case unknown // = 0 @@ -143,214 +160,219 @@ extension BuildEventStream_TestStatus: CaseIterable { #endif // swift(>=4.2) +/// Identifier for a build event. It is deliberately structured to also provide +/// information about which build target etc the event is related to. +/// +/// Events are chained via the event id as follows: each event has an id and a +/// set of ids of children events such that apart from the initial event each +/// event has an id that is mentioned as child id in an earlier event and a build +/// invocation is complete if and only if all direct and indirect children of the +/// initial event have been posted. public struct BuildEventStream_BuildEventId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var id: OneOf_ID? { - get {return _storage._id} - set {_uniqueStorage()._id = newValue} - } + public var id: BuildEventStream_BuildEventId.OneOf_ID? = nil public var unknown: BuildEventStream_BuildEventId.UnknownBuildEventId { get { - if case .unknown(let v)? = _storage._id {return v} + if case .unknown(let v)? = id {return v} return BuildEventStream_BuildEventId.UnknownBuildEventId() } - set {_uniqueStorage()._id = .unknown(newValue)} + set {id = .unknown(newValue)} } public var progress: BuildEventStream_BuildEventId.ProgressId { get { - if case .progress(let v)? = _storage._id {return v} + if case .progress(let v)? = id {return v} return BuildEventStream_BuildEventId.ProgressId() } - set {_uniqueStorage()._id = .progress(newValue)} + set {id = .progress(newValue)} } public var started: BuildEventStream_BuildEventId.BuildStartedId { get { - if case .started(let v)? = _storage._id {return v} + if case .started(let v)? = id {return v} return BuildEventStream_BuildEventId.BuildStartedId() } - set {_uniqueStorage()._id = .started(newValue)} + set {id = .started(newValue)} } public var unstructuredCommandLine: BuildEventStream_BuildEventId.UnstructuredCommandLineId { get { - if case .unstructuredCommandLine(let v)? = _storage._id {return v} + if case .unstructuredCommandLine(let v)? = id {return v} return BuildEventStream_BuildEventId.UnstructuredCommandLineId() } - set {_uniqueStorage()._id = .unstructuredCommandLine(newValue)} + set {id = .unstructuredCommandLine(newValue)} } public var structuredCommandLine: BuildEventStream_BuildEventId.StructuredCommandLineId { get { - if case .structuredCommandLine(let v)? = _storage._id {return v} + if case .structuredCommandLine(let v)? = id {return v} return BuildEventStream_BuildEventId.StructuredCommandLineId() } - set {_uniqueStorage()._id = .structuredCommandLine(newValue)} + set {id = .structuredCommandLine(newValue)} } public var workspaceStatus: BuildEventStream_BuildEventId.WorkspaceStatusId { get { - if case .workspaceStatus(let v)? = _storage._id {return v} + if case .workspaceStatus(let v)? = id {return v} return BuildEventStream_BuildEventId.WorkspaceStatusId() } - set {_uniqueStorage()._id = .workspaceStatus(newValue)} + set {id = .workspaceStatus(newValue)} } public var optionsParsed: BuildEventStream_BuildEventId.OptionsParsedId { get { - if case .optionsParsed(let v)? = _storage._id {return v} + if case .optionsParsed(let v)? = id {return v} return BuildEventStream_BuildEventId.OptionsParsedId() } - set {_uniqueStorage()._id = .optionsParsed(newValue)} + set {id = .optionsParsed(newValue)} } public var fetch: BuildEventStream_BuildEventId.FetchId { get { - if case .fetch(let v)? = _storage._id {return v} + if case .fetch(let v)? = id {return v} return BuildEventStream_BuildEventId.FetchId() } - set {_uniqueStorage()._id = .fetch(newValue)} + set {id = .fetch(newValue)} } public var configuration: BuildEventStream_BuildEventId.ConfigurationId { get { - if case .configuration(let v)? = _storage._id {return v} + if case .configuration(let v)? = id {return v} return BuildEventStream_BuildEventId.ConfigurationId() } - set {_uniqueStorage()._id = .configuration(newValue)} + set {id = .configuration(newValue)} } public var targetConfigured: BuildEventStream_BuildEventId.TargetConfiguredId { get { - if case .targetConfigured(let v)? = _storage._id {return v} + if case .targetConfigured(let v)? = id {return v} return BuildEventStream_BuildEventId.TargetConfiguredId() } - set {_uniqueStorage()._id = .targetConfigured(newValue)} + set {id = .targetConfigured(newValue)} } public var pattern: BuildEventStream_BuildEventId.PatternExpandedId { get { - if case .pattern(let v)? = _storage._id {return v} + if case .pattern(let v)? = id {return v} return BuildEventStream_BuildEventId.PatternExpandedId() } - set {_uniqueStorage()._id = .pattern(newValue)} + set {id = .pattern(newValue)} } public var patternSkipped: BuildEventStream_BuildEventId.PatternExpandedId { get { - if case .patternSkipped(let v)? = _storage._id {return v} + if case .patternSkipped(let v)? = id {return v} return BuildEventStream_BuildEventId.PatternExpandedId() } - set {_uniqueStorage()._id = .patternSkipped(newValue)} + set {id = .patternSkipped(newValue)} } public var namedSet: BuildEventStream_BuildEventId.NamedSetOfFilesId { get { - if case .namedSet(let v)? = _storage._id {return v} + if case .namedSet(let v)? = id {return v} return BuildEventStream_BuildEventId.NamedSetOfFilesId() } - set {_uniqueStorage()._id = .namedSet(newValue)} + set {id = .namedSet(newValue)} } public var targetCompleted: BuildEventStream_BuildEventId.TargetCompletedId { get { - if case .targetCompleted(let v)? = _storage._id {return v} + if case .targetCompleted(let v)? = id {return v} return BuildEventStream_BuildEventId.TargetCompletedId() } - set {_uniqueStorage()._id = .targetCompleted(newValue)} + set {id = .targetCompleted(newValue)} } public var actionCompleted: BuildEventStream_BuildEventId.ActionCompletedId { get { - if case .actionCompleted(let v)? = _storage._id {return v} + if case .actionCompleted(let v)? = id {return v} return BuildEventStream_BuildEventId.ActionCompletedId() } - set {_uniqueStorage()._id = .actionCompleted(newValue)} + set {id = .actionCompleted(newValue)} } public var unconfiguredLabel: BuildEventStream_BuildEventId.UnconfiguredLabelId { get { - if case .unconfiguredLabel(let v)? = _storage._id {return v} + if case .unconfiguredLabel(let v)? = id {return v} return BuildEventStream_BuildEventId.UnconfiguredLabelId() } - set {_uniqueStorage()._id = .unconfiguredLabel(newValue)} + set {id = .unconfiguredLabel(newValue)} } public var configuredLabel: BuildEventStream_BuildEventId.ConfiguredLabelId { get { - if case .configuredLabel(let v)? = _storage._id {return v} + if case .configuredLabel(let v)? = id {return v} return BuildEventStream_BuildEventId.ConfiguredLabelId() } - set {_uniqueStorage()._id = .configuredLabel(newValue)} + set {id = .configuredLabel(newValue)} } public var testResult: BuildEventStream_BuildEventId.TestResultId { get { - if case .testResult(let v)? = _storage._id {return v} + if case .testResult(let v)? = id {return v} return BuildEventStream_BuildEventId.TestResultId() } - set {_uniqueStorage()._id = .testResult(newValue)} + set {id = .testResult(newValue)} } public var testSummary: BuildEventStream_BuildEventId.TestSummaryId { get { - if case .testSummary(let v)? = _storage._id {return v} + if case .testSummary(let v)? = id {return v} return BuildEventStream_BuildEventId.TestSummaryId() } - set {_uniqueStorage()._id = .testSummary(newValue)} + set {id = .testSummary(newValue)} } public var buildFinished: BuildEventStream_BuildEventId.BuildFinishedId { get { - if case .buildFinished(let v)? = _storage._id {return v} + if case .buildFinished(let v)? = id {return v} return BuildEventStream_BuildEventId.BuildFinishedId() } - set {_uniqueStorage()._id = .buildFinished(newValue)} + set {id = .buildFinished(newValue)} } public var buildToolLogs: BuildEventStream_BuildEventId.BuildToolLogsId { get { - if case .buildToolLogs(let v)? = _storage._id {return v} + if case .buildToolLogs(let v)? = id {return v} return BuildEventStream_BuildEventId.BuildToolLogsId() } - set {_uniqueStorage()._id = .buildToolLogs(newValue)} + set {id = .buildToolLogs(newValue)} } public var buildMetrics: BuildEventStream_BuildEventId.BuildMetricsId { get { - if case .buildMetrics(let v)? = _storage._id {return v} + if case .buildMetrics(let v)? = id {return v} return BuildEventStream_BuildEventId.BuildMetricsId() } - set {_uniqueStorage()._id = .buildMetrics(newValue)} + set {id = .buildMetrics(newValue)} } public var workspace: BuildEventStream_BuildEventId.WorkspaceConfigId { get { - if case .workspace(let v)? = _storage._id {return v} + if case .workspace(let v)? = id {return v} return BuildEventStream_BuildEventId.WorkspaceConfigId() } - set {_uniqueStorage()._id = .workspace(newValue)} + set {id = .workspace(newValue)} } public var buildMetadata: BuildEventStream_BuildEventId.BuildMetadataId { get { - if case .buildMetadata(let v)? = _storage._id {return v} + if case .buildMetadata(let v)? = id {return v} return BuildEventStream_BuildEventId.BuildMetadataId() } - set {_uniqueStorage()._id = .buildMetadata(newValue)} + set {id = .buildMetadata(newValue)} } public var convenienceSymlinksIdentified: BuildEventStream_BuildEventId.ConvenienceSymlinksIdentifiedId { get { - if case .convenienceSymlinksIdentified(let v)? = _storage._id {return v} + if case .convenienceSymlinksIdentified(let v)? = id {return v} return BuildEventStream_BuildEventId.ConvenienceSymlinksIdentifiedId() } - set {_uniqueStorage()._id = .convenienceSymlinksIdentified(newValue)} + set {id = .convenienceSymlinksIdentified(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -384,38 +406,119 @@ public struct BuildEventStream_BuildEventId { #if !swift(>=4.1) public static func ==(lhs: BuildEventStream_BuildEventId.OneOf_ID, rhs: BuildEventStream_BuildEventId.OneOf_ID) -> Bool { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.unknown(let l), .unknown(let r)): return l == r - case (.progress(let l), .progress(let r)): return l == r - case (.started(let l), .started(let r)): return l == r - case (.unstructuredCommandLine(let l), .unstructuredCommandLine(let r)): return l == r - case (.structuredCommandLine(let l), .structuredCommandLine(let r)): return l == r - case (.workspaceStatus(let l), .workspaceStatus(let r)): return l == r - case (.optionsParsed(let l), .optionsParsed(let r)): return l == r - case (.fetch(let l), .fetch(let r)): return l == r - case (.configuration(let l), .configuration(let r)): return l == r - case (.targetConfigured(let l), .targetConfigured(let r)): return l == r - case (.pattern(let l), .pattern(let r)): return l == r - case (.patternSkipped(let l), .patternSkipped(let r)): return l == r - case (.namedSet(let l), .namedSet(let r)): return l == r - case (.targetCompleted(let l), .targetCompleted(let r)): return l == r - case (.actionCompleted(let l), .actionCompleted(let r)): return l == r - case (.unconfiguredLabel(let l), .unconfiguredLabel(let r)): return l == r - case (.configuredLabel(let l), .configuredLabel(let r)): return l == r - case (.testResult(let l), .testResult(let r)): return l == r - case (.testSummary(let l), .testSummary(let r)): return l == r - case (.buildFinished(let l), .buildFinished(let r)): return l == r - case (.buildToolLogs(let l), .buildToolLogs(let r)): return l == r - case (.buildMetrics(let l), .buildMetrics(let r)): return l == r - case (.workspace(let l), .workspace(let r)): return l == r - case (.buildMetadata(let l), .buildMetadata(let r)): return l == r - case (.convenienceSymlinksIdentified(let l), .convenienceSymlinksIdentified(let r)): return l == r + case (.unknown, .unknown): return { + guard case .unknown(let l) = lhs, case .unknown(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.progress, .progress): return { + guard case .progress(let l) = lhs, case .progress(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.started, .started): return { + guard case .started(let l) = lhs, case .started(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.unstructuredCommandLine, .unstructuredCommandLine): return { + guard case .unstructuredCommandLine(let l) = lhs, case .unstructuredCommandLine(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.structuredCommandLine, .structuredCommandLine): return { + guard case .structuredCommandLine(let l) = lhs, case .structuredCommandLine(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.workspaceStatus, .workspaceStatus): return { + guard case .workspaceStatus(let l) = lhs, case .workspaceStatus(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.optionsParsed, .optionsParsed): return { + guard case .optionsParsed(let l) = lhs, case .optionsParsed(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.fetch, .fetch): return { + guard case .fetch(let l) = lhs, case .fetch(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.configuration, .configuration): return { + guard case .configuration(let l) = lhs, case .configuration(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.targetConfigured, .targetConfigured): return { + guard case .targetConfigured(let l) = lhs, case .targetConfigured(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.pattern, .pattern): return { + guard case .pattern(let l) = lhs, case .pattern(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.patternSkipped, .patternSkipped): return { + guard case .patternSkipped(let l) = lhs, case .patternSkipped(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.namedSet, .namedSet): return { + guard case .namedSet(let l) = lhs, case .namedSet(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.targetCompleted, .targetCompleted): return { + guard case .targetCompleted(let l) = lhs, case .targetCompleted(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.actionCompleted, .actionCompleted): return { + guard case .actionCompleted(let l) = lhs, case .actionCompleted(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.unconfiguredLabel, .unconfiguredLabel): return { + guard case .unconfiguredLabel(let l) = lhs, case .unconfiguredLabel(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.configuredLabel, .configuredLabel): return { + guard case .configuredLabel(let l) = lhs, case .configuredLabel(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.testResult, .testResult): return { + guard case .testResult(let l) = lhs, case .testResult(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.testSummary, .testSummary): return { + guard case .testSummary(let l) = lhs, case .testSummary(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.buildFinished, .buildFinished): return { + guard case .buildFinished(let l) = lhs, case .buildFinished(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.buildToolLogs, .buildToolLogs): return { + guard case .buildToolLogs(let l) = lhs, case .buildToolLogs(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.buildMetrics, .buildMetrics): return { + guard case .buildMetrics(let l) = lhs, case .buildMetrics(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.workspace, .workspace): return { + guard case .workspace(let l) = lhs, case .workspace(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.buildMetadata, .buildMetadata): return { + guard case .buildMetadata(let l) = lhs, case .buildMetadata(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.convenienceSymlinksIdentified, .convenienceSymlinksIdentified): return { + guard case .convenienceSymlinksIdentified(let l) = lhs, case .convenienceSymlinksIdentified(let r) = rhs else { preconditionFailure() } + return l == r + }() default: return false } } #endif } + /// Generic identifier for a build event. This is the default type of + /// BuildEventId, but should not be used outside testing; nevertheless, + /// tools should handle build events with this kind of id gracefully. public struct UnknownBuildEventId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -428,11 +531,16 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event reporting progress. Those events are also used to + /// chain in events that come early. public struct ProgressId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Unique identifier. No assumption should be made about how the ids are + /// assigned; the only meaningful operation on this field is test for + /// equality. public var opaqueCount: Int32 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -440,6 +548,8 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event indicating the beginning of a build; this will + /// normally be the first event. public struct BuildStartedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -450,6 +560,8 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier on an event indicating the original commandline received by + /// the bazel server. public struct UnstructuredCommandLineId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -460,11 +572,16 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier on an event describing the commandline received by Bazel. public struct StructuredCommandLineId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// A title for this command line value, as there may be multiple. + /// For example, a single invocation may wish to report both the literal and + /// canonical command lines, and this label would be used to differentiate + /// between both versions. public var commandLineLabel: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -472,6 +589,7 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event indicating the workspace status. public struct WorkspaceStatusId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -482,6 +600,8 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier on an event reporting on the options included in the command + /// line, both explicitly and implicitly. public struct OptionsParsedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -492,11 +612,14 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event reporting that an external resource was fetched + /// from. public struct FetchId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// The external resource that was fetched from. public var url: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -504,6 +627,12 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event indicating that a target pattern has been expanded + /// further. + /// Messages of this shape are also used to describe parts of a pattern that + /// have been skipped for some reason, if the actual expansion was still + /// carried out (e.g., if keep_going is set). In this case, the + /// pattern_skipped choice in the id field is to be made. public struct PatternExpandedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -536,6 +665,8 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event indicating that a target has been expanded by + /// identifying for which configurations it should be build. public struct TargetConfiguredId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -543,6 +674,8 @@ public struct BuildEventStream_BuildEventId { public var label: String = String() + /// If not empty, the id refers to the expansion of the target for a given + /// aspect. public var aspect: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -550,11 +683,15 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event introducing a named set of files (usually artifacts) + /// to be referred to in later messages. public struct NamedSetOfFilesId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Identifier of the file set; this is an opaque string valid only for the + /// particular instance of the event stream. public var id: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -562,11 +699,15 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event introducing a configuration. public struct ConfigurationId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Identifier of the configuration; users of the protocol should not make + /// any assumptions about it having any structure, or equality of the + /// identifier between different streams. public var id: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -574,68 +715,71 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event indicating that a target was built completely; this + /// does not include running the test if the target is a test target. public struct TargetCompletedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var label: String { - get {return _storage._label} - set {_uniqueStorage()._label = newValue} - } + public var label: String = String() + /// The configuration for which the target was built. public var configuration: BuildEventStream_BuildEventId.ConfigurationId { - get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} - set {_uniqueStorage()._configuration = newValue} + get {return _configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} + set {_configuration = newValue} } /// Returns true if `configuration` has been explicitly set. - public var hasConfiguration: Bool {return _storage._configuration != nil} + public var hasConfiguration: Bool {return self._configuration != nil} /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} + public mutating func clearConfiguration() {self._configuration = nil} - public var aspect: String { - get {return _storage._aspect} - set {_uniqueStorage()._aspect = newValue} - } + /// If not empty, the id refers to the completion of the target for a given + /// aspect. + public var aspect: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil } + /// Identifier of an event reporting that an action was completed (not all + /// actions are reported, only the ones that can be considered important; + /// this includes all failed actions). public struct ActionCompletedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var primaryOutput: String { - get {return _storage._primaryOutput} - set {_uniqueStorage()._primaryOutput = newValue} - } + public var primaryOutput: String = String() - public var label: String { - get {return _storage._label} - set {_uniqueStorage()._label = newValue} - } + /// Optional, the label of the owner of the action, for reference. + public var label: String = String() + /// Optional, the id of the configuration of the action owner. public var configuration: BuildEventStream_BuildEventId.ConfigurationId { - get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} - set {_uniqueStorage()._configuration = newValue} + get {return _configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} + set {_configuration = newValue} } /// Returns true if `configuration` has been explicitly set. - public var hasConfiguration: Bool {return _storage._configuration != nil} + public var hasConfiguration: Bool {return self._configuration != nil} /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} + public mutating func clearConfiguration() {self._configuration = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil } + /// Identifier of an event reporting an event associated with an unconfigured + /// label. Usually, this indicates a failure due to a missing input file. In + /// any case, it will report some form of error (i.e., the payload will be an + /// Aborted event); there are no regular events using this identifier. The + /// purpose of those events is to serve as the root cause of a failed target. public struct UnconfiguredLabelId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -648,99 +792,92 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event reporting an event associated with a configured + /// label, usually a visibility error. In any case, an event with such an + /// id will always report some form of error (i.e., the payload will be an + /// Aborted event); there are no regular events using this identifier. public struct ConfiguredLabelId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var label: String { - get {return _storage._label} - set {_uniqueStorage()._label = newValue} - } + public var label: String = String() public var configuration: BuildEventStream_BuildEventId.ConfigurationId { - get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} - set {_uniqueStorage()._configuration = newValue} + get {return _configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} + set {_configuration = newValue} } /// Returns true if `configuration` has been explicitly set. - public var hasConfiguration: Bool {return _storage._configuration != nil} + public var hasConfiguration: Bool {return self._configuration != nil} /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} + public mutating func clearConfiguration() {self._configuration = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil } + /// Identifier of an event reporting on an individual test run. The label + /// identifies the test that is reported about, the remaining fields are + /// in such a way as to uniquely identify the action within a build. In fact, + /// attempts for the same test, run, shard triple are counted sequentially, + /// starting with 1. public struct TestResultId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var label: String { - get {return _storage._label} - set {_uniqueStorage()._label = newValue} - } + public var label: String = String() public var configuration: BuildEventStream_BuildEventId.ConfigurationId { - get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} - set {_uniqueStorage()._configuration = newValue} + get {return _configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} + set {_configuration = newValue} } /// Returns true if `configuration` has been explicitly set. - public var hasConfiguration: Bool {return _storage._configuration != nil} + public var hasConfiguration: Bool {return self._configuration != nil} /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} + public mutating func clearConfiguration() {self._configuration = nil} - public var run: Int32 { - get {return _storage._run} - set {_uniqueStorage()._run = newValue} - } + public var run: Int32 = 0 - public var shard: Int32 { - get {return _storage._shard} - set {_uniqueStorage()._shard = newValue} - } + public var shard: Int32 = 0 - public var attempt: Int32 { - get {return _storage._attempt} - set {_uniqueStorage()._attempt = newValue} - } + public var attempt: Int32 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil } + /// Identifier of an event reporting the summary of a test. public struct TestSummaryId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var label: String { - get {return _storage._label} - set {_uniqueStorage()._label = newValue} - } + public var label: String = String() public var configuration: BuildEventStream_BuildEventId.ConfigurationId { - get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} - set {_uniqueStorage()._configuration = newValue} + get {return _configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} + set {_configuration = newValue} } /// Returns true if `configuration` has been explicitly set. - public var hasConfiguration: Bool {return _storage._configuration != nil} + public var hasConfiguration: Bool {return self._configuration != nil} /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} + public mutating func clearConfiguration() {self._configuration = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil } + /// Identifier of the BuildFinished event, indicating the end of a build. public struct BuildFinishedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -751,6 +888,8 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event providing additional logs/statistics after + /// completion of the build. public struct BuildToolLogsId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -761,6 +900,8 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event providing build metrics after completion + /// of the build. public struct BuildMetricsId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -771,6 +912,7 @@ public struct BuildEventStream_BuildEventId { public init() {} } + /// Identifier of an event providing convenience symlinks information. public struct ConvenienceSymlinksIdentifiedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -782,17 +924,22 @@ public struct BuildEventStream_BuildEventId { } public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance } +/// Payload of an event summarizing the progress of the build so far. Those +/// events are also used to be parents of events where the more logical parent +/// event cannot be posted yet as the needed information is not yet complete. public struct BuildEventStream_Progress { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// The next chunk of stdout that bazel produced since the last progress event + /// or the beginning of the build. public var stdout: String = String() + /// The next chunk of stderr that bazel produced since the last progress event + /// or the beginning of the build. public var stderr: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -800,6 +947,8 @@ public struct BuildEventStream_Progress { public init() {} } +/// Payload of an event indicating that an expected event will not come, as +/// the build is aborted prematurely for some reason. public struct BuildEventStream_Aborted { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -807,6 +956,8 @@ public struct BuildEventStream_Aborted { public var reason: BuildEventStream_Aborted.AbortReason = .unknown + /// A human readable description with more details about there reason, where + /// available and useful. public var description_p: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -814,16 +965,44 @@ public struct BuildEventStream_Aborted { public enum AbortReason: SwiftProtobuf.Enum { public typealias RawValue = Int case unknown // = 0 + + /// The user requested the build to be aborted (e.g., by hitting Ctl-C). case userInterrupted // = 1 + + /// The user requested that no analysis be performed. case noAnalyze // = 8 + + /// The user requested that no build be carried out. case noBuild // = 9 + + /// The build or target was aborted as a timeout was exceeded. case timeOut // = 2 + + /// The build or target was aborted as some remote environment (e.g., for + /// remote execution of actions) was not available in the expected way. case remoteEnvironmentFailure // = 3 + + /// Failure due to reasons entirely internal to the build tool, i.e. an + /// unexpected crash due to programmer error. case `internal` // = 4 + + /// A Failure occurred in the loading phase of a target. case loadingFailure // = 5 + + /// A Failure occurred in the analysis phase of a target. case analysisFailure // = 6 + + /// Target build was skipped (e.g. due to incompatible CPU constraints). case skipped // = 7 + + /// Build incomplete due to an earlier build failure (e.g. --keep_going was + /// set to false causing the build be ended upon failure). case incomplete // = 10 + + /// The build tool ran out of memory and crashed. Not yet used. OOMs are + /// currently reported as INTERNAL. + /// TODO(b/170643206): Use this reason for OOMs after updating consumers. + case outOfMemory // = 11 case UNRECOGNIZED(Int) public init() { @@ -843,6 +1022,7 @@ public struct BuildEventStream_Aborted { case 8: self = .noAnalyze case 9: self = .noBuild case 10: self = .incomplete + case 11: self = .outOfMemory default: self = .UNRECOGNIZED(rawValue) } } @@ -860,6 +1040,7 @@ public struct BuildEventStream_Aborted { case .noAnalyze: return 8 case .noBuild: return 9 case .incomplete: return 10 + case .outOfMemory: return 11 case .UNRECOGNIZED(let i): return i } } @@ -885,11 +1066,17 @@ extension BuildEventStream_Aborted.AbortReason: CaseIterable { .analysisFailure, .skipped, .incomplete, + .outOfMemory, ] } #endif // swift(>=4.2) +/// Payload of an event indicating the beginning of a new build. Usually, events +/// of those type start a new build-event stream. The target pattern requested +/// to be build is contained in one of the announced child events; it is an +/// invariant that precisely one of the announced child events has a non-empty +/// target pattern. public struct BuildEventStream_BuildStarted { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -897,18 +1084,27 @@ public struct BuildEventStream_BuildStarted { public var uuid: String = String() + /// Start of the build in ms since the epoch. + /// TODO(buchgr): Use google.protobuf.TimeStamp once bazel's protoc supports + /// it. public var startTimeMillis: Int64 = 0 + /// Version of the build tool that is running. public var buildToolVersion: String = String() + /// A human-readable description of all the non-default option settings public var optionsDescription: String = String() + /// The name of the command that the user invoked. public var command: String = String() + /// The working directory from which the build tool was invoked. public var workingDirectory: String = String() + /// The directory of the workspace. public var workspaceDirectory: String = String() + /// The process ID of the Bazel server. public var serverPid: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -916,11 +1112,14 @@ public struct BuildEventStream_BuildStarted { public init() {} } +/// Configuration related to the blaze workspace and output tree. public struct BuildEventStream_WorkspaceConfig { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// The root of the local blaze exec root. All output files live underneath + /// this at "blaze-out/". public var localExecRoot: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -928,6 +1127,12 @@ public struct BuildEventStream_WorkspaceConfig { public init() {} } +/// Payload of an event reporting the command-line of the invocation as +/// originally received by the server. Note that this is not the command-line +/// given by the user, as the client adds information about the invocation, +/// like name and relevant entries of rc-files and client environment variables. +/// However, it does contain enough information to reproduce the build +/// invocation. public struct BuildEventStream_UnstructuredCommandLine { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -940,52 +1145,41 @@ public struct BuildEventStream_UnstructuredCommandLine { public init() {} } +/// Payload of an event reporting on the parsed options, grouped in various ways. public struct BuildEventStream_OptionsParsed { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var startupOptions: [String] { - get {return _storage._startupOptions} - set {_uniqueStorage()._startupOptions = newValue} - } + public var startupOptions: [String] = [] - public var explicitStartupOptions: [String] { - get {return _storage._explicitStartupOptions} - set {_uniqueStorage()._explicitStartupOptions = newValue} - } + public var explicitStartupOptions: [String] = [] - public var cmdLine: [String] { - get {return _storage._cmdLine} - set {_uniqueStorage()._cmdLine = newValue} - } + public var cmdLine: [String] = [] - public var explicitCmdLine: [String] { - get {return _storage._explicitCmdLine} - set {_uniqueStorage()._explicitCmdLine = newValue} - } + public var explicitCmdLine: [String] = [] - public var invocationPolicy: src_main_protobuf_invocation_policy_proto.Blaze_InvocationPolicy_InvocationPolicy { - get {return _storage._invocationPolicy ?? src_main_protobuf_invocation_policy_proto.Blaze_InvocationPolicy_InvocationPolicy()} - set {_uniqueStorage()._invocationPolicy = newValue} + public var invocationPolicy: Blaze_InvocationPolicy_InvocationPolicy { + get {return _invocationPolicy ?? Blaze_InvocationPolicy_InvocationPolicy()} + set {_invocationPolicy = newValue} } /// Returns true if `invocationPolicy` has been explicitly set. - public var hasInvocationPolicy: Bool {return _storage._invocationPolicy != nil} + public var hasInvocationPolicy: Bool {return self._invocationPolicy != nil} /// Clears the value of `invocationPolicy`. Subsequent reads from it will return its default value. - public mutating func clearInvocationPolicy() {_uniqueStorage()._invocationPolicy = nil} + public mutating func clearInvocationPolicy() {self._invocationPolicy = nil} - public var toolTag: String { - get {return _storage._toolTag} - set {_uniqueStorage()._toolTag = newValue} - } + public var toolTag: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _invocationPolicy: Blaze_InvocationPolicy_InvocationPolicy? = nil } +/// Payload of an event indicating that an external resource was fetched. This +/// event will only occur in streams where an actual fetch happened, not in ones +/// where a cached copy of the entity to be fetched was used. public struct BuildEventStream_Fetch { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -998,6 +1192,10 @@ public struct BuildEventStream_Fetch { public init() {} } +/// Payload of an event reporting the workspace status. Key-value pairs can be +/// provided by specifying the workspace_status_command to an executable that +/// returns one key-value pair per line of output (key and value separated by a +/// space). public struct BuildEventStream_WorkspaceStatus { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1024,11 +1222,14 @@ public struct BuildEventStream_WorkspaceStatus { public init() {} } +/// Payload of an event reporting custom key-value metadata associated with the +/// build. public struct BuildEventStream_BuildMetadata { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Custom metadata for the build. public var metadata: Dictionary = [:] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1036,6 +1237,7 @@ public struct BuildEventStream_BuildMetadata { public init() {} } +/// Payload of an event reporting details of a given configuration. public struct BuildEventStream_Configuration { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1054,6 +1256,10 @@ public struct BuildEventStream_Configuration { public init() {} } +/// Payload of the event indicating the expansion of a target pattern. +/// The main information is in the chaining part: the id will contain the +/// target pattern that was expanded and the children id will contain the +/// target or target pattern it was expanded to. public struct BuildEventStream_PatternExpanded { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1064,15 +1270,24 @@ public struct BuildEventStream_PatternExpanded { public init() {} } +/// Payload of the event indicating that the configurations for a target have +/// been identified. As with pattern expansion the main information is in the +/// chaining part: the id will contain the target that was configured and the +/// children id will contain the configured targets it was configured to. public struct BuildEventStream_TargetConfigured { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// The kind of target (e.g., e.g. "cc_library rule", "source file", + /// "generated file") where the completion is reported. public var targetKind: String = String() + /// The size of the test, if the target is a test target. Unset otherwise. public var testSize: BuildEventStream_TestSize = .unknown + /// List of all tags associated with this target (for all possible + /// configurations). public var tag: [String] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1085,12 +1300,20 @@ public struct BuildEventStream_File { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// A sequence of prefixes to apply to the file name to construct a full path. + /// In most but not all cases, there will be 3 entries: + /// 1. A root output directory, eg "bazel-out" + /// 2. A configuration mnemonic, eg "k8-fastbuild" + /// 3. An output category, eg "genfiles" public var pathPrefix: [String] = [] + /// identifier indicating the nature of the file (e.g., "stdout", "stderr") public var name: String = String() public var file: BuildEventStream_File.OneOf_File? = nil + /// A location where the contents of the file can be found. The string is + /// encoded according to RFC2396. public var uri: String { get { if case .uri(let v)? = file {return v} @@ -1099,10 +1322,11 @@ public struct BuildEventStream_File { set {file = .uri(newValue)} } + /// The contents of the file, if they are guaranteed to be short. public var contents: Data { get { if case .contents(let v)? = file {return v} - return SwiftProtobuf.Internal.emptyData + return Data() } set {file = .contents(newValue)} } @@ -1110,14 +1334,26 @@ public struct BuildEventStream_File { public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_File: Equatable { + /// A location where the contents of the file can be found. The string is + /// encoded according to RFC2396. case uri(String) + /// The contents of the file, if they are guaranteed to be short. case contents(Data) #if !swift(>=4.1) public static func ==(lhs: BuildEventStream_File.OneOf_File, rhs: BuildEventStream_File.OneOf_File) -> Bool { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.uri(let l), .uri(let r)): return l == r - case (.contents(let l), .contents(let r)): return l == r + case (.uri, .uri): return { + guard case .uri(let l) = lhs, case .uri(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.contents, .contents): return { + guard case .contents(let l) = lhs, case .contents(let r) = rhs else { preconditionFailure() } + return l == r + }() default: return false } } @@ -1127,13 +1363,18 @@ public struct BuildEventStream_File { public init() {} } +/// Payload of a message to describe a set of files, usually build artifacts, to +/// be referred to later by their name. In this way, files that occur identically +/// as outputs of several targets have to be named only once. public struct BuildEventStream_NamedSetOfFiles { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Files that belong to this named set of files. public var files: [BuildEventStream_File] = [] + /// Other named sets whose members also belong to this set. public var fileSets: [BuildEventStream_BuildEventId.NamedSetOfFilesId] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1141,6 +1382,10 @@ public struct BuildEventStream_NamedSetOfFiles { public init() {} } +/// Payload of the event indicating the completion of an action. The main purpose +/// of posting those events is to provide details on the root cause for a target +/// failing; however, consumers of the build-event protocol must not assume +/// that only failed actions are posted. public struct BuildEventStream_ActionExecuted { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1151,16 +1396,20 @@ public struct BuildEventStream_ActionExecuted { set {_uniqueStorage()._success = newValue} } + /// The mnemonic of the action that was executed public var type: String { get {return _storage._type} set {_uniqueStorage()._type = newValue} } + /// The exit code of the action, if it is available. public var exitCode: Int32 { get {return _storage._exitCode} set {_uniqueStorage()._exitCode = newValue} } + /// Location where to find the standard output of the action + /// (e.g., a file path). public var stdout: BuildEventStream_File { get {return _storage._stdout ?? BuildEventStream_File()} set {_uniqueStorage()._stdout = newValue} @@ -1170,6 +1419,8 @@ public struct BuildEventStream_ActionExecuted { /// Clears the value of `stdout`. Subsequent reads from it will return its default value. public mutating func clearStdout() {_uniqueStorage()._stdout = nil} + /// Location where to find the standard error of the action + /// (e.g., a file path). public var stderr: BuildEventStream_File { get {return _storage._stderr ?? BuildEventStream_File()} set {_uniqueStorage()._stderr = newValue} @@ -1179,11 +1430,13 @@ public struct BuildEventStream_ActionExecuted { /// Clears the value of `stderr`. Subsequent reads from it will return its default value. public mutating func clearStderr() {_uniqueStorage()._stderr = nil} + /// Deprecated. This field is now present on ActionCompletedId. public var label: String { get {return _storage._label} set {_uniqueStorage()._label = newValue} } + /// Deprecated. This field is now present on ActionCompletedId. public var configuration: BuildEventStream_BuildEventId.ConfigurationId { get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} set {_uniqueStorage()._configuration = newValue} @@ -1193,6 +1446,7 @@ public struct BuildEventStream_ActionExecuted { /// Clears the value of `configuration`. Subsequent reads from it will return its default value. public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} + /// Primary output; only provided for successful actions. public var primaryOutput: BuildEventStream_File { get {return _storage._primaryOutput ?? BuildEventStream_File()} set {_uniqueStorage()._primaryOutput = newValue} @@ -1202,18 +1456,21 @@ public struct BuildEventStream_ActionExecuted { /// Clears the value of `primaryOutput`. Subsequent reads from it will return its default value. public mutating func clearPrimaryOutput() {_uniqueStorage()._primaryOutput = nil} + /// The command-line of the action, if the action is a command. public var commandLine: [String] { get {return _storage._commandLine} set {_uniqueStorage()._commandLine = newValue} } + /// List of paths to log files public var actionMetadataLogs: [BuildEventStream_File] { get {return _storage._actionMetadataLogs} set {_uniqueStorage()._actionMetadataLogs = newValue} } - public var failureDetail: src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail { - get {return _storage._failureDetail ?? src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail()} + /// Only populated if success = false, and sometimes not even then. + public var failureDetail: FailureDetails_FailureDetail { + get {return _storage._failureDetail ?? FailureDetails_FailureDetail()} set {_uniqueStorage()._failureDetail = newValue} } /// Returns true if `failureDetail` has been explicitly set. @@ -1228,13 +1485,16 @@ public struct BuildEventStream_ActionExecuted { fileprivate var _storage = _StorageClass.defaultInstance } +/// Collection of all output files belonging to that output group. public struct BuildEventStream_OutputGroup { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Name of the output group public var name: String = String() + /// List of file sets that belong to this output group as well. public var fileSets: [BuildEventStream_BuildEventId.NamedSetOfFilesId] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1242,164 +1502,148 @@ public struct BuildEventStream_OutputGroup { public init() {} } +/// Payload of the event indicating the completion of a target. The target is +/// specified in the id. If the target failed the root causes are provided as +/// children events. public struct BuildEventStream_TargetComplete { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var success: Bool { - get {return _storage._success} - set {_uniqueStorage()._success = newValue} - } + public var success: Bool = false - public var targetKind: String { - get {return _storage._targetKind} - set {_uniqueStorage()._targetKind = newValue} - } + /// The kind of target (e.g., e.g. "cc_library rule", "source file", + /// "generated file") where the completion is reported. + /// Deprecated: use the target_kind field in TargetConfigured instead. + public var targetKind: String = String() - public var testSize: BuildEventStream_TestSize { - get {return _storage._testSize} - set {_uniqueStorage()._testSize = newValue} - } + /// The size of the test, if the target is a test target. Unset otherwise. + /// Deprecated: use the test_size field in TargetConfigured instead. + public var testSize: BuildEventStream_TestSize = .unknown - public var outputGroup: [BuildEventStream_OutputGroup] { - get {return _storage._outputGroup} - set {_uniqueStorage()._outputGroup = newValue} - } + /// The output files are arranged by their output group. If an output file + /// is part of multiple output groups, it appears once in each output + /// group. + public var outputGroup: [BuildEventStream_OutputGroup] = [] - public var importantOutput: [BuildEventStream_File] { - get {return _storage._importantOutput} - set {_uniqueStorage()._importantOutput = newValue} - } + /// Temporarily, also report the important outputs directly. This is only to + /// allow existing clients help transition to the deduplicated representation; + /// new clients should not use it. + public var importantOutput: [BuildEventStream_File] = [] - public var directoryOutput: [BuildEventStream_File] { - get {return _storage._directoryOutput} - set {_uniqueStorage()._directoryOutput = newValue} - } + /// Report output artifacts (referenced transitively via output_group) which + /// emit directories instead of singleton files. These directory_output entries + /// will never include a uri. + public var directoryOutput: [BuildEventStream_File] = [] - public var tag: [String] { - get {return _storage._tag} - set {_uniqueStorage()._tag = newValue} - } + /// List of tags associated with this configured target. + public var tag: [String] = [] - public var testTimeoutSeconds: Int64 { - get {return _storage._testTimeoutSeconds} - set {_uniqueStorage()._testTimeoutSeconds = newValue} - } + /// The timeout specified for test actions under this configured target. + public var testTimeoutSeconds: Int64 = 0 - public var failureDetail: src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail { - get {return _storage._failureDetail ?? src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail()} - set {_uniqueStorage()._failureDetail = newValue} + /// Failure information about the target, only populated if success is false, + /// and sometimes not even then. Equal to one of the ActionExecuted + /// failure_detail fields for one of the root cause ActionExecuted events. + public var failureDetail: FailureDetails_FailureDetail { + get {return _failureDetail ?? FailureDetails_FailureDetail()} + set {_failureDetail = newValue} } /// Returns true if `failureDetail` has been explicitly set. - public var hasFailureDetail: Bool {return _storage._failureDetail != nil} + public var hasFailureDetail: Bool {return self._failureDetail != nil} /// Clears the value of `failureDetail`. Subsequent reads from it will return its default value. - public mutating func clearFailureDetail() {_uniqueStorage()._failureDetail = nil} + public mutating func clearFailureDetail() {self._failureDetail = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _failureDetail: FailureDetails_FailureDetail? = nil } +/// Payload on events reporting about individual test action. public struct BuildEventStream_TestResult { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var status: BuildEventStream_TestStatus { - get {return _storage._status} - set {_uniqueStorage()._status = newValue} - } + /// The status of this test. + public var status: BuildEventStream_TestStatus = .noStatus - public var statusDetails: String { - get {return _storage._statusDetails} - set {_uniqueStorage()._statusDetails = newValue} - } + /// Additional details about the status of the test. This is intended for + /// user display and must not be parsed. + public var statusDetails: String = String() - public var cachedLocally: Bool { - get {return _storage._cachedLocally} - set {_uniqueStorage()._cachedLocally = newValue} - } + /// True, if the reported attempt is taken from the tool's local cache. + public var cachedLocally: Bool = false - public var testAttemptStartMillisEpoch: Int64 { - get {return _storage._testAttemptStartMillisEpoch} - set {_uniqueStorage()._testAttemptStartMillisEpoch = newValue} - } + /// Time in milliseconds since the epoch at which the test attempt was started. + /// Note: for cached test results, this is time can be before the start of the + /// build. + public var testAttemptStartMillisEpoch: Int64 = 0 - public var testAttemptDurationMillis: Int64 { - get {return _storage._testAttemptDurationMillis} - set {_uniqueStorage()._testAttemptDurationMillis = newValue} - } + /// Time the test took to run. For locally cached results, this is the time + /// the cached invocation took when it was invoked. + public var testAttemptDurationMillis: Int64 = 0 - public var testActionOutput: [BuildEventStream_File] { - get {return _storage._testActionOutput} - set {_uniqueStorage()._testActionOutput = newValue} - } + /// Files (logs, test.xml, undeclared outputs, etc) generated by that test + /// action. + public var testActionOutput: [BuildEventStream_File] = [] - public var warning: [String] { - get {return _storage._warning} - set {_uniqueStorage()._warning = newValue} - } + /// Warnings generated by that test action. + public var warning: [String] = [] public var executionInfo: BuildEventStream_TestResult.ExecutionInfo { - get {return _storage._executionInfo ?? BuildEventStream_TestResult.ExecutionInfo()} - set {_uniqueStorage()._executionInfo = newValue} + get {return _executionInfo ?? BuildEventStream_TestResult.ExecutionInfo()} + set {_executionInfo = newValue} } /// Returns true if `executionInfo` has been explicitly set. - public var hasExecutionInfo: Bool {return _storage._executionInfo != nil} + public var hasExecutionInfo: Bool {return self._executionInfo != nil} /// Clears the value of `executionInfo`. Subsequent reads from it will return its default value. - public mutating func clearExecutionInfo() {_uniqueStorage()._executionInfo = nil} + public mutating func clearExecutionInfo() {self._executionInfo = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() + /// Message providing optional meta data on the execution of the test action, + /// if available. public struct ExecutionInfo { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var timeoutSeconds: Int32 { - get {return _storage._timeoutSeconds} - set {_uniqueStorage()._timeoutSeconds = newValue} - } + /// Deprecated, use TargetComplete.test_timeout_seconds instead. + public var timeoutSeconds: Int32 = 0 - public var strategy: String { - get {return _storage._strategy} - set {_uniqueStorage()._strategy = newValue} - } + /// Name of the strategy to execute this test action (e.g., "local", + /// "remote") + public var strategy: String = String() - public var cachedRemotely: Bool { - get {return _storage._cachedRemotely} - set {_uniqueStorage()._cachedRemotely = newValue} - } + /// True, if the reported attempt was a cache hit in a remote cache. + public var cachedRemotely: Bool = false - public var exitCode: Int32 { - get {return _storage._exitCode} - set {_uniqueStorage()._exitCode = newValue} - } + /// The exit code of the test action. + public var exitCode: Int32 = 0 - public var hostname: String { - get {return _storage._hostname} - set {_uniqueStorage()._hostname = newValue} - } + /// The hostname of the machine where the test action was executed (in case + /// of remote execution), if known. + public var hostname: String = String() public var timingBreakdown: BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown { - get {return _storage._timingBreakdown ?? BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown()} - set {_uniqueStorage()._timingBreakdown = newValue} + get {return _timingBreakdown ?? BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown()} + set {_timingBreakdown = newValue} } /// Returns true if `timingBreakdown` has been explicitly set. - public var hasTimingBreakdown: Bool {return _storage._timingBreakdown != nil} + public var hasTimingBreakdown: Bool {return self._timingBreakdown != nil} /// Clears the value of `timingBreakdown`. Subsequent reads from it will return its default value. - public mutating func clearTimingBreakdown() {_uniqueStorage()._timingBreakdown = nil} + public mutating func clearTimingBreakdown() {self._timingBreakdown = nil} - public var resourceUsage: [BuildEventStream_TestResult.ExecutionInfo.ResourceUsage] { - get {return _storage._resourceUsage} - set {_uniqueStorage()._resourceUsage = newValue} - } + public var resourceUsage: [BuildEventStream_TestResult.ExecutionInfo.ResourceUsage] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() + /// Represents a hierarchical timing breakdown of an activity. + /// The top level time should be the total time of the activity. + /// Invariant: time_millis >= sum of time_millis of all direct children. public struct TimingBreakdown { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1432,33 +1676,49 @@ public struct BuildEventStream_TestResult { public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _timingBreakdown: BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown? = nil } public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _executionInfo: BuildEventStream_TestResult.ExecutionInfo? = nil } +/// Payload of the event summarizing a test. public struct BuildEventStream_TestSummary { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Wrapper around BlazeTestStatus to support importing that enum to proto3. + /// Overall status of test, accumulated over all runs, shards, and attempts. public var overallStatus: BuildEventStream_TestStatus = .noStatus + /// Total number of runs public var totalRunCount: Int32 = 0 + /// Number of runs. + public var runCount: Int32 = 0 + + /// Number of shards. + public var shardCount: Int32 = 0 + + /// Path to logs of passed runs. public var passed: [BuildEventStream_File] = [] + /// Path to logs of failed runs; public var failed: [BuildEventStream_File] = [] + /// Total number of cached test actions public var totalNumCached: Int32 = 0 + /// When the test first started running. public var firstStartTimeMillis: Int64 = 0 + /// When the last test action completed. public var lastStopTimeMillis: Int64 = 0 + /// The total runtime of the test. public var totalRunDurationMillis: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1466,48 +1726,57 @@ public struct BuildEventStream_TestSummary { public init() {} } +/// Event indicating the end of a build. public struct BuildEventStream_BuildFinished { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var overallSuccess: Bool { - get {return _storage._overallSuccess} - set {_uniqueStorage()._overallSuccess = newValue} - } + /// If the build succeeded or failed. + public var overallSuccess: Bool = false + /// The overall status of the build. A build was successful iff + /// ExitCode.code equals 0. public var exitCode: BuildEventStream_BuildFinished.ExitCode { - get {return _storage._exitCode ?? BuildEventStream_BuildFinished.ExitCode()} - set {_uniqueStorage()._exitCode = newValue} + get {return _exitCode ?? BuildEventStream_BuildFinished.ExitCode()} + set {_exitCode = newValue} } /// Returns true if `exitCode` has been explicitly set. - public var hasExitCode: Bool {return _storage._exitCode != nil} + public var hasExitCode: Bool {return self._exitCode != nil} /// Clears the value of `exitCode`. Subsequent reads from it will return its default value. - public mutating func clearExitCode() {_uniqueStorage()._exitCode = nil} + public mutating func clearExitCode() {self._exitCode = nil} - public var finishTimeMillis: Int64 { - get {return _storage._finishTimeMillis} - set {_uniqueStorage()._finishTimeMillis = newValue} - } + /// Time in milliseconds since the epoch. + /// TODO(buchgr): Use google.protobuf.Timestamp once bazel's protoc supports + /// it. + public var finishTimeMillis: Int64 = 0 public var anomalyReport: BuildEventStream_BuildFinished.AnomalyReport { - get {return _storage._anomalyReport ?? BuildEventStream_BuildFinished.AnomalyReport()} - set {_uniqueStorage()._anomalyReport = newValue} + get {return _anomalyReport ?? BuildEventStream_BuildFinished.AnomalyReport()} + set {_anomalyReport = newValue} } /// Returns true if `anomalyReport` has been explicitly set. - public var hasAnomalyReport: Bool {return _storage._anomalyReport != nil} + public var hasAnomalyReport: Bool {return self._anomalyReport != nil} /// Clears the value of `anomalyReport`. Subsequent reads from it will return its default value. - public mutating func clearAnomalyReport() {_uniqueStorage()._anomalyReport = nil} + public mutating func clearAnomalyReport() {self._anomalyReport = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() + /// Exit code of a build. The possible values correspond to the predefined + /// codes in bazel's lib.ExitCode class, as well as any custom exit code a + /// module might define. The predefined exit codes are subject to change (but + /// rarely do) and are not part of the public API. + /// + /// A build was successful iff ExitCode.code equals 0. public struct ExitCode { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// The name of the exit code. public var name: String = String() + /// The exit code. public var code: Int32 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1515,11 +1784,16 @@ public struct BuildEventStream_BuildFinished { public init() {} } + /// Things that happened during the build that could be of interest. public struct AnomalyReport { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Was the build suspended at any time during the build. + /// Examples of suspensions are SIGSTOP, or the hardware being put to sleep. + /// If was_suspended is true, then most of the timings for this build are + /// suspect. public var wasSuspended: Bool = false public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1529,7 +1803,8 @@ public struct BuildEventStream_BuildFinished { public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _exitCode: BuildEventStream_BuildFinished.ExitCode? = nil + fileprivate var _anomalyReport: BuildEventStream_BuildFinished.AnomalyReport? = nil } public struct BuildEventStream_BuildMetrics { @@ -1538,49 +1813,49 @@ public struct BuildEventStream_BuildMetrics { // methods supported on all messages. public var actionSummary: BuildEventStream_BuildMetrics.ActionSummary { - get {return _storage._actionSummary ?? BuildEventStream_BuildMetrics.ActionSummary()} - set {_uniqueStorage()._actionSummary = newValue} + get {return _actionSummary ?? BuildEventStream_BuildMetrics.ActionSummary()} + set {_actionSummary = newValue} } /// Returns true if `actionSummary` has been explicitly set. - public var hasActionSummary: Bool {return _storage._actionSummary != nil} + public var hasActionSummary: Bool {return self._actionSummary != nil} /// Clears the value of `actionSummary`. Subsequent reads from it will return its default value. - public mutating func clearActionSummary() {_uniqueStorage()._actionSummary = nil} + public mutating func clearActionSummary() {self._actionSummary = nil} public var memoryMetrics: BuildEventStream_BuildMetrics.MemoryMetrics { - get {return _storage._memoryMetrics ?? BuildEventStream_BuildMetrics.MemoryMetrics()} - set {_uniqueStorage()._memoryMetrics = newValue} + get {return _memoryMetrics ?? BuildEventStream_BuildMetrics.MemoryMetrics()} + set {_memoryMetrics = newValue} } /// Returns true if `memoryMetrics` has been explicitly set. - public var hasMemoryMetrics: Bool {return _storage._memoryMetrics != nil} + public var hasMemoryMetrics: Bool {return self._memoryMetrics != nil} /// Clears the value of `memoryMetrics`. Subsequent reads from it will return its default value. - public mutating func clearMemoryMetrics() {_uniqueStorage()._memoryMetrics = nil} + public mutating func clearMemoryMetrics() {self._memoryMetrics = nil} public var targetMetrics: BuildEventStream_BuildMetrics.TargetMetrics { - get {return _storage._targetMetrics ?? BuildEventStream_BuildMetrics.TargetMetrics()} - set {_uniqueStorage()._targetMetrics = newValue} + get {return _targetMetrics ?? BuildEventStream_BuildMetrics.TargetMetrics()} + set {_targetMetrics = newValue} } /// Returns true if `targetMetrics` has been explicitly set. - public var hasTargetMetrics: Bool {return _storage._targetMetrics != nil} + public var hasTargetMetrics: Bool {return self._targetMetrics != nil} /// Clears the value of `targetMetrics`. Subsequent reads from it will return its default value. - public mutating func clearTargetMetrics() {_uniqueStorage()._targetMetrics = nil} + public mutating func clearTargetMetrics() {self._targetMetrics = nil} public var packageMetrics: BuildEventStream_BuildMetrics.PackageMetrics { - get {return _storage._packageMetrics ?? BuildEventStream_BuildMetrics.PackageMetrics()} - set {_uniqueStorage()._packageMetrics = newValue} + get {return _packageMetrics ?? BuildEventStream_BuildMetrics.PackageMetrics()} + set {_packageMetrics = newValue} } /// Returns true if `packageMetrics` has been explicitly set. - public var hasPackageMetrics: Bool {return _storage._packageMetrics != nil} + public var hasPackageMetrics: Bool {return self._packageMetrics != nil} /// Clears the value of `packageMetrics`. Subsequent reads from it will return its default value. - public mutating func clearPackageMetrics() {_uniqueStorage()._packageMetrics = nil} + public mutating func clearPackageMetrics() {self._packageMetrics = nil} public var timingMetrics: BuildEventStream_BuildMetrics.TimingMetrics { - get {return _storage._timingMetrics ?? BuildEventStream_BuildMetrics.TimingMetrics()} - set {_uniqueStorage()._timingMetrics = newValue} + get {return _timingMetrics ?? BuildEventStream_BuildMetrics.TimingMetrics()} + set {_timingMetrics = newValue} } /// Returns true if `timingMetrics` has been explicitly set. - public var hasTimingMetrics: Bool {return _storage._timingMetrics != nil} + public var hasTimingMetrics: Bool {return self._timingMetrics != nil} /// Clears the value of `timingMetrics`. Subsequent reads from it will return its default value. - public mutating func clearTimingMetrics() {_uniqueStorage()._timingMetrics = nil} + public mutating func clearTimingMetrics() {self._timingMetrics = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1589,8 +1864,14 @@ public struct BuildEventStream_BuildMetrics { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// The total number of actions created and registered during the build. + /// This includes unused actions that were constructed but + /// not executed during this build. public var actionsCreated: Int64 = 0 + /// The total number of actions executed during the build. + /// This includes any remote cache hits, but excludes + /// local action cache hits. public var actionsExecuted: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1603,8 +1884,13 @@ public struct BuildEventStream_BuildMetrics { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Size of the JVM heap post build in bytes. This is only collected if + /// --bep_publish_used_heap_size_post_build is set, + /// since it forces a full GC. public var usedHeapSizePostBuild: Int64 = 0 + /// Size of the peak JVM heap size in bytes post GC. Note that this reports 0 + /// if there was no major GC during the build. public var peakPostGcHeapSize: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1617,8 +1903,12 @@ public struct BuildEventStream_BuildMetrics { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Number of targets loaded during this build. public var targetsLoaded: Int64 = 0 + /// Number of targets configured during this build. This can + /// be greater than targets_loaded if the same target is configured + /// multiple times. public var targetsConfigured: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1631,6 +1921,7 @@ public struct BuildEventStream_BuildMetrics { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Number of BUILD files (aka packages) loaded during this build. public var packagesLoaded: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1643,8 +1934,10 @@ public struct BuildEventStream_BuildMetrics { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// The CPU time in milliseconds consumed during this build. public var cpuTimeInMs: Int64 = 0 + /// The elapsed wall time in milliseconds during this build. public var wallTimeInMs: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1654,9 +1947,14 @@ public struct BuildEventStream_BuildMetrics { public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _actionSummary: BuildEventStream_BuildMetrics.ActionSummary? = nil + fileprivate var _memoryMetrics: BuildEventStream_BuildMetrics.MemoryMetrics? = nil + fileprivate var _targetMetrics: BuildEventStream_BuildMetrics.TargetMetrics? = nil + fileprivate var _packageMetrics: BuildEventStream_BuildMetrics.PackageMetrics? = nil + fileprivate var _timingMetrics: BuildEventStream_BuildMetrics.TimingMetrics? = nil } +/// Event providing additional statistics/logs after completion of the build. public struct BuildEventStream_BuildToolLogs { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1669,6 +1967,12 @@ public struct BuildEventStream_BuildToolLogs { public init() {} } +/// Event describing all convenience symlinks (i.e., workspace symlinks) to be +/// created or deleted once the execution phase has begun. Note that this event +/// does not say anything about whether or not the build tool actually executed +/// these filesystem operations; it only says what logical operations should be +/// performed. This event is emitted exactly once per build; if no symlinks are +/// to be modified, the event is still emitted with empty contents. public struct BuildEventStream_ConvenienceSymlinksIdentified { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1681,15 +1985,27 @@ public struct BuildEventStream_ConvenienceSymlinksIdentified { public init() {} } +/// The message that contains what type of action to perform on a given path and +/// target of a symlink. public struct BuildEventStream_ConvenienceSymlink { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// The path of the symlink to be created or deleted, absolute or relative to + /// the workspace, creating any directories necessary. If a symlink already + /// exists at that location, then it should be replaced by a symlink pointing + /// to the new target. public var path: String = String() + /// The operation we are performing on the symlink. public var action: BuildEventStream_ConvenienceSymlink.Action = .unknown + /// If action is CREATE, this is the target path that the symlink should point + /// to. If the path points underneath the output base, it is relative to the + /// output base; otherwise it is absolute. + /// + /// If action is DELETE, this field is not set. public var target: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1697,7 +2013,12 @@ public struct BuildEventStream_ConvenienceSymlink { public enum Action: SwiftProtobuf.Enum { public typealias RawValue = Int case unknown // = 0 + + /// Indicates a symlink should be created, or overwritten if it already + /// exists. case create // = 1 + + /// Indicates a symlink should be deleted if it already exists. case delete // = 2 case UNRECOGNIZED(Int) @@ -1741,6 +2062,11 @@ extension BuildEventStream_ConvenienceSymlink.Action: CaseIterable { #endif // swift(>=4.2) +/// Message describing a build event. Events will have an identifier that +/// is unique within a given build invocation; they also announce follow-up +/// events as children. More details, which are specific to the kind of event +/// that is observed, is provided in the payload. More options for the payload +/// might be added in the future. public struct BuildEventStream_BuildEvent { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1802,10 +2128,10 @@ public struct BuildEventStream_BuildEvent { set {_uniqueStorage()._payload = .unstructuredCommandLine(newValue)} } - public var structuredCommandLine: src_main_protobuf_command_line_proto.CommandLine_CommandLine { + public var structuredCommandLine: CommandLine_CommandLine { get { if case .structuredCommandLine(let v)? = _storage._payload {return v} - return src_main_protobuf_command_line_proto.CommandLine_CommandLine() + return CommandLine_CommandLine() } set {_uniqueStorage()._payload = .structuredCommandLine(newValue)} } @@ -1953,7 +2279,7 @@ public struct BuildEventStream_BuildEvent { case aborted(BuildEventStream_Aborted) case started(BuildEventStream_BuildStarted) case unstructuredCommandLine(BuildEventStream_UnstructuredCommandLine) - case structuredCommandLine(src_main_protobuf_command_line_proto.CommandLine_CommandLine) + case structuredCommandLine(CommandLine_CommandLine) case optionsParsed(BuildEventStream_OptionsParsed) case workspaceStatus(BuildEventStream_WorkspaceStatus) case fetch(BuildEventStream_Fetch) @@ -1974,29 +2300,98 @@ public struct BuildEventStream_BuildEvent { #if !swift(>=4.1) public static func ==(lhs: BuildEventStream_BuildEvent.OneOf_Payload, rhs: BuildEventStream_BuildEvent.OneOf_Payload) -> Bool { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.progress(let l), .progress(let r)): return l == r - case (.aborted(let l), .aborted(let r)): return l == r - case (.started(let l), .started(let r)): return l == r - case (.unstructuredCommandLine(let l), .unstructuredCommandLine(let r)): return l == r - case (.structuredCommandLine(let l), .structuredCommandLine(let r)): return l == r - case (.optionsParsed(let l), .optionsParsed(let r)): return l == r - case (.workspaceStatus(let l), .workspaceStatus(let r)): return l == r - case (.fetch(let l), .fetch(let r)): return l == r - case (.configuration(let l), .configuration(let r)): return l == r - case (.expanded(let l), .expanded(let r)): return l == r - case (.configured(let l), .configured(let r)): return l == r - case (.action(let l), .action(let r)): return l == r - case (.namedSetOfFiles(let l), .namedSetOfFiles(let r)): return l == r - case (.completed(let l), .completed(let r)): return l == r - case (.testResult(let l), .testResult(let r)): return l == r - case (.testSummary(let l), .testSummary(let r)): return l == r - case (.finished(let l), .finished(let r)): return l == r - case (.buildToolLogs(let l), .buildToolLogs(let r)): return l == r - case (.buildMetrics(let l), .buildMetrics(let r)): return l == r - case (.workspaceInfo(let l), .workspaceInfo(let r)): return l == r - case (.buildMetadata(let l), .buildMetadata(let r)): return l == r - case (.convenienceSymlinksIdentified(let l), .convenienceSymlinksIdentified(let r)): return l == r + case (.progress, .progress): return { + guard case .progress(let l) = lhs, case .progress(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.aborted, .aborted): return { + guard case .aborted(let l) = lhs, case .aborted(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.started, .started): return { + guard case .started(let l) = lhs, case .started(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.unstructuredCommandLine, .unstructuredCommandLine): return { + guard case .unstructuredCommandLine(let l) = lhs, case .unstructuredCommandLine(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.structuredCommandLine, .structuredCommandLine): return { + guard case .structuredCommandLine(let l) = lhs, case .structuredCommandLine(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.optionsParsed, .optionsParsed): return { + guard case .optionsParsed(let l) = lhs, case .optionsParsed(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.workspaceStatus, .workspaceStatus): return { + guard case .workspaceStatus(let l) = lhs, case .workspaceStatus(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.fetch, .fetch): return { + guard case .fetch(let l) = lhs, case .fetch(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.configuration, .configuration): return { + guard case .configuration(let l) = lhs, case .configuration(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.expanded, .expanded): return { + guard case .expanded(let l) = lhs, case .expanded(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.configured, .configured): return { + guard case .configured(let l) = lhs, case .configured(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.action, .action): return { + guard case .action(let l) = lhs, case .action(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.namedSetOfFiles, .namedSetOfFiles): return { + guard case .namedSetOfFiles(let l) = lhs, case .namedSetOfFiles(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.completed, .completed): return { + guard case .completed(let l) = lhs, case .completed(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.testResult, .testResult): return { + guard case .testResult(let l) = lhs, case .testResult(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.testSummary, .testSummary): return { + guard case .testSummary(let l) = lhs, case .testSummary(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.finished, .finished): return { + guard case .finished(let l) = lhs, case .finished(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.buildToolLogs, .buildToolLogs): return { + guard case .buildToolLogs(let l) = lhs, case .buildToolLogs(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.buildMetrics, .buildMetrics): return { + guard case .buildMetrics(let l) = lhs, case .buildMetrics(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.workspaceInfo, .workspaceInfo): return { + guard case .workspaceInfo(let l) = lhs, case .workspaceInfo(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.buildMetadata, .buildMetadata): return { + guard case .buildMetadata(let l) = lhs, case .buildMetadata(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.convenienceSymlinksIdentified, .convenienceSymlinksIdentified): return { + guard case .convenienceSymlinksIdentified(let l) = lhs, case .convenienceSymlinksIdentified(let r) = rhs else { preconditionFailure() } + return l == r + }() default: return false } } @@ -2066,305 +2461,455 @@ extension BuildEventStream_BuildEventId: SwiftProtobuf.Message, SwiftProtobuf._M 25: .standard(proto: "convenience_symlinks_identified"), ] - fileprivate class _StorageClass { - var _id: BuildEventStream_BuildEventId.OneOf_ID? - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _id = source._id - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: - var v: BuildEventStream_BuildEventId.UnknownBuildEventId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .unknown(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .unknown(v)} - case 2: - var v: BuildEventStream_BuildEventId.ProgressId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .progress(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .progress(v)} - case 3: - var v: BuildEventStream_BuildEventId.BuildStartedId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .started(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .started(v)} - case 4: - var v: BuildEventStream_BuildEventId.PatternExpandedId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .pattern(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .pattern(v)} - case 5: - var v: BuildEventStream_BuildEventId.TargetCompletedId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .targetCompleted(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .targetCompleted(v)} - case 6: - var v: BuildEventStream_BuildEventId.ActionCompletedId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .actionCompleted(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .actionCompleted(v)} - case 7: - var v: BuildEventStream_BuildEventId.TestSummaryId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .testSummary(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .testSummary(v)} - case 8: - var v: BuildEventStream_BuildEventId.TestResultId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .testResult(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .testResult(v)} - case 9: - var v: BuildEventStream_BuildEventId.BuildFinishedId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .buildFinished(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .buildFinished(v)} - case 10: - var v: BuildEventStream_BuildEventId.PatternExpandedId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .patternSkipped(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .patternSkipped(v)} - case 11: - var v: BuildEventStream_BuildEventId.UnstructuredCommandLineId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .unstructuredCommandLine(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .unstructuredCommandLine(v)} - case 12: - var v: BuildEventStream_BuildEventId.OptionsParsedId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .optionsParsed(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .optionsParsed(v)} - case 13: - var v: BuildEventStream_BuildEventId.NamedSetOfFilesId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .namedSet(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .namedSet(v)} - case 14: - var v: BuildEventStream_BuildEventId.WorkspaceStatusId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .workspaceStatus(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .workspaceStatus(v)} - case 15: - var v: BuildEventStream_BuildEventId.ConfigurationId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .configuration(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .configuration(v)} - case 16: - var v: BuildEventStream_BuildEventId.TargetConfiguredId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .targetConfigured(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .targetConfigured(v)} - case 17: - var v: BuildEventStream_BuildEventId.FetchId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .fetch(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .fetch(v)} - case 18: - var v: BuildEventStream_BuildEventId.StructuredCommandLineId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .structuredCommandLine(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .structuredCommandLine(v)} - case 19: - var v: BuildEventStream_BuildEventId.UnconfiguredLabelId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .unconfiguredLabel(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .unconfiguredLabel(v)} - case 20: - var v: BuildEventStream_BuildEventId.BuildToolLogsId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .buildToolLogs(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .buildToolLogs(v)} - case 21: - var v: BuildEventStream_BuildEventId.ConfiguredLabelId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .configuredLabel(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .configuredLabel(v)} - case 22: - var v: BuildEventStream_BuildEventId.BuildMetricsId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .buildMetrics(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .buildMetrics(v)} - case 23: - var v: BuildEventStream_BuildEventId.WorkspaceConfigId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .workspace(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .workspace(v)} - case 24: - var v: BuildEventStream_BuildEventId.BuildMetadataId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .buildMetadata(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .buildMetadata(v)} - case 25: - var v: BuildEventStream_BuildEventId.ConvenienceSymlinksIdentifiedId? - if let current = _storage._id { - try decoder.handleConflictingOneOf() - if case .convenienceSymlinksIdentified(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._id = .convenienceSymlinksIdentified(v)} - default: break + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { + var v: BuildEventStream_BuildEventId.UnknownBuildEventId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .unknown(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .unknown(v) + } + }() + case 2: try { + var v: BuildEventStream_BuildEventId.ProgressId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .progress(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .progress(v) + } + }() + case 3: try { + var v: BuildEventStream_BuildEventId.BuildStartedId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .started(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .started(v) + } + }() + case 4: try { + var v: BuildEventStream_BuildEventId.PatternExpandedId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .pattern(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .pattern(v) + } + }() + case 5: try { + var v: BuildEventStream_BuildEventId.TargetCompletedId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .targetCompleted(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .targetCompleted(v) + } + }() + case 6: try { + var v: BuildEventStream_BuildEventId.ActionCompletedId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .actionCompleted(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .actionCompleted(v) + } + }() + case 7: try { + var v: BuildEventStream_BuildEventId.TestSummaryId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .testSummary(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .testSummary(v) + } + }() + case 8: try { + var v: BuildEventStream_BuildEventId.TestResultId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .testResult(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .testResult(v) + } + }() + case 9: try { + var v: BuildEventStream_BuildEventId.BuildFinishedId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .buildFinished(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .buildFinished(v) + } + }() + case 10: try { + var v: BuildEventStream_BuildEventId.PatternExpandedId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .patternSkipped(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .patternSkipped(v) + } + }() + case 11: try { + var v: BuildEventStream_BuildEventId.UnstructuredCommandLineId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .unstructuredCommandLine(let m) = current {v = m} } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .unstructuredCommandLine(v) + } + }() + case 12: try { + var v: BuildEventStream_BuildEventId.OptionsParsedId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .optionsParsed(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .optionsParsed(v) + } + }() + case 13: try { + var v: BuildEventStream_BuildEventId.NamedSetOfFilesId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .namedSet(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .namedSet(v) + } + }() + case 14: try { + var v: BuildEventStream_BuildEventId.WorkspaceStatusId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .workspaceStatus(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .workspaceStatus(v) + } + }() + case 15: try { + var v: BuildEventStream_BuildEventId.ConfigurationId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .configuration(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .configuration(v) + } + }() + case 16: try { + var v: BuildEventStream_BuildEventId.TargetConfiguredId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .targetConfigured(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .targetConfigured(v) + } + }() + case 17: try { + var v: BuildEventStream_BuildEventId.FetchId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .fetch(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .fetch(v) + } + }() + case 18: try { + var v: BuildEventStream_BuildEventId.StructuredCommandLineId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .structuredCommandLine(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .structuredCommandLine(v) + } + }() + case 19: try { + var v: BuildEventStream_BuildEventId.UnconfiguredLabelId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .unconfiguredLabel(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .unconfiguredLabel(v) + } + }() + case 20: try { + var v: BuildEventStream_BuildEventId.BuildToolLogsId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .buildToolLogs(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .buildToolLogs(v) + } + }() + case 21: try { + var v: BuildEventStream_BuildEventId.ConfiguredLabelId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .configuredLabel(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .configuredLabel(v) + } + }() + case 22: try { + var v: BuildEventStream_BuildEventId.BuildMetricsId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .buildMetrics(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .buildMetrics(v) + } + }() + case 23: try { + var v: BuildEventStream_BuildEventId.WorkspaceConfigId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .workspace(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .workspace(v) + } + }() + case 24: try { + var v: BuildEventStream_BuildEventId.BuildMetadataId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .buildMetadata(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .buildMetadata(v) + } + }() + case 25: try { + var v: BuildEventStream_BuildEventId.ConvenienceSymlinksIdentifiedId? + var hadOneofValue = false + if let current = self.id { + hadOneofValue = true + if case .convenienceSymlinksIdentified(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.id = .convenienceSymlinksIdentified(v) + } + }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - switch _storage._id { - case .unknown(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - case .progress(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - case .started(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - case .pattern(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - case .targetCompleted(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - case .actionCompleted(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - case .testSummary(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - case .testResult(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - case .buildFinished(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - case .patternSkipped(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - case .unstructuredCommandLine(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - case .optionsParsed(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - case .namedSet(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 13) - case .workspaceStatus(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 14) - case .configuration(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - case .targetConfigured(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 16) - case .fetch(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 17) - case .structuredCommandLine(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 18) - case .unconfiguredLabel(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 19) - case .buildToolLogs(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 20) - case .configuredLabel(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 21) - case .buildMetrics(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 22) - case .workspace(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 23) - case .buildMetadata(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 24) - case .convenienceSymlinksIdentified(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 25) - case nil: break - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + switch self.id { + case .unknown?: try { + guard case .unknown(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + }() + case .progress?: try { + guard case .progress(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + }() + case .started?: try { + guard case .started(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + }() + case .pattern?: try { + guard case .pattern(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + }() + case .targetCompleted?: try { + guard case .targetCompleted(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + }() + case .actionCompleted?: try { + guard case .actionCompleted(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + }() + case .testSummary?: try { + guard case .testSummary(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + }() + case .testResult?: try { + guard case .testResult(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + }() + case .buildFinished?: try { + guard case .buildFinished(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + }() + case .patternSkipped?: try { + guard case .patternSkipped(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + }() + case .unstructuredCommandLine?: try { + guard case .unstructuredCommandLine(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + }() + case .optionsParsed?: try { + guard case .optionsParsed(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + }() + case .namedSet?: try { + guard case .namedSet(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 13) + }() + case .workspaceStatus?: try { + guard case .workspaceStatus(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 14) + }() + case .configuration?: try { + guard case .configuration(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + }() + case .targetConfigured?: try { + guard case .targetConfigured(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 16) + }() + case .fetch?: try { + guard case .fetch(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 17) + }() + case .structuredCommandLine?: try { + guard case .structuredCommandLine(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + }() + case .unconfiguredLabel?: try { + guard case .unconfiguredLabel(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + }() + case .buildToolLogs?: try { + guard case .buildToolLogs(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 20) + }() + case .configuredLabel?: try { + guard case .configuredLabel(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 21) + }() + case .buildMetrics?: try { + guard case .buildMetrics(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 22) + }() + case .workspace?: try { + guard case .workspace(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 23) + }() + case .buildMetadata?: try { + guard case .buildMetadata(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 24) + }() + case .convenienceSymlinksIdentified?: try { + guard case .convenienceSymlinksIdentified(let v)? = self.id else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 25) + }() + case nil: break } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildEventId, rhs: BuildEventStream_BuildEventId) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._id != rhs_storage._id {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.id != rhs.id {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -2378,8 +2923,11 @@ extension BuildEventStream_BuildEventId.UnknownBuildEventId: SwiftProtobuf.Messa public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.details) + case 1: try { try decoder.decodeSingularStringField(value: &self.details) }() default: break } } @@ -2407,8 +2955,11 @@ extension BuildEventStream_BuildEventId.ProgressId: SwiftProtobuf.Message, Swift public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularInt32Field(value: &self.opaqueCount) + case 1: try { try decoder.decodeSingularInt32Field(value: &self.opaqueCount) }() default: break } } @@ -2474,8 +3025,11 @@ extension BuildEventStream_BuildEventId.StructuredCommandLineId: SwiftProtobuf.M public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.commandLineLabel) + case 1: try { try decoder.decodeSingularStringField(value: &self.commandLineLabel) }() default: break } } @@ -2541,8 +3095,11 @@ extension BuildEventStream_BuildEventId.FetchId: SwiftProtobuf.Message, SwiftPro public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.url) + case 1: try { try decoder.decodeSingularStringField(value: &self.url) }() default: break } } @@ -2570,8 +3127,11 @@ extension BuildEventStream_BuildEventId.PatternExpandedId: SwiftProtobuf.Message public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeRepeatedStringField(value: &self.pattern) + case 1: try { try decoder.decodeRepeatedStringField(value: &self.pattern) }() default: break } } @@ -2638,9 +3198,12 @@ extension BuildEventStream_BuildEventId.TargetConfiguredId: SwiftProtobuf.Messag public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.label) - case 2: try decoder.decodeSingularStringField(value: &self.aspect) + case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.aspect) }() default: break } } @@ -2672,8 +3235,11 @@ extension BuildEventStream_BuildEventId.NamedSetOfFilesId: SwiftProtobuf.Message public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.id) + case 1: try { try decoder.decodeSingularStringField(value: &self.id) }() default: break } } @@ -2701,8 +3267,11 @@ extension BuildEventStream_BuildEventId.ConfigurationId: SwiftProtobuf.Message, public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.id) + case 1: try { try decoder.decodeSingularStringField(value: &self.id) }() default: break } } @@ -2730,70 +3299,41 @@ extension BuildEventStream_BuildEventId.TargetCompletedId: SwiftProtobuf.Message 2: .same(proto: "aspect"), ] - fileprivate class _StorageClass { - var _label: String = String() - var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil - var _aspect: String = String() - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _label = source._label - _configuration = source._configuration - _aspect = source._aspect - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &_storage._label) - case 2: try decoder.decodeSingularStringField(value: &_storage._aspect) - case 3: try decoder.decodeSingularMessageField(value: &_storage._configuration) - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.aspect) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._configuration) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if !_storage._label.isEmpty { - try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 1) - } - if !_storage._aspect.isEmpty { - try visitor.visitSingularStringField(value: _storage._aspect, fieldNumber: 2) - } - if let v = _storage._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.label.isEmpty { + try visitor.visitSingularStringField(value: self.label, fieldNumber: 1) + } + if !self.aspect.isEmpty { + try visitor.visitSingularStringField(value: self.aspect, fieldNumber: 2) } + try { if let v = self._configuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildEventId.TargetCompletedId, rhs: BuildEventStream_BuildEventId.TargetCompletedId) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._label != rhs_storage._label {return false} - if _storage._configuration != rhs_storage._configuration {return false} - if _storage._aspect != rhs_storage._aspect {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.label != rhs.label {return false} + if lhs._configuration != rhs._configuration {return false} + if lhs.aspect != rhs.aspect {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -2807,70 +3347,41 @@ extension BuildEventStream_BuildEventId.ActionCompletedId: SwiftProtobuf.Message 3: .same(proto: "configuration"), ] - fileprivate class _StorageClass { - var _primaryOutput: String = String() - var _label: String = String() - var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _primaryOutput = source._primaryOutput - _label = source._label - _configuration = source._configuration - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &_storage._primaryOutput) - case 2: try decoder.decodeSingularStringField(value: &_storage._label) - case 3: try decoder.decodeSingularMessageField(value: &_storage._configuration) - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.primaryOutput) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.label) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._configuration) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if !_storage._primaryOutput.isEmpty { - try visitor.visitSingularStringField(value: _storage._primaryOutput, fieldNumber: 1) - } - if !_storage._label.isEmpty { - try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 2) - } - if let v = _storage._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.primaryOutput.isEmpty { + try visitor.visitSingularStringField(value: self.primaryOutput, fieldNumber: 1) + } + if !self.label.isEmpty { + try visitor.visitSingularStringField(value: self.label, fieldNumber: 2) } + try { if let v = self._configuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildEventId.ActionCompletedId, rhs: BuildEventStream_BuildEventId.ActionCompletedId) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._primaryOutput != rhs_storage._primaryOutput {return false} - if _storage._label != rhs_storage._label {return false} - if _storage._configuration != rhs_storage._configuration {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.primaryOutput != rhs.primaryOutput {return false} + if lhs.label != rhs.label {return false} + if lhs._configuration != rhs._configuration {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -2884,8 +3395,11 @@ extension BuildEventStream_BuildEventId.UnconfiguredLabelId: SwiftProtobuf.Messa public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.label) + case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() default: break } } @@ -2912,63 +3426,36 @@ extension BuildEventStream_BuildEventId.ConfiguredLabelId: SwiftProtobuf.Message 2: .same(proto: "configuration"), ] - fileprivate class _StorageClass { - var _label: String = String() - var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _label = source._label - _configuration = source._configuration - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &_storage._label) - case 2: try decoder.decodeSingularMessageField(value: &_storage._configuration) - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._configuration) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if !_storage._label.isEmpty { - try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 1) - } - if let v = _storage._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.label.isEmpty { + try visitor.visitSingularStringField(value: self.label, fieldNumber: 1) } + try { if let v = self._configuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildEventId.ConfiguredLabelId, rhs: BuildEventStream_BuildEventId.ConfiguredLabelId) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._label != rhs_storage._label {return false} - if _storage._configuration != rhs_storage._configuration {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.label != rhs.label {return false} + if lhs._configuration != rhs._configuration {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -2984,84 +3471,51 @@ extension BuildEventStream_BuildEventId.TestResultId: SwiftProtobuf.Message, Swi 4: .same(proto: "attempt"), ] - fileprivate class _StorageClass { - var _label: String = String() - var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil - var _run: Int32 = 0 - var _shard: Int32 = 0 - var _attempt: Int32 = 0 - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _label = source._label - _configuration = source._configuration - _run = source._run - _shard = source._shard - _attempt = source._attempt - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &_storage._label) - case 2: try decoder.decodeSingularInt32Field(value: &_storage._run) - case 3: try decoder.decodeSingularInt32Field(value: &_storage._shard) - case 4: try decoder.decodeSingularInt32Field(value: &_storage._attempt) - case 5: try decoder.decodeSingularMessageField(value: &_storage._configuration) - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.run) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self.shard) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self.attempt) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._configuration) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if !_storage._label.isEmpty { - try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 1) - } - if _storage._run != 0 { - try visitor.visitSingularInt32Field(value: _storage._run, fieldNumber: 2) - } - if _storage._shard != 0 { - try visitor.visitSingularInt32Field(value: _storage._shard, fieldNumber: 3) - } - if _storage._attempt != 0 { - try visitor.visitSingularInt32Field(value: _storage._attempt, fieldNumber: 4) - } - if let v = _storage._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.label.isEmpty { + try visitor.visitSingularStringField(value: self.label, fieldNumber: 1) } + if self.run != 0 { + try visitor.visitSingularInt32Field(value: self.run, fieldNumber: 2) + } + if self.shard != 0 { + try visitor.visitSingularInt32Field(value: self.shard, fieldNumber: 3) + } + if self.attempt != 0 { + try visitor.visitSingularInt32Field(value: self.attempt, fieldNumber: 4) + } + try { if let v = self._configuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildEventId.TestResultId, rhs: BuildEventStream_BuildEventId.TestResultId) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._label != rhs_storage._label {return false} - if _storage._configuration != rhs_storage._configuration {return false} - if _storage._run != rhs_storage._run {return false} - if _storage._shard != rhs_storage._shard {return false} - if _storage._attempt != rhs_storage._attempt {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.label != rhs.label {return false} + if lhs._configuration != rhs._configuration {return false} + if lhs.run != rhs.run {return false} + if lhs.shard != rhs.shard {return false} + if lhs.attempt != rhs.attempt {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3074,63 +3528,36 @@ extension BuildEventStream_BuildEventId.TestSummaryId: SwiftProtobuf.Message, Sw 2: .same(proto: "configuration"), ] - fileprivate class _StorageClass { - var _label: String = String() - var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _label = source._label - _configuration = source._configuration - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &_storage._label) - case 2: try decoder.decodeSingularMessageField(value: &_storage._configuration) - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._configuration) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if !_storage._label.isEmpty { - try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 1) - } - if let v = _storage._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.label.isEmpty { + try visitor.visitSingularStringField(value: self.label, fieldNumber: 1) } + try { if let v = self._configuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildEventId.TestSummaryId, rhs: BuildEventStream_BuildEventId.TestSummaryId) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._label != rhs_storage._label {return false} - if _storage._configuration != rhs_storage._configuration {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.label != rhs.label {return false} + if lhs._configuration != rhs._configuration {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3221,9 +3648,12 @@ extension BuildEventStream_Progress: SwiftProtobuf.Message, SwiftProtobuf._Messa public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.stdout) - case 2: try decoder.decodeSingularStringField(value: &self.stderr) + case 1: try { try decoder.decodeSingularStringField(value: &self.stdout) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.stderr) }() default: break } } @@ -3256,9 +3686,12 @@ extension BuildEventStream_Aborted: SwiftProtobuf.Message, SwiftProtobuf._Messag public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.reason) - case 2: try decoder.decodeSingularStringField(value: &self.description_p) + case 1: try { try decoder.decodeSingularEnumField(value: &self.reason) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.description_p) }() default: break } } @@ -3295,6 +3728,7 @@ extension BuildEventStream_Aborted.AbortReason: SwiftProtobuf._ProtoNameProvidin 8: .same(proto: "NO_ANALYZE"), 9: .same(proto: "NO_BUILD"), 10: .same(proto: "INCOMPLETE"), + 11: .same(proto: "OUT_OF_MEMORY"), ] } @@ -3313,15 +3747,18 @@ extension BuildEventStream_BuildStarted: SwiftProtobuf.Message, SwiftProtobuf._M public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.uuid) - case 2: try decoder.decodeSingularInt64Field(value: &self.startTimeMillis) - case 3: try decoder.decodeSingularStringField(value: &self.buildToolVersion) - case 4: try decoder.decodeSingularStringField(value: &self.optionsDescription) - case 5: try decoder.decodeSingularStringField(value: &self.command) - case 6: try decoder.decodeSingularStringField(value: &self.workingDirectory) - case 7: try decoder.decodeSingularStringField(value: &self.workspaceDirectory) - case 8: try decoder.decodeSingularInt64Field(value: &self.serverPid) + case 1: try { try decoder.decodeSingularStringField(value: &self.uuid) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.startTimeMillis) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.buildToolVersion) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.optionsDescription) }() + case 5: try { try decoder.decodeSingularStringField(value: &self.command) }() + case 6: try { try decoder.decodeSingularStringField(value: &self.workingDirectory) }() + case 7: try { try decoder.decodeSingularStringField(value: &self.workspaceDirectory) }() + case 8: try { try decoder.decodeSingularInt64Field(value: &self.serverPid) }() default: break } } @@ -3377,8 +3814,11 @@ extension BuildEventStream_WorkspaceConfig: SwiftProtobuf.Message, SwiftProtobuf public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.localExecRoot) + case 1: try { try decoder.decodeSingularStringField(value: &self.localExecRoot) }() default: break } } @@ -3406,8 +3846,11 @@ extension BuildEventStream_UnstructuredCommandLine: SwiftProtobuf.Message, Swift public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeRepeatedStringField(value: &self.args) + case 1: try { try decoder.decodeRepeatedStringField(value: &self.args) }() default: break } } @@ -3438,91 +3881,56 @@ extension BuildEventStream_OptionsParsed: SwiftProtobuf.Message, SwiftProtobuf._ 6: .standard(proto: "tool_tag"), ] - fileprivate class _StorageClass { - var _startupOptions: [String] = [] - var _explicitStartupOptions: [String] = [] - var _cmdLine: [String] = [] - var _explicitCmdLine: [String] = [] - var _invocationPolicy: src_main_protobuf_invocation_policy_proto.Blaze_InvocationPolicy_InvocationPolicy? = nil - var _toolTag: String = String() - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _startupOptions = source._startupOptions - _explicitStartupOptions = source._explicitStartupOptions - _cmdLine = source._cmdLine - _explicitCmdLine = source._explicitCmdLine - _invocationPolicy = source._invocationPolicy - _toolTag = source._toolTag - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeRepeatedStringField(value: &_storage._startupOptions) - case 2: try decoder.decodeRepeatedStringField(value: &_storage._explicitStartupOptions) - case 3: try decoder.decodeRepeatedStringField(value: &_storage._cmdLine) - case 4: try decoder.decodeRepeatedStringField(value: &_storage._explicitCmdLine) - case 5: try decoder.decodeSingularMessageField(value: &_storage._invocationPolicy) - case 6: try decoder.decodeSingularStringField(value: &_storage._toolTag) - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedStringField(value: &self.startupOptions) }() + case 2: try { try decoder.decodeRepeatedStringField(value: &self.explicitStartupOptions) }() + case 3: try { try decoder.decodeRepeatedStringField(value: &self.cmdLine) }() + case 4: try { try decoder.decodeRepeatedStringField(value: &self.explicitCmdLine) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._invocationPolicy) }() + case 6: try { try decoder.decodeSingularStringField(value: &self.toolTag) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if !_storage._startupOptions.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._startupOptions, fieldNumber: 1) - } - if !_storage._explicitStartupOptions.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._explicitStartupOptions, fieldNumber: 2) - } - if !_storage._cmdLine.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._cmdLine, fieldNumber: 3) - } - if !_storage._explicitCmdLine.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._explicitCmdLine, fieldNumber: 4) - } - if let v = _storage._invocationPolicy { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } - if !_storage._toolTag.isEmpty { - try visitor.visitSingularStringField(value: _storage._toolTag, fieldNumber: 6) - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.startupOptions.isEmpty { + try visitor.visitRepeatedStringField(value: self.startupOptions, fieldNumber: 1) + } + if !self.explicitStartupOptions.isEmpty { + try visitor.visitRepeatedStringField(value: self.explicitStartupOptions, fieldNumber: 2) + } + if !self.cmdLine.isEmpty { + try visitor.visitRepeatedStringField(value: self.cmdLine, fieldNumber: 3) + } + if !self.explicitCmdLine.isEmpty { + try visitor.visitRepeatedStringField(value: self.explicitCmdLine, fieldNumber: 4) + } + try { if let v = self._invocationPolicy { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + if !self.toolTag.isEmpty { + try visitor.visitSingularStringField(value: self.toolTag, fieldNumber: 6) } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_OptionsParsed, rhs: BuildEventStream_OptionsParsed) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._startupOptions != rhs_storage._startupOptions {return false} - if _storage._explicitStartupOptions != rhs_storage._explicitStartupOptions {return false} - if _storage._cmdLine != rhs_storage._cmdLine {return false} - if _storage._explicitCmdLine != rhs_storage._explicitCmdLine {return false} - if _storage._invocationPolicy != rhs_storage._invocationPolicy {return false} - if _storage._toolTag != rhs_storage._toolTag {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.startupOptions != rhs.startupOptions {return false} + if lhs.explicitStartupOptions != rhs.explicitStartupOptions {return false} + if lhs.cmdLine != rhs.cmdLine {return false} + if lhs.explicitCmdLine != rhs.explicitCmdLine {return false} + if lhs._invocationPolicy != rhs._invocationPolicy {return false} + if lhs.toolTag != rhs.toolTag {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3536,8 +3944,11 @@ extension BuildEventStream_Fetch: SwiftProtobuf.Message, SwiftProtobuf._MessageI public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularBoolField(value: &self.success) + case 1: try { try decoder.decodeSingularBoolField(value: &self.success) }() default: break } } @@ -3565,8 +3976,11 @@ extension BuildEventStream_WorkspaceStatus: SwiftProtobuf.Message, SwiftProtobuf public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeRepeatedMessageField(value: &self.item) + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.item) }() default: break } } @@ -3595,9 +4009,12 @@ extension BuildEventStream_WorkspaceStatus.Item: SwiftProtobuf.Message, SwiftPro public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.key) - case 2: try decoder.decodeSingularStringField(value: &self.value) + case 1: try { try decoder.decodeSingularStringField(value: &self.key) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.value) }() default: break } } @@ -3629,8 +4046,11 @@ extension BuildEventStream_BuildMetadata: SwiftProtobuf.Message, SwiftProtobuf._ public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.metadata) + case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.metadata) }() default: break } } @@ -3661,11 +4081,14 @@ extension BuildEventStream_Configuration: SwiftProtobuf.Message, SwiftProtobuf._ public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.mnemonic) - case 2: try decoder.decodeSingularStringField(value: &self.platformName) - case 3: try decoder.decodeSingularStringField(value: &self.cpu) - case 4: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.makeVariable) + case 1: try { try decoder.decodeSingularStringField(value: &self.mnemonic) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.platformName) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.cpu) }() + case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.makeVariable) }() default: break } } @@ -3726,10 +4149,13 @@ extension BuildEventStream_TargetConfigured: SwiftProtobuf.Message, SwiftProtobu public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.targetKind) - case 2: try decoder.decodeSingularEnumField(value: &self.testSize) - case 3: try decoder.decodeRepeatedStringField(value: &self.tag) + case 1: try { try decoder.decodeSingularStringField(value: &self.targetKind) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.testSize) }() + case 3: try { try decoder.decodeRepeatedStringField(value: &self.tag) }() default: break } } @@ -3768,33 +4194,50 @@ extension BuildEventStream_File: SwiftProtobuf.Message, SwiftProtobuf._MessageIm public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.name) - case 2: - if self.file != nil {try decoder.handleConflictingOneOf()} + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { var v: String? try decoder.decodeSingularStringField(value: &v) - if let v = v {self.file = .uri(v)} - case 3: - if self.file != nil {try decoder.handleConflictingOneOf()} + if let v = v { + if self.file != nil {try decoder.handleConflictingOneOf()} + self.file = .uri(v) + } + }() + case 3: try { var v: Data? try decoder.decodeSingularBytesField(value: &v) - if let v = v {self.file = .contents(v)} - case 4: try decoder.decodeRepeatedStringField(value: &self.pathPrefix) + if let v = v { + if self.file != nil {try decoder.handleConflictingOneOf()} + self.file = .contents(v) + } + }() + case 4: try { try decoder.decodeRepeatedStringField(value: &self.pathPrefix) }() default: break } } } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if !self.name.isEmpty { try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) } switch self.file { - case .uri(let v)?: + case .uri?: try { + guard case .uri(let v)? = self.file else { preconditionFailure() } try visitor.visitSingularStringField(value: v, fieldNumber: 2) - case .contents(let v)?: + }() + case .contents?: try { + guard case .contents(let v)? = self.file else { preconditionFailure() } try visitor.visitSingularBytesField(value: v, fieldNumber: 3) + }() case nil: break } if !self.pathPrefix.isEmpty { @@ -3821,9 +4264,12 @@ extension BuildEventStream_NamedSetOfFiles: SwiftProtobuf.Message, SwiftProtobuf public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeRepeatedMessageField(value: &self.files) - case 2: try decoder.decodeRepeatedMessageField(value: &self.fileSets) + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.files) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.fileSets) }() default: break } } @@ -3874,7 +4320,7 @@ extension BuildEventStream_ActionExecuted: SwiftProtobuf.Message, SwiftProtobuf. var _primaryOutput: BuildEventStream_File? = nil var _commandLine: [String] = [] var _actionMetadataLogs: [BuildEventStream_File] = [] - var _failureDetail: src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail? = nil + var _failureDetail: FailureDetails_FailureDetail? = nil static let defaultInstance = _StorageClass() @@ -3906,18 +4352,21 @@ extension BuildEventStream_ActionExecuted: SwiftProtobuf.Message, SwiftProtobuf. _ = _uniqueStorage() try withExtendedLifetime(_storage) { (_storage: _StorageClass) in while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularBoolField(value: &_storage._success) - case 2: try decoder.decodeSingularInt32Field(value: &_storage._exitCode) - case 3: try decoder.decodeSingularMessageField(value: &_storage._stdout) - case 4: try decoder.decodeSingularMessageField(value: &_storage._stderr) - case 5: try decoder.decodeSingularStringField(value: &_storage._label) - case 6: try decoder.decodeSingularMessageField(value: &_storage._primaryOutput) - case 7: try decoder.decodeSingularMessageField(value: &_storage._configuration) - case 8: try decoder.decodeSingularStringField(value: &_storage._type) - case 9: try decoder.decodeRepeatedStringField(value: &_storage._commandLine) - case 10: try decoder.decodeRepeatedMessageField(value: &_storage._actionMetadataLogs) - case 11: try decoder.decodeSingularMessageField(value: &_storage._failureDetail) + case 1: try { try decoder.decodeSingularBoolField(value: &_storage._success) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &_storage._exitCode) }() + case 3: try { try decoder.decodeSingularMessageField(value: &_storage._stdout) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._stderr) }() + case 5: try { try decoder.decodeSingularStringField(value: &_storage._label) }() + case 6: try { try decoder.decodeSingularMessageField(value: &_storage._primaryOutput) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._configuration) }() + case 8: try { try decoder.decodeSingularStringField(value: &_storage._type) }() + case 9: try { try decoder.decodeRepeatedStringField(value: &_storage._commandLine) }() + case 10: try { try decoder.decodeRepeatedMessageField(value: &_storage._actionMetadataLogs) }() + case 11: try { try decoder.decodeSingularMessageField(value: &_storage._failureDetail) }() default: break } } @@ -3926,27 +4375,31 @@ extension BuildEventStream_ActionExecuted: SwiftProtobuf.Message, SwiftProtobuf. public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if _storage._success != false { try visitor.visitSingularBoolField(value: _storage._success, fieldNumber: 1) } if _storage._exitCode != 0 { try visitor.visitSingularInt32Field(value: _storage._exitCode, fieldNumber: 2) } - if let v = _storage._stdout { + try { if let v = _storage._stdout { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = _storage._stderr { + } }() + try { if let v = _storage._stderr { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } + } }() if !_storage._label.isEmpty { try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 5) } - if let v = _storage._primaryOutput { + try { if let v = _storage._primaryOutput { try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } - if let v = _storage._configuration { + } }() + try { if let v = _storage._configuration { try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } + } }() if !_storage._type.isEmpty { try visitor.visitSingularStringField(value: _storage._type, fieldNumber: 8) } @@ -3956,9 +4409,9 @@ extension BuildEventStream_ActionExecuted: SwiftProtobuf.Message, SwiftProtobuf. if !_storage._actionMetadataLogs.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._actionMetadataLogs, fieldNumber: 10) } - if let v = _storage._failureDetail { + try { if let v = _storage._failureDetail { try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } + } }() } try unknownFields.traverse(visitor: &visitor) } @@ -3997,9 +4450,12 @@ extension BuildEventStream_OutputGroup: SwiftProtobuf.Message, SwiftProtobuf._Me public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.name) - case 3: try decoder.decodeRepeatedMessageField(value: &self.fileSets) + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.fileSets) }() default: break } } @@ -4037,112 +4493,71 @@ extension BuildEventStream_TargetComplete: SwiftProtobuf.Message, SwiftProtobuf. 9: .standard(proto: "failure_detail"), ] - fileprivate class _StorageClass { - var _success: Bool = false - var _targetKind: String = String() - var _testSize: BuildEventStream_TestSize = .unknown - var _outputGroup: [BuildEventStream_OutputGroup] = [] - var _importantOutput: [BuildEventStream_File] = [] - var _directoryOutput: [BuildEventStream_File] = [] - var _tag: [String] = [] - var _testTimeoutSeconds: Int64 = 0 - var _failureDetail: src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _success = source._success - _targetKind = source._targetKind - _testSize = source._testSize - _outputGroup = source._outputGroup - _importantOutput = source._importantOutput - _directoryOutput = source._directoryOutput - _tag = source._tag - _testTimeoutSeconds = source._testTimeoutSeconds - _failureDetail = source._failureDetail - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularBoolField(value: &_storage._success) - case 2: try decoder.decodeRepeatedMessageField(value: &_storage._outputGroup) - case 3: try decoder.decodeRepeatedStringField(value: &_storage._tag) - case 4: try decoder.decodeRepeatedMessageField(value: &_storage._importantOutput) - case 5: try decoder.decodeSingularStringField(value: &_storage._targetKind) - case 6: try decoder.decodeSingularEnumField(value: &_storage._testSize) - case 7: try decoder.decodeSingularInt64Field(value: &_storage._testTimeoutSeconds) - case 8: try decoder.decodeRepeatedMessageField(value: &_storage._directoryOutput) - case 9: try decoder.decodeSingularMessageField(value: &_storage._failureDetail) - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.success) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.outputGroup) }() + case 3: try { try decoder.decodeRepeatedStringField(value: &self.tag) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.importantOutput) }() + case 5: try { try decoder.decodeSingularStringField(value: &self.targetKind) }() + case 6: try { try decoder.decodeSingularEnumField(value: &self.testSize) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self.testTimeoutSeconds) }() + case 8: try { try decoder.decodeRepeatedMessageField(value: &self.directoryOutput) }() + case 9: try { try decoder.decodeSingularMessageField(value: &self._failureDetail) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if _storage._success != false { - try visitor.visitSingularBoolField(value: _storage._success, fieldNumber: 1) - } - if !_storage._outputGroup.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._outputGroup, fieldNumber: 2) - } - if !_storage._tag.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._tag, fieldNumber: 3) - } - if !_storage._importantOutput.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._importantOutput, fieldNumber: 4) - } - if !_storage._targetKind.isEmpty { - try visitor.visitSingularStringField(value: _storage._targetKind, fieldNumber: 5) - } - if _storage._testSize != .unknown { - try visitor.visitSingularEnumField(value: _storage._testSize, fieldNumber: 6) - } - if _storage._testTimeoutSeconds != 0 { - try visitor.visitSingularInt64Field(value: _storage._testTimeoutSeconds, fieldNumber: 7) - } - if !_storage._directoryOutput.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._directoryOutput, fieldNumber: 8) - } - if let v = _storage._failureDetail { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.success != false { + try visitor.visitSingularBoolField(value: self.success, fieldNumber: 1) + } + if !self.outputGroup.isEmpty { + try visitor.visitRepeatedMessageField(value: self.outputGroup, fieldNumber: 2) + } + if !self.tag.isEmpty { + try visitor.visitRepeatedStringField(value: self.tag, fieldNumber: 3) + } + if !self.importantOutput.isEmpty { + try visitor.visitRepeatedMessageField(value: self.importantOutput, fieldNumber: 4) + } + if !self.targetKind.isEmpty { + try visitor.visitSingularStringField(value: self.targetKind, fieldNumber: 5) + } + if self.testSize != .unknown { + try visitor.visitSingularEnumField(value: self.testSize, fieldNumber: 6) + } + if self.testTimeoutSeconds != 0 { + try visitor.visitSingularInt64Field(value: self.testTimeoutSeconds, fieldNumber: 7) + } + if !self.directoryOutput.isEmpty { + try visitor.visitRepeatedMessageField(value: self.directoryOutput, fieldNumber: 8) } + try { if let v = self._failureDetail { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_TargetComplete, rhs: BuildEventStream_TargetComplete) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._success != rhs_storage._success {return false} - if _storage._targetKind != rhs_storage._targetKind {return false} - if _storage._testSize != rhs_storage._testSize {return false} - if _storage._outputGroup != rhs_storage._outputGroup {return false} - if _storage._importantOutput != rhs_storage._importantOutput {return false} - if _storage._directoryOutput != rhs_storage._directoryOutput {return false} - if _storage._tag != rhs_storage._tag {return false} - if _storage._testTimeoutSeconds != rhs_storage._testTimeoutSeconds {return false} - if _storage._failureDetail != rhs_storage._failureDetail {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.success != rhs.success {return false} + if lhs.targetKind != rhs.targetKind {return false} + if lhs.testSize != rhs.testSize {return false} + if lhs.outputGroup != rhs.outputGroup {return false} + if lhs.importantOutput != rhs.importantOutput {return false} + if lhs.directoryOutput != rhs.directoryOutput {return false} + if lhs.tag != rhs.tag {return false} + if lhs.testTimeoutSeconds != rhs.testTimeoutSeconds {return false} + if lhs._failureDetail != rhs._failureDetail {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -4161,105 +4576,66 @@ extension BuildEventStream_TestResult: SwiftProtobuf.Message, SwiftProtobuf._Mes 8: .standard(proto: "execution_info"), ] - fileprivate class _StorageClass { - var _status: BuildEventStream_TestStatus = .noStatus - var _statusDetails: String = String() - var _cachedLocally: Bool = false - var _testAttemptStartMillisEpoch: Int64 = 0 - var _testAttemptDurationMillis: Int64 = 0 - var _testActionOutput: [BuildEventStream_File] = [] - var _warning: [String] = [] - var _executionInfo: BuildEventStream_TestResult.ExecutionInfo? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _status = source._status - _statusDetails = source._statusDetails - _cachedLocally = source._cachedLocally - _testAttemptStartMillisEpoch = source._testAttemptStartMillisEpoch - _testAttemptDurationMillis = source._testAttemptDurationMillis - _testActionOutput = source._testActionOutput - _warning = source._warning - _executionInfo = source._executionInfo - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 2: try decoder.decodeRepeatedMessageField(value: &_storage._testActionOutput) - case 3: try decoder.decodeSingularInt64Field(value: &_storage._testAttemptDurationMillis) - case 4: try decoder.decodeSingularBoolField(value: &_storage._cachedLocally) - case 5: try decoder.decodeSingularEnumField(value: &_storage._status) - case 6: try decoder.decodeSingularInt64Field(value: &_storage._testAttemptStartMillisEpoch) - case 7: try decoder.decodeRepeatedStringField(value: &_storage._warning) - case 8: try decoder.decodeSingularMessageField(value: &_storage._executionInfo) - case 9: try decoder.decodeSingularStringField(value: &_storage._statusDetails) - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.testActionOutput) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.testAttemptDurationMillis) }() + case 4: try { try decoder.decodeSingularBoolField(value: &self.cachedLocally) }() + case 5: try { try decoder.decodeSingularEnumField(value: &self.status) }() + case 6: try { try decoder.decodeSingularInt64Field(value: &self.testAttemptStartMillisEpoch) }() + case 7: try { try decoder.decodeRepeatedStringField(value: &self.warning) }() + case 8: try { try decoder.decodeSingularMessageField(value: &self._executionInfo) }() + case 9: try { try decoder.decodeSingularStringField(value: &self.statusDetails) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if !_storage._testActionOutput.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._testActionOutput, fieldNumber: 2) - } - if _storage._testAttemptDurationMillis != 0 { - try visitor.visitSingularInt64Field(value: _storage._testAttemptDurationMillis, fieldNumber: 3) - } - if _storage._cachedLocally != false { - try visitor.visitSingularBoolField(value: _storage._cachedLocally, fieldNumber: 4) - } - if _storage._status != .noStatus { - try visitor.visitSingularEnumField(value: _storage._status, fieldNumber: 5) - } - if _storage._testAttemptStartMillisEpoch != 0 { - try visitor.visitSingularInt64Field(value: _storage._testAttemptStartMillisEpoch, fieldNumber: 6) - } - if !_storage._warning.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._warning, fieldNumber: 7) - } - if let v = _storage._executionInfo { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } - if !_storage._statusDetails.isEmpty { - try visitor.visitSingularStringField(value: _storage._statusDetails, fieldNumber: 9) - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.testActionOutput.isEmpty { + try visitor.visitRepeatedMessageField(value: self.testActionOutput, fieldNumber: 2) + } + if self.testAttemptDurationMillis != 0 { + try visitor.visitSingularInt64Field(value: self.testAttemptDurationMillis, fieldNumber: 3) + } + if self.cachedLocally != false { + try visitor.visitSingularBoolField(value: self.cachedLocally, fieldNumber: 4) + } + if self.status != .noStatus { + try visitor.visitSingularEnumField(value: self.status, fieldNumber: 5) + } + if self.testAttemptStartMillisEpoch != 0 { + try visitor.visitSingularInt64Field(value: self.testAttemptStartMillisEpoch, fieldNumber: 6) + } + if !self.warning.isEmpty { + try visitor.visitRepeatedStringField(value: self.warning, fieldNumber: 7) + } + try { if let v = self._executionInfo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + if !self.statusDetails.isEmpty { + try visitor.visitSingularStringField(value: self.statusDetails, fieldNumber: 9) } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_TestResult, rhs: BuildEventStream_TestResult) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._status != rhs_storage._status {return false} - if _storage._statusDetails != rhs_storage._statusDetails {return false} - if _storage._cachedLocally != rhs_storage._cachedLocally {return false} - if _storage._testAttemptStartMillisEpoch != rhs_storage._testAttemptStartMillisEpoch {return false} - if _storage._testAttemptDurationMillis != rhs_storage._testAttemptDurationMillis {return false} - if _storage._testActionOutput != rhs_storage._testActionOutput {return false} - if _storage._warning != rhs_storage._warning {return false} - if _storage._executionInfo != rhs_storage._executionInfo {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.status != rhs.status {return false} + if lhs.statusDetails != rhs.statusDetails {return false} + if lhs.cachedLocally != rhs.cachedLocally {return false} + if lhs.testAttemptStartMillisEpoch != rhs.testAttemptStartMillisEpoch {return false} + if lhs.testAttemptDurationMillis != rhs.testAttemptDurationMillis {return false} + if lhs.testActionOutput != rhs.testActionOutput {return false} + if lhs.warning != rhs.warning {return false} + if lhs._executionInfo != rhs._executionInfo {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -4277,98 +4653,61 @@ extension BuildEventStream_TestResult.ExecutionInfo: SwiftProtobuf.Message, Swif 5: .standard(proto: "resource_usage"), ] - fileprivate class _StorageClass { - var _timeoutSeconds: Int32 = 0 - var _strategy: String = String() - var _cachedRemotely: Bool = false - var _exitCode: Int32 = 0 - var _hostname: String = String() - var _timingBreakdown: BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown? = nil - var _resourceUsage: [BuildEventStream_TestResult.ExecutionInfo.ResourceUsage] = [] - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _timeoutSeconds = source._timeoutSeconds - _strategy = source._strategy - _cachedRemotely = source._cachedRemotely - _exitCode = source._exitCode - _hostname = source._hostname - _timingBreakdown = source._timingBreakdown - _resourceUsage = source._resourceUsage - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularInt32Field(value: &_storage._timeoutSeconds) - case 2: try decoder.decodeSingularStringField(value: &_storage._strategy) - case 3: try decoder.decodeSingularStringField(value: &_storage._hostname) - case 4: try decoder.decodeSingularMessageField(value: &_storage._timingBreakdown) - case 5: try decoder.decodeRepeatedMessageField(value: &_storage._resourceUsage) - case 6: try decoder.decodeSingularBoolField(value: &_storage._cachedRemotely) - case 7: try decoder.decodeSingularInt32Field(value: &_storage._exitCode) - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self.timeoutSeconds) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.strategy) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.hostname) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._timingBreakdown) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &self.resourceUsage) }() + case 6: try { try decoder.decodeSingularBoolField(value: &self.cachedRemotely) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &self.exitCode) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if _storage._timeoutSeconds != 0 { - try visitor.visitSingularInt32Field(value: _storage._timeoutSeconds, fieldNumber: 1) - } - if !_storage._strategy.isEmpty { - try visitor.visitSingularStringField(value: _storage._strategy, fieldNumber: 2) - } - if !_storage._hostname.isEmpty { - try visitor.visitSingularStringField(value: _storage._hostname, fieldNumber: 3) - } - if let v = _storage._timingBreakdown { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } - if !_storage._resourceUsage.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._resourceUsage, fieldNumber: 5) - } - if _storage._cachedRemotely != false { - try visitor.visitSingularBoolField(value: _storage._cachedRemotely, fieldNumber: 6) - } - if _storage._exitCode != 0 { - try visitor.visitSingularInt32Field(value: _storage._exitCode, fieldNumber: 7) - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.timeoutSeconds != 0 { + try visitor.visitSingularInt32Field(value: self.timeoutSeconds, fieldNumber: 1) + } + if !self.strategy.isEmpty { + try visitor.visitSingularStringField(value: self.strategy, fieldNumber: 2) + } + if !self.hostname.isEmpty { + try visitor.visitSingularStringField(value: self.hostname, fieldNumber: 3) + } + try { if let v = self._timingBreakdown { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + if !self.resourceUsage.isEmpty { + try visitor.visitRepeatedMessageField(value: self.resourceUsage, fieldNumber: 5) + } + if self.cachedRemotely != false { + try visitor.visitSingularBoolField(value: self.cachedRemotely, fieldNumber: 6) + } + if self.exitCode != 0 { + try visitor.visitSingularInt32Field(value: self.exitCode, fieldNumber: 7) } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_TestResult.ExecutionInfo, rhs: BuildEventStream_TestResult.ExecutionInfo) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._timeoutSeconds != rhs_storage._timeoutSeconds {return false} - if _storage._strategy != rhs_storage._strategy {return false} - if _storage._cachedRemotely != rhs_storage._cachedRemotely {return false} - if _storage._exitCode != rhs_storage._exitCode {return false} - if _storage._hostname != rhs_storage._hostname {return false} - if _storage._timingBreakdown != rhs_storage._timingBreakdown {return false} - if _storage._resourceUsage != rhs_storage._resourceUsage {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.timeoutSeconds != rhs.timeoutSeconds {return false} + if lhs.strategy != rhs.strategy {return false} + if lhs.cachedRemotely != rhs.cachedRemotely {return false} + if lhs.exitCode != rhs.exitCode {return false} + if lhs.hostname != rhs.hostname {return false} + if lhs._timingBreakdown != rhs._timingBreakdown {return false} + if lhs.resourceUsage != rhs.resourceUsage {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -4384,10 +4723,13 @@ extension BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown: SwiftProtob public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeRepeatedMessageField(value: &self.child) - case 2: try decoder.decodeSingularStringField(value: &self.name) - case 3: try decoder.decodeSingularInt64Field(value: &self.timeMillis) + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.child) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self.timeMillis) }() default: break } } @@ -4424,9 +4766,12 @@ extension BuildEventStream_TestResult.ExecutionInfo.ResourceUsage: SwiftProtobuf public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.name) - case 2: try decoder.decodeSingularInt64Field(value: &self.value) + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.value) }() default: break } } @@ -4455,6 +4800,8 @@ extension BuildEventStream_TestSummary: SwiftProtobuf.Message, SwiftProtobuf._Me public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 5: .standard(proto: "overall_status"), 1: .standard(proto: "total_run_count"), + 10: .standard(proto: "run_count"), + 11: .standard(proto: "shard_count"), 3: .same(proto: "passed"), 4: .same(proto: "failed"), 6: .standard(proto: "total_num_cached"), @@ -4465,15 +4812,20 @@ extension BuildEventStream_TestSummary: SwiftProtobuf.Message, SwiftProtobuf._Me public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularInt32Field(value: &self.totalRunCount) - case 3: try decoder.decodeRepeatedMessageField(value: &self.passed) - case 4: try decoder.decodeRepeatedMessageField(value: &self.failed) - case 5: try decoder.decodeSingularEnumField(value: &self.overallStatus) - case 6: try decoder.decodeSingularInt32Field(value: &self.totalNumCached) - case 7: try decoder.decodeSingularInt64Field(value: &self.firstStartTimeMillis) - case 8: try decoder.decodeSingularInt64Field(value: &self.lastStopTimeMillis) - case 9: try decoder.decodeSingularInt64Field(value: &self.totalRunDurationMillis) + case 1: try { try decoder.decodeSingularInt32Field(value: &self.totalRunCount) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.passed) }() + case 4: try { try decoder.decodeRepeatedMessageField(value: &self.failed) }() + case 5: try { try decoder.decodeSingularEnumField(value: &self.overallStatus) }() + case 6: try { try decoder.decodeSingularInt32Field(value: &self.totalNumCached) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self.firstStartTimeMillis) }() + case 8: try { try decoder.decodeSingularInt64Field(value: &self.lastStopTimeMillis) }() + case 9: try { try decoder.decodeSingularInt64Field(value: &self.totalRunDurationMillis) }() + case 10: try { try decoder.decodeSingularInt32Field(value: &self.runCount) }() + case 11: try { try decoder.decodeSingularInt32Field(value: &self.shardCount) }() default: break } } @@ -4504,12 +4856,20 @@ extension BuildEventStream_TestSummary: SwiftProtobuf.Message, SwiftProtobuf._Me if self.totalRunDurationMillis != 0 { try visitor.visitSingularInt64Field(value: self.totalRunDurationMillis, fieldNumber: 9) } + if self.runCount != 0 { + try visitor.visitSingularInt32Field(value: self.runCount, fieldNumber: 10) + } + if self.shardCount != 0 { + try visitor.visitSingularInt32Field(value: self.shardCount, fieldNumber: 11) + } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_TestSummary, rhs: BuildEventStream_TestSummary) -> Bool { if lhs.overallStatus != rhs.overallStatus {return false} if lhs.totalRunCount != rhs.totalRunCount {return false} + if lhs.runCount != rhs.runCount {return false} + if lhs.shardCount != rhs.shardCount {return false} if lhs.passed != rhs.passed {return false} if lhs.failed != rhs.failed {return false} if lhs.totalNumCached != rhs.totalNumCached {return false} @@ -4530,77 +4890,46 @@ extension BuildEventStream_BuildFinished: SwiftProtobuf.Message, SwiftProtobuf._ 4: .standard(proto: "anomaly_report"), ] - fileprivate class _StorageClass { - var _overallSuccess: Bool = false - var _exitCode: BuildEventStream_BuildFinished.ExitCode? = nil - var _finishTimeMillis: Int64 = 0 - var _anomalyReport: BuildEventStream_BuildFinished.AnomalyReport? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _overallSuccess = source._overallSuccess - _exitCode = source._exitCode - _finishTimeMillis = source._finishTimeMillis - _anomalyReport = source._anomalyReport - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularBoolField(value: &_storage._overallSuccess) - case 2: try decoder.decodeSingularInt64Field(value: &_storage._finishTimeMillis) - case 3: try decoder.decodeSingularMessageField(value: &_storage._exitCode) - case 4: try decoder.decodeSingularMessageField(value: &_storage._anomalyReport) - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self.overallSuccess) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.finishTimeMillis) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._exitCode) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._anomalyReport) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if _storage._overallSuccess != false { - try visitor.visitSingularBoolField(value: _storage._overallSuccess, fieldNumber: 1) - } - if _storage._finishTimeMillis != 0 { - try visitor.visitSingularInt64Field(value: _storage._finishTimeMillis, fieldNumber: 2) - } - if let v = _storage._exitCode { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = _storage._anomalyReport { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if self.overallSuccess != false { + try visitor.visitSingularBoolField(value: self.overallSuccess, fieldNumber: 1) + } + if self.finishTimeMillis != 0 { + try visitor.visitSingularInt64Field(value: self.finishTimeMillis, fieldNumber: 2) + } + try { if let v = self._exitCode { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = self._anomalyReport { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildFinished, rhs: BuildEventStream_BuildFinished) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._overallSuccess != rhs_storage._overallSuccess {return false} - if _storage._exitCode != rhs_storage._exitCode {return false} - if _storage._finishTimeMillis != rhs_storage._finishTimeMillis {return false} - if _storage._anomalyReport != rhs_storage._anomalyReport {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.overallSuccess != rhs.overallSuccess {return false} + if lhs._exitCode != rhs._exitCode {return false} + if lhs.finishTimeMillis != rhs.finishTimeMillis {return false} + if lhs._anomalyReport != rhs._anomalyReport {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -4615,9 +4944,12 @@ extension BuildEventStream_BuildFinished.ExitCode: SwiftProtobuf.Message, SwiftP public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.name) - case 2: try decoder.decodeSingularInt32Field(value: &self.code) + case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.code) }() default: break } } @@ -4649,8 +4981,11 @@ extension BuildEventStream_BuildFinished.AnomalyReport: SwiftProtobuf.Message, S public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularBoolField(value: &self.wasSuspended) + case 1: try { try decoder.decodeSingularBoolField(value: &self.wasSuspended) }() default: break } } @@ -4680,84 +5015,51 @@ extension BuildEventStream_BuildMetrics: SwiftProtobuf.Message, SwiftProtobuf._M 5: .standard(proto: "timing_metrics"), ] - fileprivate class _StorageClass { - var _actionSummary: BuildEventStream_BuildMetrics.ActionSummary? = nil - var _memoryMetrics: BuildEventStream_BuildMetrics.MemoryMetrics? = nil - var _targetMetrics: BuildEventStream_BuildMetrics.TargetMetrics? = nil - var _packageMetrics: BuildEventStream_BuildMetrics.PackageMetrics? = nil - var _timingMetrics: BuildEventStream_BuildMetrics.TimingMetrics? = nil - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _actionSummary = source._actionSummary - _memoryMetrics = source._memoryMetrics - _targetMetrics = source._targetMetrics - _packageMetrics = source._packageMetrics - _timingMetrics = source._timingMetrics - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularMessageField(value: &_storage._actionSummary) - case 2: try decoder.decodeSingularMessageField(value: &_storage._memoryMetrics) - case 3: try decoder.decodeSingularMessageField(value: &_storage._targetMetrics) - case 4: try decoder.decodeSingularMessageField(value: &_storage._packageMetrics) - case 5: try decoder.decodeSingularMessageField(value: &_storage._timingMetrics) - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularMessageField(value: &self._actionSummary) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._memoryMetrics) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._targetMetrics) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._packageMetrics) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._timingMetrics) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if let v = _storage._actionSummary { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } - if let v = _storage._memoryMetrics { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } - if let v = _storage._targetMetrics { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } - if let v = _storage._packageMetrics { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } - if let v = _storage._timingMetrics { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._actionSummary { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._memoryMetrics { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = self._targetMetrics { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = self._packageMetrics { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try { if let v = self._timingMetrics { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildMetrics, rhs: BuildEventStream_BuildMetrics) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._actionSummary != rhs_storage._actionSummary {return false} - if _storage._memoryMetrics != rhs_storage._memoryMetrics {return false} - if _storage._targetMetrics != rhs_storage._targetMetrics {return false} - if _storage._packageMetrics != rhs_storage._packageMetrics {return false} - if _storage._timingMetrics != rhs_storage._timingMetrics {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs._actionSummary != rhs._actionSummary {return false} + if lhs._memoryMetrics != rhs._memoryMetrics {return false} + if lhs._targetMetrics != rhs._targetMetrics {return false} + if lhs._packageMetrics != rhs._packageMetrics {return false} + if lhs._timingMetrics != rhs._timingMetrics {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -4772,9 +5074,12 @@ extension BuildEventStream_BuildMetrics.ActionSummary: SwiftProtobuf.Message, Sw public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularInt64Field(value: &self.actionsCreated) - case 2: try decoder.decodeSingularInt64Field(value: &self.actionsExecuted) + case 1: try { try decoder.decodeSingularInt64Field(value: &self.actionsCreated) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.actionsExecuted) }() default: break } } @@ -4807,9 +5112,12 @@ extension BuildEventStream_BuildMetrics.MemoryMetrics: SwiftProtobuf.Message, Sw public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularInt64Field(value: &self.usedHeapSizePostBuild) - case 2: try decoder.decodeSingularInt64Field(value: &self.peakPostGcHeapSize) + case 1: try { try decoder.decodeSingularInt64Field(value: &self.usedHeapSizePostBuild) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.peakPostGcHeapSize) }() default: break } } @@ -4842,9 +5150,12 @@ extension BuildEventStream_BuildMetrics.TargetMetrics: SwiftProtobuf.Message, Sw public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularInt64Field(value: &self.targetsLoaded) - case 2: try decoder.decodeSingularInt64Field(value: &self.targetsConfigured) + case 1: try { try decoder.decodeSingularInt64Field(value: &self.targetsLoaded) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.targetsConfigured) }() default: break } } @@ -4876,8 +5187,11 @@ extension BuildEventStream_BuildMetrics.PackageMetrics: SwiftProtobuf.Message, S public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularInt64Field(value: &self.packagesLoaded) + case 1: try { try decoder.decodeSingularInt64Field(value: &self.packagesLoaded) }() default: break } } @@ -4906,9 +5220,12 @@ extension BuildEventStream_BuildMetrics.TimingMetrics: SwiftProtobuf.Message, Sw public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularInt64Field(value: &self.cpuTimeInMs) - case 2: try decoder.decodeSingularInt64Field(value: &self.wallTimeInMs) + case 1: try { try decoder.decodeSingularInt64Field(value: &self.cpuTimeInMs) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self.wallTimeInMs) }() default: break } } @@ -4940,8 +5257,11 @@ extension BuildEventStream_BuildToolLogs: SwiftProtobuf.Message, SwiftProtobuf._ public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeRepeatedMessageField(value: &self.log) + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.log) }() default: break } } @@ -4969,8 +5289,11 @@ extension BuildEventStream_ConvenienceSymlinksIdentified: SwiftProtobuf.Message, public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeRepeatedMessageField(value: &self.convenienceSymlinks) + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.convenienceSymlinks) }() default: break } } @@ -5000,10 +5323,13 @@ extension BuildEventStream_ConvenienceSymlink: SwiftProtobuf.Message, SwiftProto public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.path) - case 2: try decoder.decodeSingularEnumField(value: &self.action) - case 3: try decoder.decodeSingularStringField(value: &self.target) + case 1: try { try decoder.decodeSingularStringField(value: &self.path) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self.action) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.target) }() default: break } } @@ -5098,186 +5424,299 @@ extension BuildEventStream_BuildEvent: SwiftProtobuf.Message, SwiftProtobuf._Mes _ = _uniqueStorage() try withExtendedLifetime(_storage) { (_storage: _StorageClass) in while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularMessageField(value: &_storage._id) - case 2: try decoder.decodeRepeatedMessageField(value: &_storage._children) - case 3: + case 1: try { try decoder.decodeSingularMessageField(value: &_storage._id) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &_storage._children) }() + case 3: try { var v: BuildEventStream_Progress? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .progress(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .progress(v)} - case 4: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .progress(v) + } + }() + case 4: try { var v: BuildEventStream_Aborted? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .aborted(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .aborted(v)} - case 5: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .aborted(v) + } + }() + case 5: try { var v: BuildEventStream_BuildStarted? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .started(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .started(v)} - case 6: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .started(v) + } + }() + case 6: try { var v: BuildEventStream_PatternExpanded? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .expanded(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .expanded(v)} - case 7: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .expanded(v) + } + }() + case 7: try { var v: BuildEventStream_ActionExecuted? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .action(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .action(v)} - case 8: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .action(v) + } + }() + case 8: try { var v: BuildEventStream_TargetComplete? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .completed(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .completed(v)} - case 9: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .completed(v) + } + }() + case 9: try { var v: BuildEventStream_TestSummary? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .testSummary(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .testSummary(v)} - case 10: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .testSummary(v) + } + }() + case 10: try { var v: BuildEventStream_TestResult? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .testResult(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .testResult(v)} - case 12: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .testResult(v) + } + }() + case 12: try { var v: BuildEventStream_UnstructuredCommandLine? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .unstructuredCommandLine(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .unstructuredCommandLine(v)} - case 13: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .unstructuredCommandLine(v) + } + }() + case 13: try { var v: BuildEventStream_OptionsParsed? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .optionsParsed(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .optionsParsed(v)} - case 14: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .optionsParsed(v) + } + }() + case 14: try { var v: BuildEventStream_BuildFinished? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .finished(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .finished(v)} - case 15: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .finished(v) + } + }() + case 15: try { var v: BuildEventStream_NamedSetOfFiles? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .namedSetOfFiles(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .namedSetOfFiles(v)} - case 16: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .namedSetOfFiles(v) + } + }() + case 16: try { var v: BuildEventStream_WorkspaceStatus? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .workspaceStatus(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .workspaceStatus(v)} - case 17: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .workspaceStatus(v) + } + }() + case 17: try { var v: BuildEventStream_Configuration? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .configuration(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .configuration(v)} - case 18: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .configuration(v) + } + }() + case 18: try { var v: BuildEventStream_TargetConfigured? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .configured(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .configured(v)} - case 20: try decoder.decodeSingularBoolField(value: &_storage._lastMessage) - case 21: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .configured(v) + } + }() + case 20: try { try decoder.decodeSingularBoolField(value: &_storage._lastMessage) }() + case 21: try { var v: BuildEventStream_Fetch? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .fetch(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .fetch(v)} - case 22: - var v: src_main_protobuf_command_line_proto.CommandLine_CommandLine? + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .fetch(v) + } + }() + case 22: try { + var v: CommandLine_CommandLine? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .structuredCommandLine(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .structuredCommandLine(v)} - case 23: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .structuredCommandLine(v) + } + }() + case 23: try { var v: BuildEventStream_BuildToolLogs? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .buildToolLogs(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .buildToolLogs(v)} - case 24: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .buildToolLogs(v) + } + }() + case 24: try { var v: BuildEventStream_BuildMetrics? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .buildMetrics(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .buildMetrics(v)} - case 25: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .buildMetrics(v) + } + }() + case 25: try { var v: BuildEventStream_WorkspaceConfig? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .workspaceInfo(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .workspaceInfo(v)} - case 26: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .workspaceInfo(v) + } + }() + case 26: try { var v: BuildEventStream_BuildMetadata? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .buildMetadata(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .buildMetadata(v)} - case 27: + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .buildMetadata(v) + } + }() + case 27: try { var v: BuildEventStream_ConvenienceSymlinksIdentified? + var hadOneofValue = false if let current = _storage._payload { - try decoder.handleConflictingOneOf() + hadOneofValue = true if case .convenienceSymlinksIdentified(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._payload = .convenienceSymlinksIdentified(v)} + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._payload = .convenienceSymlinksIdentified(v) + } + }() default: break } } @@ -5286,65 +5725,111 @@ extension BuildEventStream_BuildEvent: SwiftProtobuf.Message, SwiftProtobuf._Mes public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if let v = _storage._id { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._id { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } + } }() if !_storage._children.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._children, fieldNumber: 2) } switch _storage._payload { - case .progress(let v)?: + case .progress?: try { + guard case .progress(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - case .aborted(let v)?: + }() + case .aborted?: try { + guard case .aborted(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - case .started(let v)?: + }() + case .started?: try { + guard case .started(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - case .expanded(let v)?: + }() + case .expanded?: try { + guard case .expanded(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - case .action(let v)?: + }() + case .action?: try { + guard case .action(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - case .completed(let v)?: + }() + case .completed?: try { + guard case .completed(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - case .testSummary(let v)?: + }() + case .testSummary?: try { + guard case .testSummary(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - case .testResult(let v)?: + }() + case .testResult?: try { + guard case .testResult(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - case .unstructuredCommandLine(let v)?: + }() + case .unstructuredCommandLine?: try { + guard case .unstructuredCommandLine(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - case .optionsParsed(let v)?: + }() + case .optionsParsed?: try { + guard case .optionsParsed(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 13) - case .finished(let v)?: + }() + case .finished?: try { + guard case .finished(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 14) - case .namedSetOfFiles(let v)?: + }() + case .namedSetOfFiles?: try { + guard case .namedSetOfFiles(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - case .workspaceStatus(let v)?: + }() + case .workspaceStatus?: try { + guard case .workspaceStatus(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 16) - case .configuration(let v)?: + }() + case .configuration?: try { + guard case .configuration(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 17) - case .configured(let v)?: + }() + case .configured?: try { + guard case .configured(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 18) - case nil: break + }() default: break } if _storage._lastMessage != false { try visitor.visitSingularBoolField(value: _storage._lastMessage, fieldNumber: 20) } switch _storage._payload { - case .fetch(let v)?: + case .fetch?: try { + guard case .fetch(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 21) - case .structuredCommandLine(let v)?: + }() + case .structuredCommandLine?: try { + guard case .structuredCommandLine(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 22) - case .buildToolLogs(let v)?: + }() + case .buildToolLogs?: try { + guard case .buildToolLogs(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 23) - case .buildMetrics(let v)?: + }() + case .buildMetrics?: try { + guard case .buildMetrics(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 24) - case .workspaceInfo(let v)?: + }() + case .workspaceInfo?: try { + guard case .workspaceInfo(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 25) - case .buildMetadata(let v)?: + }() + case .buildMetadata?: try { + guard case .buildMetadata(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 26) - case .convenienceSymlinksIdentified(let v)?: + }() + case .convenienceSymlinksIdentified?: try { + guard case .convenienceSymlinksIdentified(let v)? = _storage._payload else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 27) - case nil: break + }() default: break } } diff --git a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/command_line.pb.swift b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/command_line.pb.swift old mode 100755 new mode 100644 index 63be14c..bd87ccd --- a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/command_line.pb.swift +++ b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/command_line.pb.swift @@ -1,4 +1,5 @@ // DO NOT EDIT. +// swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: src/main/protobuf/command_line.proto @@ -6,6 +7,20 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ +// Copyright 2017 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import Foundation import SwiftProtobuf @@ -14,20 +29,31 @@ import src_main_protobuf_option_filters_proto // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that your are building against the same version of the API +// Please ensure that you are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } +/// Representation of a Bazel command line. public struct CommandLine_CommandLine { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// A title for this command line value, to differentiate it from others. + /// In particular, a single invocation may wish to report both the literal and + /// canonical command lines, and this label would be used to differentiate + /// between both versions. This is a string for flexibility. public var commandLineLabel: String = String() + /// A Bazel command line is made of distinct parts. For example, + /// `bazel --nomaster_bazelrc test --nocache_test_results //foo:aTest` + /// has the executable "bazel", a startup flag, a command "test", a command + /// flag, and a test target. There could be many more flags and targets, or + /// none (`bazel info` for example), but the basic structure is there. The + /// command line should be broken down into these logical sections here. public var sections: [CommandLine_CommandLineSection] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -35,48 +61,59 @@ public struct CommandLine_CommandLine { public init() {} } +/// A section of the Bazel command line. public struct CommandLine_CommandLineSection { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var sectionLabel: String { - get {return _storage._sectionLabel} - set {_uniqueStorage()._sectionLabel = newValue} - } + /// The name of this section, such as "startup_option" or "command". + public var sectionLabel: String = String() - public var sectionType: OneOf_SectionType? { - get {return _storage._sectionType} - set {_uniqueStorage()._sectionType = newValue} - } + public var sectionType: CommandLine_CommandLineSection.OneOf_SectionType? = nil + /// Sections with non-options, such as the list of targets or the command, + /// should use simple string chunks. public var chunkList: CommandLine_ChunkList { get { - if case .chunkList(let v)? = _storage._sectionType {return v} + if case .chunkList(let v)? = sectionType {return v} return CommandLine_ChunkList() } - set {_uniqueStorage()._sectionType = .chunkList(newValue)} + set {sectionType = .chunkList(newValue)} } + /// Startup and command options are lists of options and belong here. public var optionList: CommandLine_OptionList { get { - if case .optionList(let v)? = _storage._sectionType {return v} + if case .optionList(let v)? = sectionType {return v} return CommandLine_OptionList() } - set {_uniqueStorage()._sectionType = .optionList(newValue)} + set {sectionType = .optionList(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_SectionType: Equatable { + /// Sections with non-options, such as the list of targets or the command, + /// should use simple string chunks. case chunkList(CommandLine_ChunkList) + /// Startup and command options are lists of options and belong here. case optionList(CommandLine_OptionList) #if !swift(>=4.1) public static func ==(lhs: CommandLine_CommandLineSection.OneOf_SectionType, rhs: CommandLine_CommandLineSection.OneOf_SectionType) -> Bool { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.chunkList(let l), .chunkList(let r)): return l == r - case (.optionList(let l), .optionList(let r)): return l == r + case (.chunkList, .chunkList): return { + guard case .chunkList(let l) = lhs, case .chunkList(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.optionList, .optionList): return { + guard case .optionList(let l) = lhs, case .optionList(let r) = rhs else { preconditionFailure() } + return l == r + }() default: return false } } @@ -84,10 +121,9 @@ public struct CommandLine_CommandLineSection { } public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance } +/// Wrapper to allow a list of strings in the "oneof" section_type. public struct CommandLine_ChunkList { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -100,6 +136,7 @@ public struct CommandLine_ChunkList { public init() {} } +/// Wrapper to allow a list of options in the "oneof" section_type. public struct CommandLine_OptionList { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -112,20 +149,47 @@ public struct CommandLine_OptionList { public init() {} } +/// A single command line option. +/// +/// This represents the option itself, but does not take into account the type of +/// option or how the parser interpreted it. If this option is part of a command +/// line that represents the actual input that Bazel received, it would, for +/// example, include expansion flags as they are. However, if this option +/// represents the canonical form of the command line, with the values as Bazel +/// understands them, then the expansion flag, which has no value, would not +/// appear, and the flags it expands to would. public struct CommandLine_Option { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// How the option looks with the option and its value combined. Depending on + /// the purpose of this command line report, this could be the canonical + /// form, or the way that the flag was set. + /// + /// Some examples: this might be `--foo=bar` form, or `--foo bar` with a space; + /// for boolean flags, `--nobaz` is accepted on top of `--baz=false` and other + /// negating values, or for a positive value, the unqualified `--baz` form + /// is also accepted. This could also be a short `-b`, if the flag has an + /// abbreviated form. public var combinedForm: String = String() + /// The canonical name of the option, without the preceding dashes. public var optionName: String = String() + /// The value of the flag, or unset for flags that do not take values. + /// Especially for boolean flags, this should be in canonical form, the + /// combined_form field above gives room for showing the flag as it was set + /// if that is preferred. public var optionValue: String = String() - public var effectTags: [src_main_protobuf_option_filters_proto.Options_OptionEffectTag] = [] + /// This flag's tagged effects. See OptionEffectTag's java documentation for + /// details. + public var effectTags: [Options_OptionEffectTag] = [] - public var metadataTags: [src_main_protobuf_option_filters_proto.Options_OptionMetadataTag] = [] + /// Metadata about the flag. See OptionMetadataTag's java documentation for + /// details. + public var metadataTags: [Options_OptionMetadataTag] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -145,9 +209,12 @@ extension CommandLine_CommandLine: SwiftProtobuf.Message, SwiftProtobuf._Message public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.commandLineLabel) - case 2: try decoder.decodeRepeatedMessageField(value: &self.sections) + case 1: try { try decoder.decodeSingularStringField(value: &self.commandLineLabel) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.sections) }() default: break } } @@ -179,82 +246,69 @@ extension CommandLine_CommandLineSection: SwiftProtobuf.Message, SwiftProtobuf._ 3: .standard(proto: "option_list"), ] - fileprivate class _StorageClass { - var _sectionLabel: String = String() - var _sectionType: CommandLine_CommandLineSection.OneOf_SectionType? - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _sectionLabel = source._sectionLabel - _sectionType = source._sectionType - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &_storage._sectionLabel) - case 2: - var v: CommandLine_ChunkList? - if let current = _storage._sectionType { - try decoder.handleConflictingOneOf() - if case .chunkList(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._sectionType = .chunkList(v)} - case 3: - var v: CommandLine_OptionList? - if let current = _storage._sectionType { - try decoder.handleConflictingOneOf() - if case .optionList(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._sectionType = .optionList(v)} - default: break + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.sectionLabel) }() + case 2: try { + var v: CommandLine_ChunkList? + var hadOneofValue = false + if let current = self.sectionType { + hadOneofValue = true + if case .chunkList(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.sectionType = .chunkList(v) + } + }() + case 3: try { + var v: CommandLine_OptionList? + var hadOneofValue = false + if let current = self.sectionType { + hadOneofValue = true + if case .optionList(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.sectionType = .optionList(v) } + }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if !_storage._sectionLabel.isEmpty { - try visitor.visitSingularStringField(value: _storage._sectionLabel, fieldNumber: 1) - } - switch _storage._sectionType { - case .chunkList(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - case .optionList(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - case nil: break - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.sectionLabel.isEmpty { + try visitor.visitSingularStringField(value: self.sectionLabel, fieldNumber: 1) + } + switch self.sectionType { + case .chunkList?: try { + guard case .chunkList(let v)? = self.sectionType else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + }() + case .optionList?: try { + guard case .optionList(let v)? = self.sectionType else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + }() + case nil: break } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: CommandLine_CommandLineSection, rhs: CommandLine_CommandLineSection) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._sectionLabel != rhs_storage._sectionLabel {return false} - if _storage._sectionType != rhs_storage._sectionType {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.sectionLabel != rhs.sectionLabel {return false} + if lhs.sectionType != rhs.sectionType {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -268,8 +322,11 @@ extension CommandLine_ChunkList: SwiftProtobuf.Message, SwiftProtobuf._MessageIm public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeRepeatedStringField(value: &self.chunk) + case 1: try { try decoder.decodeRepeatedStringField(value: &self.chunk) }() default: break } } @@ -297,8 +354,11 @@ extension CommandLine_OptionList: SwiftProtobuf.Message, SwiftProtobuf._MessageI public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeRepeatedMessageField(value: &self.option) + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.option) }() default: break } } @@ -330,12 +390,15 @@ extension CommandLine_Option: SwiftProtobuf.Message, SwiftProtobuf._MessageImple public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.combinedForm) - case 2: try decoder.decodeSingularStringField(value: &self.optionName) - case 3: try decoder.decodeSingularStringField(value: &self.optionValue) - case 4: try decoder.decodeRepeatedEnumField(value: &self.effectTags) - case 5: try decoder.decodeRepeatedEnumField(value: &self.metadataTags) + case 1: try { try decoder.decodeSingularStringField(value: &self.combinedForm) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.optionName) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.optionValue) }() + case 4: try { try decoder.decodeRepeatedEnumField(value: &self.effectTags) }() + case 5: try { try decoder.decodeRepeatedEnumField(value: &self.metadataTags) }() default: break } } diff --git a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/failure_details.pb.swift b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/failure_details.pb.swift old mode 100755 new mode 100644 index 02c9fb4..2d0543c --- a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/failure_details.pb.swift +++ b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/failure_details.pb.swift @@ -1,4 +1,5 @@ // DO NOT EDIT. +// swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: src/main/protobuf/failure_details.proto @@ -6,13 +7,32 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ +// Copyright 2020 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file's messages describe any failure(s) that occurred during Bazel's +// handling of a request. The intent is to provide more detail to a Bazel client +// than is conveyed with an exit code, to help those clients decide how to +// respond to, or classify, a failure. + import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that your are building against the same version of the API +// Please ensure that you are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} @@ -31,203 +51,524 @@ public struct FailureDetails_FailureDetailMetadata { public init() {} } +/// The FailureDetail message type is designed such that consumers can extract a +/// basic classification of a FailureDetail message even if the consumer was +/// built with a stale definition. This forward compatibility is implemented via +/// conventions on FailureDetail and its submessage types, as follows. +/// +/// *** FailureDetail field numbers +/// +/// Field numbers 1 through 100 (inclusive) are reserved for generally applicable +/// values. Any number of these fields may be set on a FailureDetail message. +/// +/// Field numbers 101 through 10,000 (inclusive) are reserved for use inside the +/// "oneof" structure. Only one of these values should be set on a FailureDetail +/// message. +/// +/// Additional fields numbers are unlikely to be needed, but, for extreme future- +/// proofing purposes, field numbers 10,001 through 1,000,000 (inclusive; +/// excluding protobuf's reserved range 19000 through 19999) are reserved for +/// additional generally applicable values. +/// +/// *** FailureDetail's "oneof" submessages +/// +/// Each field in the "oneof" structure is a submessage corresponding to a +/// category of failure. +/// +/// In each of these submessage types, field number 1 is an enum whose values +/// correspond to a subcategory of the failure. Generally, the enum's constant +/// which maps to 0 should be interpreted as "unspecified", though this is not +/// required. +/// +/// *** Recommended forward compatibility strategy +/// +/// The recommended forward compatibility strategy is to reduce a FailureDetail +/// message to a pair of integers. +/// +/// The first integer corresponds to the field number of the submessage set +/// inside FailureDetail's "oneof", which corresponds with the failure's +/// category. +/// +/// The second integer corresponds to the value of the enum at field number 1 +/// within that submessage, which corresponds with the failure's subcategory. +/// +/// WARNING: This functionality is experimental and should not be relied on at +/// this time. +/// TODO(mschaller): remove experimental warning public struct FailureDetails_FailureDetail { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var message: String { - get {return _storage._message} - set {_uniqueStorage()._message = newValue} - } + /// A short human-readable message describing the failure, for debugging. + /// + /// This value is *not* intended to be used algorithmically. + public var message: String = String() - public var category: OneOf_Category? { - get {return _storage._category} - set {_uniqueStorage()._category = newValue} - } + public var category: FailureDetails_FailureDetail.OneOf_Category? = nil public var interrupted: FailureDetails_Interrupted { get { - if case .interrupted(let v)? = _storage._category {return v} + if case .interrupted(let v)? = category {return v} return FailureDetails_Interrupted() } - set {_uniqueStorage()._category = .interrupted(newValue)} + set {category = .interrupted(newValue)} } public var externalRepository: FailureDetails_ExternalRepository { get { - if case .externalRepository(let v)? = _storage._category {return v} + if case .externalRepository(let v)? = category {return v} return FailureDetails_ExternalRepository() } - set {_uniqueStorage()._category = .externalRepository(newValue)} + set {category = .externalRepository(newValue)} } public var buildProgress: FailureDetails_BuildProgress { get { - if case .buildProgress(let v)? = _storage._category {return v} + if case .buildProgress(let v)? = category {return v} return FailureDetails_BuildProgress() } - set {_uniqueStorage()._category = .buildProgress(newValue)} + set {category = .buildProgress(newValue)} } public var remoteOptions: FailureDetails_RemoteOptions { get { - if case .remoteOptions(let v)? = _storage._category {return v} + if case .remoteOptions(let v)? = category {return v} return FailureDetails_RemoteOptions() } - set {_uniqueStorage()._category = .remoteOptions(newValue)} + set {category = .remoteOptions(newValue)} } public var clientEnvironment: FailureDetails_ClientEnvironment { get { - if case .clientEnvironment(let v)? = _storage._category {return v} + if case .clientEnvironment(let v)? = category {return v} return FailureDetails_ClientEnvironment() } - set {_uniqueStorage()._category = .clientEnvironment(newValue)} + set {category = .clientEnvironment(newValue)} } public var crash: FailureDetails_Crash { get { - if case .crash(let v)? = _storage._category {return v} + if case .crash(let v)? = category {return v} return FailureDetails_Crash() } - set {_uniqueStorage()._category = .crash(newValue)} + set {category = .crash(newValue)} } public var symlinkForest: FailureDetails_SymlinkForest { get { - if case .symlinkForest(let v)? = _storage._category {return v} + if case .symlinkForest(let v)? = category {return v} return FailureDetails_SymlinkForest() } - set {_uniqueStorage()._category = .symlinkForest(newValue)} + set {category = .symlinkForest(newValue)} } public var packageOptions: FailureDetails_PackageOptions { get { - if case .packageOptions(let v)? = _storage._category {return v} + if case .packageOptions(let v)? = category {return v} return FailureDetails_PackageOptions() } - set {_uniqueStorage()._category = .packageOptions(newValue)} + set {category = .packageOptions(newValue)} } public var remoteExecution: FailureDetails_RemoteExecution { get { - if case .remoteExecution(let v)? = _storage._category {return v} + if case .remoteExecution(let v)? = category {return v} return FailureDetails_RemoteExecution() } - set {_uniqueStorage()._category = .remoteExecution(newValue)} + set {category = .remoteExecution(newValue)} } public var execution: FailureDetails_Execution { get { - if case .execution(let v)? = _storage._category {return v} + if case .execution(let v)? = category {return v} return FailureDetails_Execution() } - set {_uniqueStorage()._category = .execution(newValue)} + set {category = .execution(newValue)} } public var workspaces: FailureDetails_Workspaces { get { - if case .workspaces(let v)? = _storage._category {return v} + if case .workspaces(let v)? = category {return v} return FailureDetails_Workspaces() } - set {_uniqueStorage()._category = .workspaces(newValue)} + set {category = .workspaces(newValue)} } public var crashOptions: FailureDetails_CrashOptions { get { - if case .crashOptions(let v)? = _storage._category {return v} + if case .crashOptions(let v)? = category {return v} return FailureDetails_CrashOptions() } - set {_uniqueStorage()._category = .crashOptions(newValue)} + set {category = .crashOptions(newValue)} } public var filesystem: FailureDetails_Filesystem { get { - if case .filesystem(let v)? = _storage._category {return v} + if case .filesystem(let v)? = category {return v} return FailureDetails_Filesystem() } - set {_uniqueStorage()._category = .filesystem(newValue)} + set {category = .filesystem(newValue)} } public var executionOptions: FailureDetails_ExecutionOptions { get { - if case .executionOptions(let v)? = _storage._category {return v} + if case .executionOptions(let v)? = category {return v} return FailureDetails_ExecutionOptions() } - set {_uniqueStorage()._category = .executionOptions(newValue)} + set {category = .executionOptions(newValue)} } public var command: FailureDetails_Command { get { - if case .command(let v)? = _storage._category {return v} + if case .command(let v)? = category {return v} return FailureDetails_Command() } - set {_uniqueStorage()._category = .command(newValue)} + set {category = .command(newValue)} } public var spawn: FailureDetails_Spawn { get { - if case .spawn(let v)? = _storage._category {return v} + if case .spawn(let v)? = category {return v} return FailureDetails_Spawn() } - set {_uniqueStorage()._category = .spawn(newValue)} + set {category = .spawn(newValue)} } public var grpcServer: FailureDetails_GrpcServer { get { - if case .grpcServer(let v)? = _storage._category {return v} + if case .grpcServer(let v)? = category {return v} return FailureDetails_GrpcServer() } - set {_uniqueStorage()._category = .grpcServer(newValue)} + set {category = .grpcServer(newValue)} } public var canonicalizeFlags: FailureDetails_CanonicalizeFlags { get { - if case .canonicalizeFlags(let v)? = _storage._category {return v} + if case .canonicalizeFlags(let v)? = category {return v} return FailureDetails_CanonicalizeFlags() } - set {_uniqueStorage()._category = .canonicalizeFlags(newValue)} + set {category = .canonicalizeFlags(newValue)} } public var buildConfiguration: FailureDetails_BuildConfiguration { get { - if case .buildConfiguration(let v)? = _storage._category {return v} + if case .buildConfiguration(let v)? = category {return v} return FailureDetails_BuildConfiguration() } - set {_uniqueStorage()._category = .buildConfiguration(newValue)} + set {category = .buildConfiguration(newValue)} } public var infoCommand: FailureDetails_InfoCommand { get { - if case .infoCommand(let v)? = _storage._category {return v} + if case .infoCommand(let v)? = category {return v} return FailureDetails_InfoCommand() } - set {_uniqueStorage()._category = .infoCommand(newValue)} + set {category = .infoCommand(newValue)} } public var memoryOptions: FailureDetails_MemoryOptions { get { - if case .memoryOptions(let v)? = _storage._category {return v} + if case .memoryOptions(let v)? = category {return v} return FailureDetails_MemoryOptions() } - set {_uniqueStorage()._category = .memoryOptions(newValue)} + set {category = .memoryOptions(newValue)} } public var query: FailureDetails_Query { get { - if case .query(let v)? = _storage._category {return v} + if case .query(let v)? = category {return v} return FailureDetails_Query() } - set {_uniqueStorage()._category = .query(newValue)} + set {category = .query(newValue)} } public var localExecution: FailureDetails_LocalExecution { get { - if case .localExecution(let v)? = _storage._category {return v} + if case .localExecution(let v)? = category {return v} return FailureDetails_LocalExecution() } - set {_uniqueStorage()._category = .localExecution(newValue)} + set {category = .localExecution(newValue)} + } + + public var actionCache: FailureDetails_ActionCache { + get { + if case .actionCache(let v)? = category {return v} + return FailureDetails_ActionCache() + } + set {category = .actionCache(newValue)} + } + + public var fetchCommand: FailureDetails_FetchCommand { + get { + if case .fetchCommand(let v)? = category {return v} + return FailureDetails_FetchCommand() + } + set {category = .fetchCommand(newValue)} + } + + public var syncCommand: FailureDetails_SyncCommand { + get { + if case .syncCommand(let v)? = category {return v} + return FailureDetails_SyncCommand() + } + set {category = .syncCommand(newValue)} + } + + public var sandbox: FailureDetails_Sandbox { + get { + if case .sandbox(let v)? = category {return v} + return FailureDetails_Sandbox() + } + set {category = .sandbox(newValue)} + } + + public var includeScanning: FailureDetails_IncludeScanning { + get { + if case .includeScanning(let v)? = category {return v} + return FailureDetails_IncludeScanning() + } + set {category = .includeScanning(newValue)} + } + + public var testCommand: FailureDetails_TestCommand { + get { + if case .testCommand(let v)? = category {return v} + return FailureDetails_TestCommand() + } + set {category = .testCommand(newValue)} + } + + public var actionQuery: FailureDetails_ActionQuery { + get { + if case .actionQuery(let v)? = category {return v} + return FailureDetails_ActionQuery() + } + set {category = .actionQuery(newValue)} + } + + public var targetPatterns: FailureDetails_TargetPatterns { + get { + if case .targetPatterns(let v)? = category {return v} + return FailureDetails_TargetPatterns() + } + set {category = .targetPatterns(newValue)} + } + + public var cleanCommand: FailureDetails_CleanCommand { + get { + if case .cleanCommand(let v)? = category {return v} + return FailureDetails_CleanCommand() + } + set {category = .cleanCommand(newValue)} + } + + public var configCommand: FailureDetails_ConfigCommand { + get { + if case .configCommand(let v)? = category {return v} + return FailureDetails_ConfigCommand() + } + set {category = .configCommand(newValue)} + } + + public var configurableQuery: FailureDetails_ConfigurableQuery { + get { + if case .configurableQuery(let v)? = category {return v} + return FailureDetails_ConfigurableQuery() + } + set {category = .configurableQuery(newValue)} + } + + public var dumpCommand: FailureDetails_DumpCommand { + get { + if case .dumpCommand(let v)? = category {return v} + return FailureDetails_DumpCommand() + } + set {category = .dumpCommand(newValue)} + } + + public var helpCommand: FailureDetails_HelpCommand { + get { + if case .helpCommand(let v)? = category {return v} + return FailureDetails_HelpCommand() + } + set {category = .helpCommand(newValue)} + } + + public var mobileInstall: FailureDetails_MobileInstall { + get { + if case .mobileInstall(let v)? = category {return v} + return FailureDetails_MobileInstall() + } + set {category = .mobileInstall(newValue)} + } + + public var profileCommand: FailureDetails_ProfileCommand { + get { + if case .profileCommand(let v)? = category {return v} + return FailureDetails_ProfileCommand() + } + set {category = .profileCommand(newValue)} + } + + public var runCommand: FailureDetails_RunCommand { + get { + if case .runCommand(let v)? = category {return v} + return FailureDetails_RunCommand() + } + set {category = .runCommand(newValue)} + } + + public var versionCommand: FailureDetails_VersionCommand { + get { + if case .versionCommand(let v)? = category {return v} + return FailureDetails_VersionCommand() + } + set {category = .versionCommand(newValue)} + } + + public var printActionCommand: FailureDetails_PrintActionCommand { + get { + if case .printActionCommand(let v)? = category {return v} + return FailureDetails_PrintActionCommand() + } + set {category = .printActionCommand(newValue)} + } + + public var workspaceStatus: FailureDetails_WorkspaceStatus { + get { + if case .workspaceStatus(let v)? = category {return v} + return FailureDetails_WorkspaceStatus() + } + set {category = .workspaceStatus(newValue)} + } + + public var javaCompile: FailureDetails_JavaCompile { + get { + if case .javaCompile(let v)? = category {return v} + return FailureDetails_JavaCompile() + } + set {category = .javaCompile(newValue)} + } + + public var actionRewinding: FailureDetails_ActionRewinding { + get { + if case .actionRewinding(let v)? = category {return v} + return FailureDetails_ActionRewinding() + } + set {category = .actionRewinding(newValue)} + } + + public var cppCompile: FailureDetails_CppCompile { + get { + if case .cppCompile(let v)? = category {return v} + return FailureDetails_CppCompile() + } + set {category = .cppCompile(newValue)} + } + + public var starlarkAction: FailureDetails_StarlarkAction { + get { + if case .starlarkAction(let v)? = category {return v} + return FailureDetails_StarlarkAction() + } + set {category = .starlarkAction(newValue)} + } + + public var ninjaAction: FailureDetails_NinjaAction { + get { + if case .ninjaAction(let v)? = category {return v} + return FailureDetails_NinjaAction() + } + set {category = .ninjaAction(newValue)} + } + + public var dynamicExecution: FailureDetails_DynamicExecution { + get { + if case .dynamicExecution(let v)? = category {return v} + return FailureDetails_DynamicExecution() + } + set {category = .dynamicExecution(newValue)} + } + + public var failAction: FailureDetails_FailAction { + get { + if case .failAction(let v)? = category {return v} + return FailureDetails_FailAction() + } + set {category = .failAction(newValue)} + } + + public var symlinkAction: FailureDetails_SymlinkAction { + get { + if case .symlinkAction(let v)? = category {return v} + return FailureDetails_SymlinkAction() + } + set {category = .symlinkAction(newValue)} + } + + public var cppLink: FailureDetails_CppLink { + get { + if case .cppLink(let v)? = category {return v} + return FailureDetails_CppLink() + } + set {category = .cppLink(newValue)} + } + + public var ltoAction: FailureDetails_LtoAction { + get { + if case .ltoAction(let v)? = category {return v} + return FailureDetails_LtoAction() + } + set {category = .ltoAction(newValue)} + } + + public var testAction: FailureDetails_TestAction { + get { + if case .testAction(let v)? = category {return v} + return FailureDetails_TestAction() + } + set {category = .testAction(newValue)} + } + + public var worker: FailureDetails_Worker { + get { + if case .worker(let v)? = category {return v} + return FailureDetails_Worker() + } + set {category = .worker(newValue)} + } + + public var analysis: FailureDetails_Analysis { + get { + if case .analysis(let v)? = category {return v} + return FailureDetails_Analysis() + } + set {category = .analysis(newValue)} + } + + public var packageLoading: FailureDetails_PackageLoading { + get { + if case .packageLoading(let v)? = category {return v} + return FailureDetails_PackageLoading() + } + set {category = .packageLoading(newValue)} + } + + public var toolchain: FailureDetails_Toolchain { + get { + if case .toolchain(let v)? = category {return v} + return FailureDetails_Toolchain() + } + set {category = .toolchain(newValue)} + } + + public var starlarkLoading: FailureDetails_StarlarkLoading { + get { + if case .starlarkLoading(let v)? = category {return v} + return FailureDetails_StarlarkLoading() + } + set {category = .starlarkLoading(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -256,33 +597,280 @@ public struct FailureDetails_FailureDetail { case memoryOptions(FailureDetails_MemoryOptions) case query(FailureDetails_Query) case localExecution(FailureDetails_LocalExecution) + case actionCache(FailureDetails_ActionCache) + case fetchCommand(FailureDetails_FetchCommand) + case syncCommand(FailureDetails_SyncCommand) + case sandbox(FailureDetails_Sandbox) + case includeScanning(FailureDetails_IncludeScanning) + case testCommand(FailureDetails_TestCommand) + case actionQuery(FailureDetails_ActionQuery) + case targetPatterns(FailureDetails_TargetPatterns) + case cleanCommand(FailureDetails_CleanCommand) + case configCommand(FailureDetails_ConfigCommand) + case configurableQuery(FailureDetails_ConfigurableQuery) + case dumpCommand(FailureDetails_DumpCommand) + case helpCommand(FailureDetails_HelpCommand) + case mobileInstall(FailureDetails_MobileInstall) + case profileCommand(FailureDetails_ProfileCommand) + case runCommand(FailureDetails_RunCommand) + case versionCommand(FailureDetails_VersionCommand) + case printActionCommand(FailureDetails_PrintActionCommand) + case workspaceStatus(FailureDetails_WorkspaceStatus) + case javaCompile(FailureDetails_JavaCompile) + case actionRewinding(FailureDetails_ActionRewinding) + case cppCompile(FailureDetails_CppCompile) + case starlarkAction(FailureDetails_StarlarkAction) + case ninjaAction(FailureDetails_NinjaAction) + case dynamicExecution(FailureDetails_DynamicExecution) + case failAction(FailureDetails_FailAction) + case symlinkAction(FailureDetails_SymlinkAction) + case cppLink(FailureDetails_CppLink) + case ltoAction(FailureDetails_LtoAction) + case testAction(FailureDetails_TestAction) + case worker(FailureDetails_Worker) + case analysis(FailureDetails_Analysis) + case packageLoading(FailureDetails_PackageLoading) + case toolchain(FailureDetails_Toolchain) + case starlarkLoading(FailureDetails_StarlarkLoading) #if !swift(>=4.1) public static func ==(lhs: FailureDetails_FailureDetail.OneOf_Category, rhs: FailureDetails_FailureDetail.OneOf_Category) -> Bool { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.interrupted(let l), .interrupted(let r)): return l == r - case (.externalRepository(let l), .externalRepository(let r)): return l == r - case (.buildProgress(let l), .buildProgress(let r)): return l == r - case (.remoteOptions(let l), .remoteOptions(let r)): return l == r - case (.clientEnvironment(let l), .clientEnvironment(let r)): return l == r - case (.crash(let l), .crash(let r)): return l == r - case (.symlinkForest(let l), .symlinkForest(let r)): return l == r - case (.packageOptions(let l), .packageOptions(let r)): return l == r - case (.remoteExecution(let l), .remoteExecution(let r)): return l == r - case (.execution(let l), .execution(let r)): return l == r - case (.workspaces(let l), .workspaces(let r)): return l == r - case (.crashOptions(let l), .crashOptions(let r)): return l == r - case (.filesystem(let l), .filesystem(let r)): return l == r - case (.executionOptions(let l), .executionOptions(let r)): return l == r - case (.command(let l), .command(let r)): return l == r - case (.spawn(let l), .spawn(let r)): return l == r - case (.grpcServer(let l), .grpcServer(let r)): return l == r - case (.canonicalizeFlags(let l), .canonicalizeFlags(let r)): return l == r - case (.buildConfiguration(let l), .buildConfiguration(let r)): return l == r - case (.infoCommand(let l), .infoCommand(let r)): return l == r - case (.memoryOptions(let l), .memoryOptions(let r)): return l == r - case (.query(let l), .query(let r)): return l == r - case (.localExecution(let l), .localExecution(let r)): return l == r + case (.interrupted, .interrupted): return { + guard case .interrupted(let l) = lhs, case .interrupted(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.externalRepository, .externalRepository): return { + guard case .externalRepository(let l) = lhs, case .externalRepository(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.buildProgress, .buildProgress): return { + guard case .buildProgress(let l) = lhs, case .buildProgress(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.remoteOptions, .remoteOptions): return { + guard case .remoteOptions(let l) = lhs, case .remoteOptions(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.clientEnvironment, .clientEnvironment): return { + guard case .clientEnvironment(let l) = lhs, case .clientEnvironment(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.crash, .crash): return { + guard case .crash(let l) = lhs, case .crash(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.symlinkForest, .symlinkForest): return { + guard case .symlinkForest(let l) = lhs, case .symlinkForest(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.packageOptions, .packageOptions): return { + guard case .packageOptions(let l) = lhs, case .packageOptions(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.remoteExecution, .remoteExecution): return { + guard case .remoteExecution(let l) = lhs, case .remoteExecution(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.execution, .execution): return { + guard case .execution(let l) = lhs, case .execution(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.workspaces, .workspaces): return { + guard case .workspaces(let l) = lhs, case .workspaces(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.crashOptions, .crashOptions): return { + guard case .crashOptions(let l) = lhs, case .crashOptions(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.filesystem, .filesystem): return { + guard case .filesystem(let l) = lhs, case .filesystem(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.executionOptions, .executionOptions): return { + guard case .executionOptions(let l) = lhs, case .executionOptions(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.command, .command): return { + guard case .command(let l) = lhs, case .command(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.spawn, .spawn): return { + guard case .spawn(let l) = lhs, case .spawn(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.grpcServer, .grpcServer): return { + guard case .grpcServer(let l) = lhs, case .grpcServer(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.canonicalizeFlags, .canonicalizeFlags): return { + guard case .canonicalizeFlags(let l) = lhs, case .canonicalizeFlags(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.buildConfiguration, .buildConfiguration): return { + guard case .buildConfiguration(let l) = lhs, case .buildConfiguration(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.infoCommand, .infoCommand): return { + guard case .infoCommand(let l) = lhs, case .infoCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.memoryOptions, .memoryOptions): return { + guard case .memoryOptions(let l) = lhs, case .memoryOptions(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.query, .query): return { + guard case .query(let l) = lhs, case .query(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.localExecution, .localExecution): return { + guard case .localExecution(let l) = lhs, case .localExecution(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.actionCache, .actionCache): return { + guard case .actionCache(let l) = lhs, case .actionCache(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.fetchCommand, .fetchCommand): return { + guard case .fetchCommand(let l) = lhs, case .fetchCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.syncCommand, .syncCommand): return { + guard case .syncCommand(let l) = lhs, case .syncCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.sandbox, .sandbox): return { + guard case .sandbox(let l) = lhs, case .sandbox(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.includeScanning, .includeScanning): return { + guard case .includeScanning(let l) = lhs, case .includeScanning(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.testCommand, .testCommand): return { + guard case .testCommand(let l) = lhs, case .testCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.actionQuery, .actionQuery): return { + guard case .actionQuery(let l) = lhs, case .actionQuery(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.targetPatterns, .targetPatterns): return { + guard case .targetPatterns(let l) = lhs, case .targetPatterns(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.cleanCommand, .cleanCommand): return { + guard case .cleanCommand(let l) = lhs, case .cleanCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.configCommand, .configCommand): return { + guard case .configCommand(let l) = lhs, case .configCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.configurableQuery, .configurableQuery): return { + guard case .configurableQuery(let l) = lhs, case .configurableQuery(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.dumpCommand, .dumpCommand): return { + guard case .dumpCommand(let l) = lhs, case .dumpCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.helpCommand, .helpCommand): return { + guard case .helpCommand(let l) = lhs, case .helpCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.mobileInstall, .mobileInstall): return { + guard case .mobileInstall(let l) = lhs, case .mobileInstall(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.profileCommand, .profileCommand): return { + guard case .profileCommand(let l) = lhs, case .profileCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.runCommand, .runCommand): return { + guard case .runCommand(let l) = lhs, case .runCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.versionCommand, .versionCommand): return { + guard case .versionCommand(let l) = lhs, case .versionCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.printActionCommand, .printActionCommand): return { + guard case .printActionCommand(let l) = lhs, case .printActionCommand(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.workspaceStatus, .workspaceStatus): return { + guard case .workspaceStatus(let l) = lhs, case .workspaceStatus(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.javaCompile, .javaCompile): return { + guard case .javaCompile(let l) = lhs, case .javaCompile(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.actionRewinding, .actionRewinding): return { + guard case .actionRewinding(let l) = lhs, case .actionRewinding(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.cppCompile, .cppCompile): return { + guard case .cppCompile(let l) = lhs, case .cppCompile(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.starlarkAction, .starlarkAction): return { + guard case .starlarkAction(let l) = lhs, case .starlarkAction(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.ninjaAction, .ninjaAction): return { + guard case .ninjaAction(let l) = lhs, case .ninjaAction(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.dynamicExecution, .dynamicExecution): return { + guard case .dynamicExecution(let l) = lhs, case .dynamicExecution(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.failAction, .failAction): return { + guard case .failAction(let l) = lhs, case .failAction(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.symlinkAction, .symlinkAction): return { + guard case .symlinkAction(let l) = lhs, case .symlinkAction(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.cppLink, .cppLink): return { + guard case .cppLink(let l) = lhs, case .cppLink(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.ltoAction, .ltoAction): return { + guard case .ltoAction(let l) = lhs, case .ltoAction(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.testAction, .testAction): return { + guard case .testAction(let l) = lhs, case .testAction(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.worker, .worker): return { + guard case .worker(let l) = lhs, case .worker(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.analysis, .analysis): return { + guard case .analysis(let l) = lhs, case .analysis(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.packageLoading, .packageLoading): return { + guard case .packageLoading(let l) = lhs, case .packageLoading(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.toolchain, .toolchain): return { + guard case .toolchain(let l) = lhs, case .toolchain(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.starlarkLoading, .starlarkLoading): return { + guard case .starlarkLoading(let l) = lhs, case .starlarkLoading(let r) = rhs else { preconditionFailure() } + return l == r + }() default: return false } } @@ -290,8 +878,6 @@ public struct FailureDetails_FailureDetail { } public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance } public struct FailureDetails_Interrupted { @@ -305,14 +891,29 @@ public struct FailureDetails_Interrupted { public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int + + /// Unknown interrupt. Avoid using this code, instead use INTERRUPTED. case interruptedUnknown // = 0 - case build // = 4 - case buildCompletion // = 5 - case packageLoadingSync // = 6 - case executorCompletion // = 7 - case commandDispatch // = 8 - case infoItem // = 9 - case afterQuery // = 10 + + /// Command was interrupted (cancelled). + case interrupted // = 28 + + /// The following more specific interrupt codes have been deprecated and + /// consolidated into INTERRUPTED. + case deprecatedBuild // = 4 + case deprecatedBuildCompletion // = 5 + case deprecatedPackageLoadingSync // = 6 + case deprecatedExecutorCompletion // = 7 + case deprecatedCommandDispatch // = 8 + case deprecatedInfoItem // = 9 + case deprecatedAfterQuery // = 10 + case deprecatedFetchCommand // = 17 + case deprecatedSyncCommand // = 18 + case deprecatedCleanCommand // = 20 + case deprecatedMobileInstallCommand // = 21 + case deprecatedQuery // = 22 + case deprecatedRunCommand // = 23 + case deprecatedOptionsParsing // = 27 case UNRECOGNIZED(Int) public init() { @@ -322,13 +923,21 @@ public struct FailureDetails_Interrupted { public init?(rawValue: Int) { switch rawValue { case 0: self = .interruptedUnknown - case 4: self = .build - case 5: self = .buildCompletion - case 6: self = .packageLoadingSync - case 7: self = .executorCompletion - case 8: self = .commandDispatch - case 9: self = .infoItem - case 10: self = .afterQuery + case 4: self = .deprecatedBuild + case 5: self = .deprecatedBuildCompletion + case 6: self = .deprecatedPackageLoadingSync + case 7: self = .deprecatedExecutorCompletion + case 8: self = .deprecatedCommandDispatch + case 9: self = .deprecatedInfoItem + case 10: self = .deprecatedAfterQuery + case 17: self = .deprecatedFetchCommand + case 18: self = .deprecatedSyncCommand + case 20: self = .deprecatedCleanCommand + case 21: self = .deprecatedMobileInstallCommand + case 22: self = .deprecatedQuery + case 23: self = .deprecatedRunCommand + case 27: self = .deprecatedOptionsParsing + case 28: self = .interrupted default: self = .UNRECOGNIZED(rawValue) } } @@ -336,13 +945,21 @@ public struct FailureDetails_Interrupted { public var rawValue: Int { switch self { case .interruptedUnknown: return 0 - case .build: return 4 - case .buildCompletion: return 5 - case .packageLoadingSync: return 6 - case .executorCompletion: return 7 - case .commandDispatch: return 8 - case .infoItem: return 9 - case .afterQuery: return 10 + case .deprecatedBuild: return 4 + case .deprecatedBuildCompletion: return 5 + case .deprecatedPackageLoadingSync: return 6 + case .deprecatedExecutorCompletion: return 7 + case .deprecatedCommandDispatch: return 8 + case .deprecatedInfoItem: return 9 + case .deprecatedAfterQuery: return 10 + case .deprecatedFetchCommand: return 17 + case .deprecatedSyncCommand: return 18 + case .deprecatedCleanCommand: return 20 + case .deprecatedMobileInstallCommand: return 21 + case .deprecatedQuery: return 22 + case .deprecatedRunCommand: return 23 + case .deprecatedOptionsParsing: return 27 + case .interrupted: return 28 case .UNRECOGNIZED(let i): return i } } @@ -358,13 +975,21 @@ extension FailureDetails_Interrupted.Code: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. public static var allCases: [FailureDetails_Interrupted.Code] = [ .interruptedUnknown, - .build, - .buildCompletion, - .packageLoadingSync, - .executorCompletion, - .commandDispatch, - .infoItem, - .afterQuery, + .interrupted, + .deprecatedBuild, + .deprecatedBuildCompletion, + .deprecatedPackageLoadingSync, + .deprecatedExecutorCompletion, + .deprecatedCommandDispatch, + .deprecatedInfoItem, + .deprecatedAfterQuery, + .deprecatedFetchCommand, + .deprecatedSyncCommand, + .deprecatedCleanCommand, + .deprecatedMobileInstallCommand, + .deprecatedQuery, + .deprecatedRunCommand, + .deprecatedOptionsParsing, ] } @@ -377,8 +1002,16 @@ public struct FailureDetails_Spawn { public var code: FailureDetails_Spawn.Code = .spawnUnknown + /// For Codes describing generic failure to spawn (eg. EXECUTION_FAILED and + /// EXECUTION_DENIED) the `catastrophic` field may be set to true indicating a + /// failure that immediately terminated the entire build tool. public var catastrophic: Bool = false + /// If Code is NON_ZERO_EXIT, the `spawn_exit_code` field may be set to the + /// non-zero exit code returned by the spawned process to the OS. + /// + /// NOTE: This field must not be confused with the build tool's overall + /// exit code. public var spawnExitCode: Int32 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -386,12 +1019,27 @@ public struct FailureDetails_Spawn { public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int case spawnUnknown // = 0 + + /// See the SpawnResult.Status Java enum for definitions of the following + /// Spawn failure codes. case nonZeroExit // = 1 case timeout // = 2 + + /// Note: Spawn OUT_OF_MEMORY leads to a BUILD_FAILURE exit_code because the + /// build tool itself did not run out of memory. case outOfMemory // = 3 case executionFailed // = 4 case executionDenied // = 5 case remoteCacheFailed // = 6 + case commandLineExpansionFailure // = 7 + case execIoException // = 8 + case invalidTimeout // = 9 + case invalidRemoteExecutionProperties // = 10 + case noUsableStrategyFound // = 11 + + /// TODO(b/138456686): this code should be deprecated when SpawnResult is + /// refactored to prohibit undetailed failures + case unspecifiedExecutionFailure // = 12 case UNRECOGNIZED(Int) public init() { @@ -407,6 +1055,12 @@ public struct FailureDetails_Spawn { case 4: self = .executionFailed case 5: self = .executionDenied case 6: self = .remoteCacheFailed + case 7: self = .commandLineExpansionFailure + case 8: self = .execIoException + case 9: self = .invalidTimeout + case 10: self = .invalidRemoteExecutionProperties + case 11: self = .noUsableStrategyFound + case 12: self = .unspecifiedExecutionFailure default: self = .UNRECOGNIZED(rawValue) } } @@ -420,6 +1074,12 @@ public struct FailureDetails_Spawn { case .executionFailed: return 4 case .executionDenied: return 5 case .remoteCacheFailed: return 6 + case .commandLineExpansionFailure: return 7 + case .execIoException: return 8 + case .invalidTimeout: return 9 + case .invalidRemoteExecutionProperties: return 10 + case .noUsableStrategyFound: return 11 + case .unspecifiedExecutionFailure: return 12 case .UNRECOGNIZED(let i): return i } } @@ -441,6 +1101,12 @@ extension FailureDetails_Spawn.Code: CaseIterable { .executionFailed, .executionDenied, .remoteCacheFailed, + .commandLineExpansionFailure, + .execIoException, + .invalidTimeout, + .invalidRemoteExecutionProperties, + .noUsableStrategyFound, + .unspecifiedExecutionFailure, ] } @@ -451,6 +1117,7 @@ public struct FailureDetails_ExternalRepository { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Additional data could include external repository names. public var code: FailureDetails_ExternalRepository.Code = .externalRepositoryUnknown public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -459,6 +1126,7 @@ public struct FailureDetails_ExternalRepository { public typealias RawValue = Int case externalRepositoryUnknown // = 0 case overrideDisallowedManagedDirectories // = 1 + case badDownloaderConfig // = 2 case UNRECOGNIZED(Int) public init() { @@ -469,6 +1137,7 @@ public struct FailureDetails_ExternalRepository { switch rawValue { case 0: self = .externalRepositoryUnknown case 1: self = .overrideDisallowedManagedDirectories + case 2: self = .badDownloaderConfig default: self = .UNRECOGNIZED(rawValue) } } @@ -477,6 +1146,7 @@ public struct FailureDetails_ExternalRepository { switch self { case .externalRepositoryUnknown: return 0 case .overrideDisallowedManagedDirectories: return 1 + case .badDownloaderConfig: return 2 case .UNRECOGNIZED(let i): return i } } @@ -493,6 +1163,7 @@ extension FailureDetails_ExternalRepository.Code: CaseIterable { public static var allCases: [FailureDetails_ExternalRepository.Code] = [ .externalRepositoryUnknown, .overrideDisallowedManagedDirectories, + .badDownloaderConfig, ] } @@ -503,6 +1174,7 @@ public struct FailureDetails_BuildProgress { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Additional data could include the build progress upload endpoint. public var code: FailureDetails_BuildProgress.Code = .buildProgressUnknown public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -619,7 +1291,11 @@ public struct FailureDetails_RemoteOptions { public typealias RawValue = Int case remoteOptionsUnknown // = 0 case remoteDefaultExecPropertiesLogicError // = 1 + + /// Credentials could not be read from the requested file/socket/process/etc. case credentialsReadFailure // = 2 + + /// Credentials could not be written to a shared, temporary file. case credentialsWriteFailure // = 3 case downloaderWithoutGrpcCache // = 4 case executionWithInvalidCache // = 5 @@ -733,6 +1409,8 @@ public struct FailureDetails_Crash { public var code: FailureDetails_Crash.Code = .crashUnknown + /// The cause chain of the crash, with the outermost throwable first. Limited + /// to the outermost exception and at most 4 nested causes (so, max size of 5). public var causes: [FailureDetails_Throwable] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -785,10 +1463,15 @@ public struct FailureDetails_Throwable { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// The class name of the java.lang.Throwable. public var throwableClass: String = String() + /// The throwable's message. public var message: String = String() + /// The result of calling toString on the deepest (i.e. closest to the + /// throwable's construction site) 1000 (or fewer) StackTraceElements. + /// Unstructured to simplify string matching. public var stackTrace: [String] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -810,6 +1493,7 @@ public struct FailureDetails_SymlinkForest { case symlinkForestUnknown // = 0 case toplevelOutdirPackagePathConflict // = 1 case toplevelOutdirUsedAsSource // = 2 + case creationFailed // = 3 case UNRECOGNIZED(Int) public init() { @@ -821,6 +1505,7 @@ public struct FailureDetails_SymlinkForest { case 0: self = .symlinkForestUnknown case 1: self = .toplevelOutdirPackagePathConflict case 2: self = .toplevelOutdirUsedAsSource + case 3: self = .creationFailed default: self = .UNRECOGNIZED(rawValue) } } @@ -830,6 +1515,7 @@ public struct FailureDetails_SymlinkForest { case .symlinkForestUnknown: return 0 case .toplevelOutdirPackagePathConflict: return 1 case .toplevelOutdirUsedAsSource: return 2 + case .creationFailed: return 3 case .UNRECOGNIZED(let i): return i } } @@ -847,6 +1533,7 @@ extension FailureDetails_SymlinkForest.Code: CaseIterable { .symlinkForestUnknown, .toplevelOutdirPackagePathConflict, .toplevelOutdirUsedAsSource, + .creationFailed, ] } @@ -913,6 +1600,10 @@ public struct FailureDetails_RemoteExecution { public var unknownFields = SwiftProtobuf.UnknownStorage() + /// The association of some of these options with exit code 2, "command line + /// error", seems sketchy. Especially worth reconsidering are the channel init + /// failure modes, which can correspond to failures occurring in gRPC setup. + /// These all correspond with current Bazel behavior. public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int case remoteExecutionUnknown // = 0 @@ -928,6 +1619,10 @@ public struct FailureDetails_RemoteExecution { case downloadedInputsDeletionFailure // = 10 case remoteDownloadOutputsMinimalWithoutInmemoryDotd // = 11 case remoteDownloadOutputsMinimalWithoutInmemoryJdeps // = 12 + case incompleteOutputDownloadCleanupFailure // = 13 + case remoteDefaultPlatformPropertiesParseFailure // = 14 + case illegalOutput // = 15 + case invalidExecAndPlatformProperties // = 16 case UNRECOGNIZED(Int) public init() { @@ -949,6 +1644,10 @@ public struct FailureDetails_RemoteExecution { case 10: self = .downloadedInputsDeletionFailure case 11: self = .remoteDownloadOutputsMinimalWithoutInmemoryDotd case 12: self = .remoteDownloadOutputsMinimalWithoutInmemoryJdeps + case 13: self = .incompleteOutputDownloadCleanupFailure + case 14: self = .remoteDefaultPlatformPropertiesParseFailure + case 15: self = .illegalOutput + case 16: self = .invalidExecAndPlatformProperties default: self = .UNRECOGNIZED(rawValue) } } @@ -968,6 +1667,10 @@ public struct FailureDetails_RemoteExecution { case .downloadedInputsDeletionFailure: return 10 case .remoteDownloadOutputsMinimalWithoutInmemoryDotd: return 11 case .remoteDownloadOutputsMinimalWithoutInmemoryJdeps: return 12 + case .incompleteOutputDownloadCleanupFailure: return 13 + case .remoteDefaultPlatformPropertiesParseFailure: return 14 + case .illegalOutput: return 15 + case .invalidExecAndPlatformProperties: return 16 case .UNRECOGNIZED(let i): return i } } @@ -995,6 +1698,10 @@ extension FailureDetails_RemoteExecution.Code: CaseIterable { .downloadedInputsDeletionFailure, .remoteDownloadOutputsMinimalWithoutInmemoryDotd, .remoteDownloadOutputsMinimalWithoutInmemoryJdeps, + .incompleteOutputDownloadCleanupFailure, + .remoteDefaultPlatformPropertiesParseFailure, + .illegalOutput, + .invalidExecAndPlatformProperties, ] } @@ -1014,6 +1721,43 @@ public struct FailureDetails_Execution { case executionUnknown // = 0 case executionLogInitializationFailure // = 1 case executionLogWriteFailure // = 2 + case execrootCreationFailure // = 3 + case tempActionOutputDirectoryDeletionFailure // = 4 + case tempActionOutputDirectoryCreationFailure // = 5 + case persistentActionOutputDirectoryCreationFailure // = 6 + case localOutputDirectorySymlinkFailure // = 7 + + /// SOURCE_INPUT_MISSING + case localTemplateExpansionFailure // = 9 + case inputDirectoryCheckIoException // = 10 + case extraActionOutputCreationFailure // = 11 + case testRunnerIoException // = 12 + case fileWriteIoException // = 13 + case testOutErrIoException // = 14 + case symlinkTreeManifestCopyIoException // = 15 + case symlinkTreeManifestLinkIoException // = 16 + case symlinkTreeCreationIoException // = 17 + case symlinkTreeCreationCommandException // = 18 + case actionInputReadIoException // = 19 + case actionNotUpToDate // = 20 + case pseudoActionExecutionProhibited // = 21 + case discoveredInputDoesNotExist // = 22 + case actionOutputsDeletionFailure // = 23 + case actionOutputsNotCreated // = 24 + case actionFinalizationFailure // = 25 + case actionInputLost // = 26 + case filesystemContextUpdateFailure // = 27 + case actionOutputCloseFailure // = 28 + case inputDiscoveryIoException // = 29 + case treeArtifactDirectoryCreationFailure // = 30 + case actionOutputDirectoryCreationFailure // = 31 + case actionFsOutputDirectoryCreationFailure // = 32 + case actionFsOutErrDirectoryCreationFailure // = 33 + case nonActionExecutionFailure // = 34 + case cycle // = 35 + case sourceInputMissing // = 36 + case unexpectedException // = 37 + case sourceInputIoException // = 39 case UNRECOGNIZED(Int) public init() { @@ -1025,6 +1769,41 @@ public struct FailureDetails_Execution { case 0: self = .executionUnknown case 1: self = .executionLogInitializationFailure case 2: self = .executionLogWriteFailure + case 3: self = .execrootCreationFailure + case 4: self = .tempActionOutputDirectoryDeletionFailure + case 5: self = .tempActionOutputDirectoryCreationFailure + case 6: self = .persistentActionOutputDirectoryCreationFailure + case 7: self = .localOutputDirectorySymlinkFailure + case 9: self = .localTemplateExpansionFailure + case 10: self = .inputDirectoryCheckIoException + case 11: self = .extraActionOutputCreationFailure + case 12: self = .testRunnerIoException + case 13: self = .fileWriteIoException + case 14: self = .testOutErrIoException + case 15: self = .symlinkTreeManifestCopyIoException + case 16: self = .symlinkTreeManifestLinkIoException + case 17: self = .symlinkTreeCreationIoException + case 18: self = .symlinkTreeCreationCommandException + case 19: self = .actionInputReadIoException + case 20: self = .actionNotUpToDate + case 21: self = .pseudoActionExecutionProhibited + case 22: self = .discoveredInputDoesNotExist + case 23: self = .actionOutputsDeletionFailure + case 24: self = .actionOutputsNotCreated + case 25: self = .actionFinalizationFailure + case 26: self = .actionInputLost + case 27: self = .filesystemContextUpdateFailure + case 28: self = .actionOutputCloseFailure + case 29: self = .inputDiscoveryIoException + case 30: self = .treeArtifactDirectoryCreationFailure + case 31: self = .actionOutputDirectoryCreationFailure + case 32: self = .actionFsOutputDirectoryCreationFailure + case 33: self = .actionFsOutErrDirectoryCreationFailure + case 34: self = .nonActionExecutionFailure + case 35: self = .cycle + case 36: self = .sourceInputMissing + case 37: self = .unexpectedException + case 39: self = .sourceInputIoException default: self = .UNRECOGNIZED(rawValue) } } @@ -1034,6 +1813,41 @@ public struct FailureDetails_Execution { case .executionUnknown: return 0 case .executionLogInitializationFailure: return 1 case .executionLogWriteFailure: return 2 + case .execrootCreationFailure: return 3 + case .tempActionOutputDirectoryDeletionFailure: return 4 + case .tempActionOutputDirectoryCreationFailure: return 5 + case .persistentActionOutputDirectoryCreationFailure: return 6 + case .localOutputDirectorySymlinkFailure: return 7 + case .localTemplateExpansionFailure: return 9 + case .inputDirectoryCheckIoException: return 10 + case .extraActionOutputCreationFailure: return 11 + case .testRunnerIoException: return 12 + case .fileWriteIoException: return 13 + case .testOutErrIoException: return 14 + case .symlinkTreeManifestCopyIoException: return 15 + case .symlinkTreeManifestLinkIoException: return 16 + case .symlinkTreeCreationIoException: return 17 + case .symlinkTreeCreationCommandException: return 18 + case .actionInputReadIoException: return 19 + case .actionNotUpToDate: return 20 + case .pseudoActionExecutionProhibited: return 21 + case .discoveredInputDoesNotExist: return 22 + case .actionOutputsDeletionFailure: return 23 + case .actionOutputsNotCreated: return 24 + case .actionFinalizationFailure: return 25 + case .actionInputLost: return 26 + case .filesystemContextUpdateFailure: return 27 + case .actionOutputCloseFailure: return 28 + case .inputDiscoveryIoException: return 29 + case .treeArtifactDirectoryCreationFailure: return 30 + case .actionOutputDirectoryCreationFailure: return 31 + case .actionFsOutputDirectoryCreationFailure: return 32 + case .actionFsOutErrDirectoryCreationFailure: return 33 + case .nonActionExecutionFailure: return 34 + case .cycle: return 35 + case .sourceInputMissing: return 36 + case .unexpectedException: return 37 + case .sourceInputIoException: return 39 case .UNRECOGNIZED(let i): return i } } @@ -1051,11 +1865,47 @@ extension FailureDetails_Execution.Code: CaseIterable { .executionUnknown, .executionLogInitializationFailure, .executionLogWriteFailure, + .execrootCreationFailure, + .tempActionOutputDirectoryDeletionFailure, + .tempActionOutputDirectoryCreationFailure, + .persistentActionOutputDirectoryCreationFailure, + .localOutputDirectorySymlinkFailure, + .localTemplateExpansionFailure, + .inputDirectoryCheckIoException, + .extraActionOutputCreationFailure, + .testRunnerIoException, + .fileWriteIoException, + .testOutErrIoException, + .symlinkTreeManifestCopyIoException, + .symlinkTreeManifestLinkIoException, + .symlinkTreeCreationIoException, + .symlinkTreeCreationCommandException, + .actionInputReadIoException, + .actionNotUpToDate, + .pseudoActionExecutionProhibited, + .discoveredInputDoesNotExist, + .actionOutputsDeletionFailure, + .actionOutputsNotCreated, + .actionFinalizationFailure, + .actionInputLost, + .filesystemContextUpdateFailure, + .actionOutputCloseFailure, + .inputDiscoveryIoException, + .treeArtifactDirectoryCreationFailure, + .actionOutputDirectoryCreationFailure, + .actionFsOutputDirectoryCreationFailure, + .actionFsOutErrDirectoryCreationFailure, + .nonActionExecutionFailure, + .cycle, + .sourceInputMissing, + .unexpectedException, + .sourceInputIoException, ] } #endif // swift(>=4.2) +/// Failure details about Bazel's WORKSPACE features. public struct FailureDetails_Workspaces { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1070,6 +1920,9 @@ public struct FailureDetails_Workspaces { case workspacesUnknown // = 0 case workspacesLogInitializationFailure // = 1 case workspacesLogWriteFailure // = 2 + + /// See `managed_directories` in + /// https://docs.bazel.build/versions/master/skylark/lib/globals.html#workspace. case illegalWorkspaceFileSymlinkWithManagedDirectories // = 3 case workspaceFileReadFailureWithManagedDirectories // = 4 case UNRECOGNIZED(Int) @@ -1180,8 +2033,6 @@ public struct FailureDetails_Filesystem { public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int case filesystemUnknown // = 0 - case defaultDigestHashFunctionChanged // = 1 - case defaultDigestHashFunctionNotSet // = 2 case embeddedBinariesEnumerationFailure // = 3 case serverPidTxtFileReadFailure // = 4 case serverFileWriteFailure // = 5 @@ -1195,8 +2046,6 @@ public struct FailureDetails_Filesystem { public init?(rawValue: Int) { switch rawValue { case 0: self = .filesystemUnknown - case 1: self = .defaultDigestHashFunctionChanged - case 2: self = .defaultDigestHashFunctionNotSet case 3: self = .embeddedBinariesEnumerationFailure case 4: self = .serverPidTxtFileReadFailure case 5: self = .serverFileWriteFailure @@ -1208,8 +2057,6 @@ public struct FailureDetails_Filesystem { public var rawValue: Int { switch self { case .filesystemUnknown: return 0 - case .defaultDigestHashFunctionChanged: return 1 - case .defaultDigestHashFunctionNotSet: return 2 case .embeddedBinariesEnumerationFailure: return 3 case .serverPidTxtFileReadFailure: return 4 case .serverFileWriteFailure: return 5 @@ -1229,8 +2076,6 @@ extension FailureDetails_Filesystem.Code: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. public static var allCases: [FailureDetails_Filesystem.Code] = [ .filesystemUnknown, - .defaultDigestHashFunctionChanged, - .defaultDigestHashFunctionNotSet, .embeddedBinariesEnumerationFailure, .serverPidTxtFileReadFailure, .serverFileWriteFailure, @@ -1249,11 +2094,23 @@ public struct FailureDetails_ExecutionOptions { public var unknownFields = SwiftProtobuf.UnknownStorage() + /// All numerical exit code associations correspond to pre-existing Bazel + /// behavior. These associations are suspicious: + /// - REQUESTED_STRATEGY_INCOMPATIBLE_WITH_SANDBOXING (instead: 2?) + /// - DEPRECATED_LOCAL_RESOURCES_USED (instead: 2?) + /// TODO(b/138456686): Revise these after the (intentionally non-breaking) + /// initial rollout of FailureDetail-based encoding. public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int case executionOptionsUnknown // = 0 case invalidStrategy // = 3 case requestedStrategyIncompatibleWithSandboxing // = 4 + case deprecatedLocalResourcesUsed // = 5 + case invalidCyclicDynamicStrategy // = 6 + case restrictionUnmatchedToActionContext // = 7 + case remoteFallbackStrategyNotAbstractSpawn // = 8 + case strategyNotFound // = 9 + case dynamicStrategyNotSandboxed // = 10 case UNRECOGNIZED(Int) public init() { @@ -1265,6 +2122,12 @@ public struct FailureDetails_ExecutionOptions { case 0: self = .executionOptionsUnknown case 3: self = .invalidStrategy case 4: self = .requestedStrategyIncompatibleWithSandboxing + case 5: self = .deprecatedLocalResourcesUsed + case 6: self = .invalidCyclicDynamicStrategy + case 7: self = .restrictionUnmatchedToActionContext + case 8: self = .remoteFallbackStrategyNotAbstractSpawn + case 9: self = .strategyNotFound + case 10: self = .dynamicStrategyNotSandboxed default: self = .UNRECOGNIZED(rawValue) } } @@ -1274,6 +2137,12 @@ public struct FailureDetails_ExecutionOptions { case .executionOptionsUnknown: return 0 case .invalidStrategy: return 3 case .requestedStrategyIncompatibleWithSandboxing: return 4 + case .deprecatedLocalResourcesUsed: return 5 + case .invalidCyclicDynamicStrategy: return 6 + case .restrictionUnmatchedToActionContext: return 7 + case .remoteFallbackStrategyNotAbstractSpawn: return 8 + case .strategyNotFound: return 9 + case .dynamicStrategyNotSandboxed: return 10 case .UNRECOGNIZED(let i): return i } } @@ -1291,6 +2160,12 @@ extension FailureDetails_ExecutionOptions.Code: CaseIterable { .executionOptionsUnknown, .invalidStrategy, .requestedStrategyIncompatibleWithSandboxing, + .deprecatedLocalResourcesUsed, + .invalidCyclicDynamicStrategy, + .restrictionUnmatchedToActionContext, + .remoteFallbackStrategyNotAbstractSpawn, + .strategyNotFound, + .dynamicStrategyNotSandboxed, ] } @@ -1307,6 +2182,10 @@ public struct FailureDetails_Command { public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int + + /// The name "COMMAND_UNKNOWN" might reasonably be interpreted as "command + /// not found". The enum's default value should represent a lack of knowledge + /// about the failure instead. case commandFailureUnknown // = 0 case commandNotFound // = 1 case anotherCommandRunning // = 2 @@ -1319,6 +2198,9 @@ public struct FailureDetails_Command { case optionsParseFailure // = 9 case starlarkOptionsParseFailure // = 10 case argumentsNotRecognized // = 11 + case notInWorkspace // = 12 + case spacesInWorkspacePath // = 13 + case inOutputDirectory // = 14 case UNRECOGNIZED(Int) public init() { @@ -1339,6 +2221,9 @@ public struct FailureDetails_Command { case 9: self = .optionsParseFailure case 10: self = .starlarkOptionsParseFailure case 11: self = .argumentsNotRecognized + case 12: self = .notInWorkspace + case 13: self = .spacesInWorkspacePath + case 14: self = .inOutputDirectory default: self = .UNRECOGNIZED(rawValue) } } @@ -1357,6 +2242,9 @@ public struct FailureDetails_Command { case .optionsParseFailure: return 9 case .starlarkOptionsParseFailure: return 10 case .argumentsNotRecognized: return 11 + case .notInWorkspace: return 12 + case .spacesInWorkspacePath: return 13 + case .inOutputDirectory: return 14 case .UNRECOGNIZED(let i): return i } } @@ -1383,6 +2271,9 @@ extension FailureDetails_Command.Code: CaseIterable { .optionsParseFailure, .starlarkOptionsParseFailure, .argumentsNotRecognized, + .notInWorkspace, + .spacesInWorkspacePath, + .inOutputDirectory, ] } @@ -1504,6 +2395,11 @@ extension FailureDetails_CanonicalizeFlags.Code: CaseIterable { #endif // swift(>=4.2) +/// Failure modes described by this category pertain to the Bazel invocation +/// configuration consumed by Bazel's analysis phase. This category is not +/// intended as a grab-bag for all Bazel flag value constraint violations, which +/// instead generally belong in the category for the subsystem whose flag values +/// participate in the constraint. public struct FailureDetails_BuildConfiguration { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1517,6 +2413,21 @@ public struct FailureDetails_BuildConfiguration { public typealias RawValue = Int case buildConfigurationUnknown // = 0 case platformMappingEvaluationFailure // = 1 + case platformMappingsFileIsDirectory // = 2 + case platformMappingsFileNotFound // = 3 + case topLevelConfigurationCreationFailure // = 4 + case invalidConfiguration // = 5 + case invalidBuildOptions // = 6 + case multiCpuPrereqUnmet // = 7 + case heuristicInstrumentationFilterInvalid // = 8 + case cycle // = 9 + case conflictingConfigurations // = 10 + + /// This can come from either an invalid user-specified option or a + /// configuration transition. There's no sure-fire way to distinguish the two + /// possibilities in Bazel, so we go with the more straightforward + /// command-line error exit code 2. + case invalidOutputDirectoryMnemonic // = 11 case UNRECOGNIZED(Int) public init() { @@ -1527,6 +2438,16 @@ public struct FailureDetails_BuildConfiguration { switch rawValue { case 0: self = .buildConfigurationUnknown case 1: self = .platformMappingEvaluationFailure + case 2: self = .platformMappingsFileIsDirectory + case 3: self = .platformMappingsFileNotFound + case 4: self = .topLevelConfigurationCreationFailure + case 5: self = .invalidConfiguration + case 6: self = .invalidBuildOptions + case 7: self = .multiCpuPrereqUnmet + case 8: self = .heuristicInstrumentationFilterInvalid + case 9: self = .cycle + case 10: self = .conflictingConfigurations + case 11: self = .invalidOutputDirectoryMnemonic default: self = .UNRECOGNIZED(rawValue) } } @@ -1535,6 +2456,16 @@ public struct FailureDetails_BuildConfiguration { switch self { case .buildConfigurationUnknown: return 0 case .platformMappingEvaluationFailure: return 1 + case .platformMappingsFileIsDirectory: return 2 + case .platformMappingsFileNotFound: return 3 + case .topLevelConfigurationCreationFailure: return 4 + case .invalidConfiguration: return 5 + case .invalidBuildOptions: return 6 + case .multiCpuPrereqUnmet: return 7 + case .heuristicInstrumentationFilterInvalid: return 8 + case .cycle: return 9 + case .conflictingConfigurations: return 10 + case .invalidOutputDirectoryMnemonic: return 11 case .UNRECOGNIZED(let i): return i } } @@ -1551,6 +2482,16 @@ extension FailureDetails_BuildConfiguration.Code: CaseIterable { public static var allCases: [FailureDetails_BuildConfiguration.Code] = [ .buildConfigurationUnknown, .platformMappingEvaluationFailure, + .platformMappingsFileIsDirectory, + .platformMappingsFileNotFound, + .topLevelConfigurationCreationFailure, + .invalidConfiguration, + .invalidBuildOptions, + .multiCpuPrereqUnmet, + .heuristicInstrumentationFilterInvalid, + .cycle, + .conflictingConfigurations, + .invalidOutputDirectoryMnemonic, ] } @@ -1565,6 +2506,9 @@ public struct FailureDetails_InfoCommand { public var unknownFields = SwiftProtobuf.UnknownStorage() + /// The distinction between a failure to write a single info item and a failure + /// to write them all seems sketchy. Why do they have different exit codes? + /// This reflects current Bazel behavior, but deserves more thought. public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int case infoCommandUnknown // = 0 @@ -1633,6 +2577,7 @@ public struct FailureDetails_MemoryOptions { public typealias RawValue = Int case memoryOptionsUnknown // = 0 case experimentalOomMoreEagerlyThresholdInvalidValue // = 1 + case experimentalOomMoreEagerlyNoTenuredCollectorsFound // = 2 case UNRECOGNIZED(Int) public init() { @@ -1643,6 +2588,7 @@ public struct FailureDetails_MemoryOptions { switch rawValue { case 0: self = .memoryOptionsUnknown case 1: self = .experimentalOomMoreEagerlyThresholdInvalidValue + case 2: self = .experimentalOomMoreEagerlyNoTenuredCollectorsFound default: self = .UNRECOGNIZED(rawValue) } } @@ -1651,6 +2597,7 @@ public struct FailureDetails_MemoryOptions { switch self { case .memoryOptionsUnknown: return 0 case .experimentalOomMoreEagerlyThresholdInvalidValue: return 1 + case .experimentalOomMoreEagerlyNoTenuredCollectorsFound: return 2 case .UNRECOGNIZED(let i): return i } } @@ -1667,6 +2614,7 @@ extension FailureDetails_MemoryOptions.Code: CaseIterable { public static var allCases: [FailureDetails_MemoryOptions.Code] = [ .memoryOptionsUnknown, .experimentalOomMoreEagerlyThresholdInvalidValue, + .experimentalOomMoreEagerlyNoTenuredCollectorsFound, ] } @@ -1692,6 +2640,46 @@ public struct FailureDetails_Query { case queryOutputWriteFailure // = 6 case queryStdoutFlushFailure // = 13 case analysisQueryPrereqUnmet // = 14 + case queryResultsFlushFailure // = 15 + + /// Deprecated - folded into SYNTAX_ERROR. + case deprecatedUnclosedQuotationExpressionError // = 16 + case variableNameInvalid // = 17 + case variableUndefined // = 18 + case buildfilesAndLoadfilesCannotUseOutputLocationError // = 19 + case buildFileError // = 20 + case cycle // = 21 + case uniqueSkykeyThresholdExceeded // = 22 + case targetNotInUniverseScope // = 23 + case invalidFullUniverseExpression // = 24 + case universeScopeLimitExceeded // = 25 + case invalidationLimitExceeded // = 26 + case outputFormatPrereqUnmet // = 27 + case argumentsMissing // = 28 + case rbuildfilesFunctionRequiresSkyquery // = 29 + case fullTargetsNotSupported // = 30 + + /// Deprecated - folded into SYNTAX_ERROR. + case deprecatedUnexpectedTokenError // = 31 + + /// Deprecated - folded into SYNTAX_ERROR. + case deprecatedIntegerLiteralMissing // = 32 + + /// Deprecated - folded into SYNTAX_ERROR. + case deprecatedInvalidStartingCharacterError // = 33 + + /// Deprecated - folded into SYNTAX_ERROR. + case deprecatedPrematureEndOfInputError // = 34 + + /// Indicates the user specified invalid query syntax. + case syntaxError // = 35 + case outputFormatterIoException // = 36 + case skyqueryTransitiveTargetError // = 37 + case skyqueryTargetException // = 38 + case invalidLabelInTestSuite // = 39 + + /// Indicates any usage of flags that must not be combined. + case illegalFlagCombination // = 40 case UNRECOGNIZED(Int) public init() { @@ -1709,6 +2697,32 @@ public struct FailureDetails_Query { case 6: self = .queryOutputWriteFailure case 13: self = .queryStdoutFlushFailure case 14: self = .analysisQueryPrereqUnmet + case 15: self = .queryResultsFlushFailure + case 16: self = .deprecatedUnclosedQuotationExpressionError + case 17: self = .variableNameInvalid + case 18: self = .variableUndefined + case 19: self = .buildfilesAndLoadfilesCannotUseOutputLocationError + case 20: self = .buildFileError + case 21: self = .cycle + case 22: self = .uniqueSkykeyThresholdExceeded + case 23: self = .targetNotInUniverseScope + case 24: self = .invalidFullUniverseExpression + case 25: self = .universeScopeLimitExceeded + case 26: self = .invalidationLimitExceeded + case 27: self = .outputFormatPrereqUnmet + case 28: self = .argumentsMissing + case 29: self = .rbuildfilesFunctionRequiresSkyquery + case 30: self = .fullTargetsNotSupported + case 31: self = .deprecatedUnexpectedTokenError + case 32: self = .deprecatedIntegerLiteralMissing + case 33: self = .deprecatedInvalidStartingCharacterError + case 34: self = .deprecatedPrematureEndOfInputError + case 35: self = .syntaxError + case 36: self = .outputFormatterIoException + case 37: self = .skyqueryTransitiveTargetError + case 38: self = .skyqueryTargetException + case 39: self = .invalidLabelInTestSuite + case 40: self = .illegalFlagCombination default: self = .UNRECOGNIZED(rawValue) } } @@ -1724,6 +2738,32 @@ public struct FailureDetails_Query { case .queryOutputWriteFailure: return 6 case .queryStdoutFlushFailure: return 13 case .analysisQueryPrereqUnmet: return 14 + case .queryResultsFlushFailure: return 15 + case .deprecatedUnclosedQuotationExpressionError: return 16 + case .variableNameInvalid: return 17 + case .variableUndefined: return 18 + case .buildfilesAndLoadfilesCannotUseOutputLocationError: return 19 + case .buildFileError: return 20 + case .cycle: return 21 + case .uniqueSkykeyThresholdExceeded: return 22 + case .targetNotInUniverseScope: return 23 + case .invalidFullUniverseExpression: return 24 + case .universeScopeLimitExceeded: return 25 + case .invalidationLimitExceeded: return 26 + case .outputFormatPrereqUnmet: return 27 + case .argumentsMissing: return 28 + case .rbuildfilesFunctionRequiresSkyquery: return 29 + case .fullTargetsNotSupported: return 30 + case .deprecatedUnexpectedTokenError: return 31 + case .deprecatedIntegerLiteralMissing: return 32 + case .deprecatedInvalidStartingCharacterError: return 33 + case .deprecatedPrematureEndOfInputError: return 34 + case .syntaxError: return 35 + case .outputFormatterIoException: return 36 + case .skyqueryTransitiveTargetError: return 37 + case .skyqueryTargetException: return 38 + case .invalidLabelInTestSuite: return 39 + case .illegalFlagCombination: return 40 case .UNRECOGNIZED(let i): return i } } @@ -1747,6 +2787,32 @@ extension FailureDetails_Query.Code: CaseIterable { .queryOutputWriteFailure, .queryStdoutFlushFailure, .analysisQueryPrereqUnmet, + .queryResultsFlushFailure, + .deprecatedUnclosedQuotationExpressionError, + .variableNameInvalid, + .variableUndefined, + .buildfilesAndLoadfilesCannotUseOutputLocationError, + .buildFileError, + .cycle, + .uniqueSkykeyThresholdExceeded, + .targetNotInUniverseScope, + .invalidFullUniverseExpression, + .universeScopeLimitExceeded, + .invalidationLimitExceeded, + .outputFormatPrereqUnmet, + .argumentsMissing, + .rbuildfilesFunctionRequiresSkyquery, + .fullTargetsNotSupported, + .deprecatedUnexpectedTokenError, + .deprecatedIntegerLiteralMissing, + .deprecatedInvalidStartingCharacterError, + .deprecatedPrematureEndOfInputError, + .syntaxError, + .outputFormatterIoException, + .skyqueryTransitiveTargetError, + .skyqueryTargetException, + .invalidLabelInTestSuite, + .illegalFlagCombination, ] } @@ -1804,1349 +2870,6564 @@ extension FailureDetails_LocalExecution.Code: CaseIterable { #endif // swift(>=4.2) -// MARK: - Extension support defined in failure_details.proto. +public struct FailureDetails_ActionCache { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. -extension SwiftProtobuf.Google_Protobuf_EnumValueOptions { + public var code: FailureDetails_ActionCache.Code = .actionCacheUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case actionCacheUnknown // = 0 + case initializationFailure // = 1 + case UNRECOGNIZED(Int) + + public init() { + self = .actionCacheUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .actionCacheUnknown + case 1: self = .initializationFailure + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .actionCacheUnknown: return 0 + case .initializationFailure: return 1 + case .UNRECOGNIZED(let i): return i + } + } - public var FailureDetails_metadata: FailureDetails_FailureDetailMetadata { - get {return getExtensionValue(ext: FailureDetails_Extensions_metadata) ?? FailureDetails_FailureDetailMetadata()} - set {setExtensionValue(ext: FailureDetails_Extensions_metadata, value: newValue)} - } - /// Returns true if extension `FailureDetails_Extensions_metadata` - /// has been explicitly set. - public var hasFailureDetails_metadata: Bool { - return hasExtensionValue(ext: FailureDetails_Extensions_metadata) - } - /// Clears the value of extension `FailureDetails_Extensions_metadata`. - /// Subsequent reads from it will return its default value. - public mutating func clearFailureDetails_metadata() { - clearExtensionValue(ext: FailureDetails_Extensions_metadata) } + public init() {} } -/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by -/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed -/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create -/// a larger `SwiftProtobuf.SimpleExtensionMap`. -public let FailureDetails_FailureDetails_Extensions: SwiftProtobuf.SimpleExtensionMap = [ - FailureDetails_Extensions_metadata -] +#if swift(>=4.2) -let FailureDetails_Extensions_metadata = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_EnumValueOptions>( - _protobuf_fieldNumber: 1078, - fieldName: "failure_details.metadata" -) +extension FailureDetails_ActionCache.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_ActionCache.Code] = [ + .actionCacheUnknown, + .initializationFailure, + ] +} -// MARK: - Code below here is support for the SwiftProtobuf runtime. +#endif // swift(>=4.2) -fileprivate let _protobuf_package = "failure_details" +public struct FailureDetails_FetchCommand { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. -extension FailureDetails_FailureDetailMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FailureDetailMetadata" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "exit_code"), - ] + public var code: FailureDetails_FetchCommand.Code = .fetchCommandUnknown - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularUInt32Field(value: &self.exitCode) - default: break + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case fetchCommandUnknown // = 0 + case expressionMissing // = 1 + case optionsInvalid // = 2 + case queryParseError // = 3 + case queryEvaluationError // = 4 + case UNRECOGNIZED(Int) + + public init() { + self = .fetchCommandUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .fetchCommandUnknown + case 1: self = .expressionMissing + case 2: self = .optionsInvalid + case 3: self = .queryParseError + case 4: self = .queryEvaluationError + default: self = .UNRECOGNIZED(rawValue) } } - } - public func traverse(visitor: inout V) throws { - if self.exitCode != 0 { - try visitor.visitSingularUInt32Field(value: self.exitCode, fieldNumber: 1) + public var rawValue: Int { + switch self { + case .fetchCommandUnknown: return 0 + case .expressionMissing: return 1 + case .optionsInvalid: return 2 + case .queryParseError: return 3 + case .queryEvaluationError: return 4 + case .UNRECOGNIZED(let i): return i + } } - try unknownFields.traverse(visitor: &visitor) - } - public static func ==(lhs: FailureDetails_FailureDetailMetadata, rhs: FailureDetails_FailureDetailMetadata) -> Bool { - if lhs.exitCode != rhs.exitCode {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true } + + public init() {} } -extension FailureDetails_FailureDetail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FailureDetail" +#if swift(>=4.2) + +extension FailureDetails_FetchCommand.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_FetchCommand.Code] = [ + .fetchCommandUnknown, + .expressionMissing, + .optionsInvalid, + .queryParseError, + .queryEvaluationError, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_SyncCommand { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_SyncCommand.Code = .syncCommandUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case syncCommandUnknown // = 0 + case packageLookupError // = 1 + case workspaceEvaluationError // = 2 + case repositoryFetchErrors // = 3 + case repositoryNameInvalid // = 4 + case UNRECOGNIZED(Int) + + public init() { + self = .syncCommandUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .syncCommandUnknown + case 1: self = .packageLookupError + case 2: self = .workspaceEvaluationError + case 3: self = .repositoryFetchErrors + case 4: self = .repositoryNameInvalid + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .syncCommandUnknown: return 0 + case .packageLookupError: return 1 + case .workspaceEvaluationError: return 2 + case .repositoryFetchErrors: return 3 + case .repositoryNameInvalid: return 4 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_SyncCommand.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_SyncCommand.Code] = [ + .syncCommandUnknown, + .packageLookupError, + .workspaceEvaluationError, + .repositoryFetchErrors, + .repositoryNameInvalid, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_Sandbox { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_Sandbox.Code = .sandboxFailureUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case sandboxFailureUnknown // = 0 + case initializationFailure // = 1 + case executionIoException // = 2 + case dockerCommandFailure // = 3 + case noDockerImage // = 4 + case dockerImagePreparationFailure // = 5 + case bindMountAnalysisFailure // = 6 + case mountSourceDoesNotExist // = 7 + case mountSourceTargetTypeMismatch // = 8 + case mountTargetDoesNotExist // = 9 + case subprocessStartFailed // = 10 + case UNRECOGNIZED(Int) + + public init() { + self = .sandboxFailureUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .sandboxFailureUnknown + case 1: self = .initializationFailure + case 2: self = .executionIoException + case 3: self = .dockerCommandFailure + case 4: self = .noDockerImage + case 5: self = .dockerImagePreparationFailure + case 6: self = .bindMountAnalysisFailure + case 7: self = .mountSourceDoesNotExist + case 8: self = .mountSourceTargetTypeMismatch + case 9: self = .mountTargetDoesNotExist + case 10: self = .subprocessStartFailed + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .sandboxFailureUnknown: return 0 + case .initializationFailure: return 1 + case .executionIoException: return 2 + case .dockerCommandFailure: return 3 + case .noDockerImage: return 4 + case .dockerImagePreparationFailure: return 5 + case .bindMountAnalysisFailure: return 6 + case .mountSourceDoesNotExist: return 7 + case .mountSourceTargetTypeMismatch: return 8 + case .mountTargetDoesNotExist: return 9 + case .subprocessStartFailed: return 10 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_Sandbox.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_Sandbox.Code] = [ + .sandboxFailureUnknown, + .initializationFailure, + .executionIoException, + .dockerCommandFailure, + .noDockerImage, + .dockerImagePreparationFailure, + .bindMountAnalysisFailure, + .mountSourceDoesNotExist, + .mountSourceTargetTypeMismatch, + .mountTargetDoesNotExist, + .subprocessStartFailed, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_IncludeScanning { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_IncludeScanning.Code = .includeScanningUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case includeScanningUnknown // = 0 + case initializeIncludeHintsError // = 1 + case scanningIoException // = 2 + case includeHintsFileNotInPackage // = 3 + case includeHintsReadFailure // = 4 + case illegalAbsolutePath // = 5 + + /// TODO(b/138456686): this code should be deprecated in favor of more finely + /// resolved loading-phase codes. + case packageLoadFailure // = 6 + case UNRECOGNIZED(Int) + + public init() { + self = .includeScanningUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .includeScanningUnknown + case 1: self = .initializeIncludeHintsError + case 2: self = .scanningIoException + case 3: self = .includeHintsFileNotInPackage + case 4: self = .includeHintsReadFailure + case 5: self = .illegalAbsolutePath + case 6: self = .packageLoadFailure + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .includeScanningUnknown: return 0 + case .initializeIncludeHintsError: return 1 + case .scanningIoException: return 2 + case .includeHintsFileNotInPackage: return 3 + case .includeHintsReadFailure: return 4 + case .illegalAbsolutePath: return 5 + case .packageLoadFailure: return 6 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_IncludeScanning.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_IncludeScanning.Code] = [ + .includeScanningUnknown, + .initializeIncludeHintsError, + .scanningIoException, + .includeHintsFileNotInPackage, + .includeHintsReadFailure, + .illegalAbsolutePath, + .packageLoadFailure, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_TestCommand { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_TestCommand.Code = .testCommandUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case testCommandUnknown // = 0 + case noTestTargets // = 1 + case testWithNoanalyze // = 2 + case testsFailed // = 3 + case UNRECOGNIZED(Int) + + public init() { + self = .testCommandUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .testCommandUnknown + case 1: self = .noTestTargets + case 2: self = .testWithNoanalyze + case 3: self = .testsFailed + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .testCommandUnknown: return 0 + case .noTestTargets: return 1 + case .testWithNoanalyze: return 2 + case .testsFailed: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_TestCommand.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_TestCommand.Code] = [ + .testCommandUnknown, + .noTestTargets, + .testWithNoanalyze, + .testsFailed, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_ActionQuery { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_ActionQuery.Code = .actionQueryUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + /// All numerical exit code associations correspond to pre-existing Bazel + /// behavior. These associations are suspicious: + /// - COMMAND_LINE_EXPANSION_FAILURE: this is associated with 2, the numerical + /// exit code for "bad Bazel command line", but is generated when an + /// action's command line fails to expand, which sounds similar but is + /// completely different. + /// - OUTPUT_FAILURE: this is associated with 6, an undocumented exit code. + /// - INVALID_AQUERY_EXPRESSION: this is associate with 1, which is not + /// documented for (a)query. + /// TODO(b/138456686): Revise these after the (intentionally non-breaking) + /// initial rollout of FailureDetail-based encoding. + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case actionQueryUnknown // = 0 + case commandLineExpansionFailure // = 1 + case outputFailure // = 2 + case commandLineExpressionMissing // = 3 + case expressionParseFailure // = 4 + case skyframeStateWithCommandLineExpression // = 5 + case invalidAqueryExpression // = 6 + case skyframeStatePrereqUnmet // = 7 + case aqueryOutputTooBig // = 8 + case illegalPatternSyntax // = 9 + case incorrectArguments // = 10 + case topLevelTargetsWithSkyframeStateNotSupported // = 11 + case skyframeStateAfterExecution // = 12 + case UNRECOGNIZED(Int) + + public init() { + self = .actionQueryUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .actionQueryUnknown + case 1: self = .commandLineExpansionFailure + case 2: self = .outputFailure + case 3: self = .commandLineExpressionMissing + case 4: self = .expressionParseFailure + case 5: self = .skyframeStateWithCommandLineExpression + case 6: self = .invalidAqueryExpression + case 7: self = .skyframeStatePrereqUnmet + case 8: self = .aqueryOutputTooBig + case 9: self = .illegalPatternSyntax + case 10: self = .incorrectArguments + case 11: self = .topLevelTargetsWithSkyframeStateNotSupported + case 12: self = .skyframeStateAfterExecution + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .actionQueryUnknown: return 0 + case .commandLineExpansionFailure: return 1 + case .outputFailure: return 2 + case .commandLineExpressionMissing: return 3 + case .expressionParseFailure: return 4 + case .skyframeStateWithCommandLineExpression: return 5 + case .invalidAqueryExpression: return 6 + case .skyframeStatePrereqUnmet: return 7 + case .aqueryOutputTooBig: return 8 + case .illegalPatternSyntax: return 9 + case .incorrectArguments: return 10 + case .topLevelTargetsWithSkyframeStateNotSupported: return 11 + case .skyframeStateAfterExecution: return 12 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_ActionQuery.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_ActionQuery.Code] = [ + .actionQueryUnknown, + .commandLineExpansionFailure, + .outputFailure, + .commandLineExpressionMissing, + .expressionParseFailure, + .skyframeStateWithCommandLineExpression, + .invalidAqueryExpression, + .skyframeStatePrereqUnmet, + .aqueryOutputTooBig, + .illegalPatternSyntax, + .incorrectArguments, + .topLevelTargetsWithSkyframeStateNotSupported, + .skyframeStateAfterExecution, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_TargetPatterns { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_TargetPatterns.Code = .targetPatternsUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case targetPatternsUnknown // = 0 + case targetPatternFileWithCommandLinePattern // = 1 + case targetPatternFileReadFailure // = 2 + case targetPatternParseFailure // = 3 + case packageNotFound // = 4 + case targetFormatInvalid // = 5 + case absoluteTargetPatternInvalid // = 6 + case cannotDetermineTargetFromFilename // = 7 + case labelSyntaxError // = 8 + case targetCannotBeEmptyString // = 9 + case packagePartCannotEndInSlash // = 10 + case cycle // = 11 + case cannotPreloadTarget // = 12 + case targetsMissing // = 13 + case recursiveTargetPatternsNotAllowed // = 14 + case upLevelReferencesNotAllowed // = 15 + case negativeTargetPatternNotAllowed // = 16 + case targetMustBeAFile // = 17 + case dependencyNotFound // = 18 + case packageNameInvalid // = 19 + case UNRECOGNIZED(Int) + + public init() { + self = .targetPatternsUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .targetPatternsUnknown + case 1: self = .targetPatternFileWithCommandLinePattern + case 2: self = .targetPatternFileReadFailure + case 3: self = .targetPatternParseFailure + case 4: self = .packageNotFound + case 5: self = .targetFormatInvalid + case 6: self = .absoluteTargetPatternInvalid + case 7: self = .cannotDetermineTargetFromFilename + case 8: self = .labelSyntaxError + case 9: self = .targetCannotBeEmptyString + case 10: self = .packagePartCannotEndInSlash + case 11: self = .cycle + case 12: self = .cannotPreloadTarget + case 13: self = .targetsMissing + case 14: self = .recursiveTargetPatternsNotAllowed + case 15: self = .upLevelReferencesNotAllowed + case 16: self = .negativeTargetPatternNotAllowed + case 17: self = .targetMustBeAFile + case 18: self = .dependencyNotFound + case 19: self = .packageNameInvalid + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .targetPatternsUnknown: return 0 + case .targetPatternFileWithCommandLinePattern: return 1 + case .targetPatternFileReadFailure: return 2 + case .targetPatternParseFailure: return 3 + case .packageNotFound: return 4 + case .targetFormatInvalid: return 5 + case .absoluteTargetPatternInvalid: return 6 + case .cannotDetermineTargetFromFilename: return 7 + case .labelSyntaxError: return 8 + case .targetCannotBeEmptyString: return 9 + case .packagePartCannotEndInSlash: return 10 + case .cycle: return 11 + case .cannotPreloadTarget: return 12 + case .targetsMissing: return 13 + case .recursiveTargetPatternsNotAllowed: return 14 + case .upLevelReferencesNotAllowed: return 15 + case .negativeTargetPatternNotAllowed: return 16 + case .targetMustBeAFile: return 17 + case .dependencyNotFound: return 18 + case .packageNameInvalid: return 19 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_TargetPatterns.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_TargetPatterns.Code] = [ + .targetPatternsUnknown, + .targetPatternFileWithCommandLinePattern, + .targetPatternFileReadFailure, + .targetPatternParseFailure, + .packageNotFound, + .targetFormatInvalid, + .absoluteTargetPatternInvalid, + .cannotDetermineTargetFromFilename, + .labelSyntaxError, + .targetCannotBeEmptyString, + .packagePartCannotEndInSlash, + .cycle, + .cannotPreloadTarget, + .targetsMissing, + .recursiveTargetPatternsNotAllowed, + .upLevelReferencesNotAllowed, + .negativeTargetPatternNotAllowed, + .targetMustBeAFile, + .dependencyNotFound, + .packageNameInvalid, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_CleanCommand { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_CleanCommand.Code = .cleanCommandUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case cleanCommandUnknown // = 0 + case outputServiceCleanFailure // = 1 + case actionCacheCleanFailure // = 2 + case outErrCloseFailure // = 3 + case outputBaseDeleteFailure // = 4 + case outputBaseTempMoveFailure // = 5 + case asyncOutputBaseDeleteFailure // = 6 + case execrootDeleteFailure // = 7 + case execrootTempMoveFailure // = 8 + case asyncExecrootDeleteFailure // = 9 + case argumentsNotRecognized // = 10 + case UNRECOGNIZED(Int) + + public init() { + self = .cleanCommandUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .cleanCommandUnknown + case 1: self = .outputServiceCleanFailure + case 2: self = .actionCacheCleanFailure + case 3: self = .outErrCloseFailure + case 4: self = .outputBaseDeleteFailure + case 5: self = .outputBaseTempMoveFailure + case 6: self = .asyncOutputBaseDeleteFailure + case 7: self = .execrootDeleteFailure + case 8: self = .execrootTempMoveFailure + case 9: self = .asyncExecrootDeleteFailure + case 10: self = .argumentsNotRecognized + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .cleanCommandUnknown: return 0 + case .outputServiceCleanFailure: return 1 + case .actionCacheCleanFailure: return 2 + case .outErrCloseFailure: return 3 + case .outputBaseDeleteFailure: return 4 + case .outputBaseTempMoveFailure: return 5 + case .asyncOutputBaseDeleteFailure: return 6 + case .execrootDeleteFailure: return 7 + case .execrootTempMoveFailure: return 8 + case .asyncExecrootDeleteFailure: return 9 + case .argumentsNotRecognized: return 10 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_CleanCommand.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_CleanCommand.Code] = [ + .cleanCommandUnknown, + .outputServiceCleanFailure, + .actionCacheCleanFailure, + .outErrCloseFailure, + .outputBaseDeleteFailure, + .outputBaseTempMoveFailure, + .asyncOutputBaseDeleteFailure, + .execrootDeleteFailure, + .execrootTempMoveFailure, + .asyncExecrootDeleteFailure, + .argumentsNotRecognized, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_ConfigCommand { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_ConfigCommand.Code = .configCommandUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case configCommandUnknown // = 0 + case tooManyConfigIds // = 1 + case configurationNotFound // = 2 + case UNRECOGNIZED(Int) + + public init() { + self = .configCommandUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .configCommandUnknown + case 1: self = .tooManyConfigIds + case 2: self = .configurationNotFound + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .configCommandUnknown: return 0 + case .tooManyConfigIds: return 1 + case .configurationNotFound: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_ConfigCommand.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_ConfigCommand.Code] = [ + .configCommandUnknown, + .tooManyConfigIds, + .configurationNotFound, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_ConfigurableQuery { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_ConfigurableQuery.Code = .configurableQueryUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case configurableQueryUnknown // = 0 + case commandLineExpressionMissing // = 1 + case expressionParseFailure // = 2 + case filtersNotSupported // = 3 + case buildfilesFunctionNotSupported // = 4 + case siblingsFunctionNotSupported // = 5 + case visibleFunctionNotSupported // = 6 + case attributeMissing // = 7 + case incorrectConfigArgumentError // = 8 + case targetMissing // = 9 + case starlarkSyntaxError // = 10 + case starlarkEvalError // = 11 + + /// Indicates failure to correctly define a format function + case formatFunctionError // = 12 + case UNRECOGNIZED(Int) + + public init() { + self = .configurableQueryUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .configurableQueryUnknown + case 1: self = .commandLineExpressionMissing + case 2: self = .expressionParseFailure + case 3: self = .filtersNotSupported + case 4: self = .buildfilesFunctionNotSupported + case 5: self = .siblingsFunctionNotSupported + case 6: self = .visibleFunctionNotSupported + case 7: self = .attributeMissing + case 8: self = .incorrectConfigArgumentError + case 9: self = .targetMissing + case 10: self = .starlarkSyntaxError + case 11: self = .starlarkEvalError + case 12: self = .formatFunctionError + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .configurableQueryUnknown: return 0 + case .commandLineExpressionMissing: return 1 + case .expressionParseFailure: return 2 + case .filtersNotSupported: return 3 + case .buildfilesFunctionNotSupported: return 4 + case .siblingsFunctionNotSupported: return 5 + case .visibleFunctionNotSupported: return 6 + case .attributeMissing: return 7 + case .incorrectConfigArgumentError: return 8 + case .targetMissing: return 9 + case .starlarkSyntaxError: return 10 + case .starlarkEvalError: return 11 + case .formatFunctionError: return 12 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_ConfigurableQuery.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_ConfigurableQuery.Code] = [ + .configurableQueryUnknown, + .commandLineExpressionMissing, + .expressionParseFailure, + .filtersNotSupported, + .buildfilesFunctionNotSupported, + .siblingsFunctionNotSupported, + .visibleFunctionNotSupported, + .attributeMissing, + .incorrectConfigArgumentError, + .targetMissing, + .starlarkSyntaxError, + .starlarkEvalError, + .formatFunctionError, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_DumpCommand { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_DumpCommand.Code = .dumpCommandUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case dumpCommandUnknown // = 0 + case noOutputSpecified // = 1 + case actionCacheDumpFailed // = 2 + case commandLineExpansionFailure // = 3 + case actionGraphDumpFailed // = 4 + case starlarkHeapDumpFailed // = 5 + case UNRECOGNIZED(Int) + + public init() { + self = .dumpCommandUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .dumpCommandUnknown + case 1: self = .noOutputSpecified + case 2: self = .actionCacheDumpFailed + case 3: self = .commandLineExpansionFailure + case 4: self = .actionGraphDumpFailed + case 5: self = .starlarkHeapDumpFailed + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .dumpCommandUnknown: return 0 + case .noOutputSpecified: return 1 + case .actionCacheDumpFailed: return 2 + case .commandLineExpansionFailure: return 3 + case .actionGraphDumpFailed: return 4 + case .starlarkHeapDumpFailed: return 5 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_DumpCommand.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_DumpCommand.Code] = [ + .dumpCommandUnknown, + .noOutputSpecified, + .actionCacheDumpFailed, + .commandLineExpansionFailure, + .actionGraphDumpFailed, + .starlarkHeapDumpFailed, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_HelpCommand { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_HelpCommand.Code = .helpCommandUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case helpCommandUnknown // = 0 + case missingArgument // = 1 + case commandNotFound // = 2 + case UNRECOGNIZED(Int) + + public init() { + self = .helpCommandUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .helpCommandUnknown + case 1: self = .missingArgument + case 2: self = .commandNotFound + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .helpCommandUnknown: return 0 + case .missingArgument: return 1 + case .commandNotFound: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_HelpCommand.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_HelpCommand.Code] = [ + .helpCommandUnknown, + .missingArgument, + .commandNotFound, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_MobileInstall { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_MobileInstall.Code = .mobileInstallUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case mobileInstallUnknown // = 0 + case classicUnsupported // = 1 + case noTargetSpecified // = 2 + case multipleTargetsSpecified // = 3 + case targetTypeInvalid // = 4 + case nonZeroExit // = 5 + case errorRunningProgram // = 6 + case UNRECOGNIZED(Int) + + public init() { + self = .mobileInstallUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .mobileInstallUnknown + case 1: self = .classicUnsupported + case 2: self = .noTargetSpecified + case 3: self = .multipleTargetsSpecified + case 4: self = .targetTypeInvalid + case 5: self = .nonZeroExit + case 6: self = .errorRunningProgram + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .mobileInstallUnknown: return 0 + case .classicUnsupported: return 1 + case .noTargetSpecified: return 2 + case .multipleTargetsSpecified: return 3 + case .targetTypeInvalid: return 4 + case .nonZeroExit: return 5 + case .errorRunningProgram: return 6 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_MobileInstall.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_MobileInstall.Code] = [ + .mobileInstallUnknown, + .classicUnsupported, + .noTargetSpecified, + .multipleTargetsSpecified, + .targetTypeInvalid, + .nonZeroExit, + .errorRunningProgram, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_ProfileCommand { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_ProfileCommand.Code = .profileCommandUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case profileCommandUnknown // = 0 + case oldBinaryFormatUnsupported // = 1 + case fileReadFailure // = 2 + case UNRECOGNIZED(Int) + + public init() { + self = .profileCommandUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .profileCommandUnknown + case 1: self = .oldBinaryFormatUnsupported + case 2: self = .fileReadFailure + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .profileCommandUnknown: return 0 + case .oldBinaryFormatUnsupported: return 1 + case .fileReadFailure: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_ProfileCommand.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_ProfileCommand.Code] = [ + .profileCommandUnknown, + .oldBinaryFormatUnsupported, + .fileReadFailure, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_RunCommand { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_RunCommand.Code = .runCommandUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case runCommandUnknown // = 0 + case noTargetSpecified // = 1 + case tooManyTargetsSpecified // = 2 + case targetNotExecutable // = 3 + case targetBuiltButPathNotExecutable // = 4 + case targetBuiltButPathValidationFailed // = 5 + case runUnderTargetNotBuilt // = 6 + case runPrereqUnmet // = 7 + case tooManyTestShardsOrRuns // = 8 + case testEnvironmentSetupFailure // = 9 + case commandLineExpansionFailure // = 10 + case noShellSpecified // = 11 + case scriptWriteFailure // = 12 + case runfilesDirectoriesCreationFailure // = 13 + case runfilesSymlinksCreationFailure // = 14 + case testEnvironmentSetupInterrupted // = 15 + case UNRECOGNIZED(Int) + + public init() { + self = .runCommandUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .runCommandUnknown + case 1: self = .noTargetSpecified + case 2: self = .tooManyTargetsSpecified + case 3: self = .targetNotExecutable + case 4: self = .targetBuiltButPathNotExecutable + case 5: self = .targetBuiltButPathValidationFailed + case 6: self = .runUnderTargetNotBuilt + case 7: self = .runPrereqUnmet + case 8: self = .tooManyTestShardsOrRuns + case 9: self = .testEnvironmentSetupFailure + case 10: self = .commandLineExpansionFailure + case 11: self = .noShellSpecified + case 12: self = .scriptWriteFailure + case 13: self = .runfilesDirectoriesCreationFailure + case 14: self = .runfilesSymlinksCreationFailure + case 15: self = .testEnvironmentSetupInterrupted + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .runCommandUnknown: return 0 + case .noTargetSpecified: return 1 + case .tooManyTargetsSpecified: return 2 + case .targetNotExecutable: return 3 + case .targetBuiltButPathNotExecutable: return 4 + case .targetBuiltButPathValidationFailed: return 5 + case .runUnderTargetNotBuilt: return 6 + case .runPrereqUnmet: return 7 + case .tooManyTestShardsOrRuns: return 8 + case .testEnvironmentSetupFailure: return 9 + case .commandLineExpansionFailure: return 10 + case .noShellSpecified: return 11 + case .scriptWriteFailure: return 12 + case .runfilesDirectoriesCreationFailure: return 13 + case .runfilesSymlinksCreationFailure: return 14 + case .testEnvironmentSetupInterrupted: return 15 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_RunCommand.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_RunCommand.Code] = [ + .runCommandUnknown, + .noTargetSpecified, + .tooManyTargetsSpecified, + .targetNotExecutable, + .targetBuiltButPathNotExecutable, + .targetBuiltButPathValidationFailed, + .runUnderTargetNotBuilt, + .runPrereqUnmet, + .tooManyTestShardsOrRuns, + .testEnvironmentSetupFailure, + .commandLineExpansionFailure, + .noShellSpecified, + .scriptWriteFailure, + .runfilesDirectoriesCreationFailure, + .runfilesSymlinksCreationFailure, + .testEnvironmentSetupInterrupted, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_VersionCommand { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_VersionCommand.Code = .versionCommandUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case versionCommandUnknown // = 0 + case notAvailable // = 1 + case UNRECOGNIZED(Int) + + public init() { + self = .versionCommandUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .versionCommandUnknown + case 1: self = .notAvailable + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .versionCommandUnknown: return 0 + case .notAvailable: return 1 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_VersionCommand.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_VersionCommand.Code] = [ + .versionCommandUnknown, + .notAvailable, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_PrintActionCommand { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_PrintActionCommand.Code = .printActionCommandUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case printActionCommandUnknown // = 0 + case targetNotFound // = 1 + case commandLineExpansionFailure // = 2 + case targetKindUnsupported // = 3 + case actionsNotFound // = 4 + case UNRECOGNIZED(Int) + + public init() { + self = .printActionCommandUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .printActionCommandUnknown + case 1: self = .targetNotFound + case 2: self = .commandLineExpansionFailure + case 3: self = .targetKindUnsupported + case 4: self = .actionsNotFound + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .printActionCommandUnknown: return 0 + case .targetNotFound: return 1 + case .commandLineExpansionFailure: return 2 + case .targetKindUnsupported: return 3 + case .actionsNotFound: return 4 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_PrintActionCommand.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_PrintActionCommand.Code] = [ + .printActionCommandUnknown, + .targetNotFound, + .commandLineExpansionFailure, + .targetKindUnsupported, + .actionsNotFound, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_WorkspaceStatus { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_WorkspaceStatus.Code = .workspaceStatusUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case workspaceStatusUnknown // = 0 + case nonZeroExit // = 1 + case abnormalTermination // = 2 + case execFailed // = 3 + case parseFailure // = 4 + case validationFailure // = 5 + case contentUpdateIoException // = 6 + case stderrIoException // = 7 + case UNRECOGNIZED(Int) + + public init() { + self = .workspaceStatusUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .workspaceStatusUnknown + case 1: self = .nonZeroExit + case 2: self = .abnormalTermination + case 3: self = .execFailed + case 4: self = .parseFailure + case 5: self = .validationFailure + case 6: self = .contentUpdateIoException + case 7: self = .stderrIoException + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .workspaceStatusUnknown: return 0 + case .nonZeroExit: return 1 + case .abnormalTermination: return 2 + case .execFailed: return 3 + case .parseFailure: return 4 + case .validationFailure: return 5 + case .contentUpdateIoException: return 6 + case .stderrIoException: return 7 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_WorkspaceStatus.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_WorkspaceStatus.Code] = [ + .workspaceStatusUnknown, + .nonZeroExit, + .abnormalTermination, + .execFailed, + .parseFailure, + .validationFailure, + .contentUpdateIoException, + .stderrIoException, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_JavaCompile { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_JavaCompile.Code = .javaCompileUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case javaCompileUnknown // = 0 + case reducedClasspathFailure // = 1 + case commandLineExpansionFailure // = 2 + case jdepsReadIoException // = 3 + case reducedClasspathFallbackCleanupFailure // = 4 + case UNRECOGNIZED(Int) + + public init() { + self = .javaCompileUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .javaCompileUnknown + case 1: self = .reducedClasspathFailure + case 2: self = .commandLineExpansionFailure + case 3: self = .jdepsReadIoException + case 4: self = .reducedClasspathFallbackCleanupFailure + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .javaCompileUnknown: return 0 + case .reducedClasspathFailure: return 1 + case .commandLineExpansionFailure: return 2 + case .jdepsReadIoException: return 3 + case .reducedClasspathFallbackCleanupFailure: return 4 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_JavaCompile.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_JavaCompile.Code] = [ + .javaCompileUnknown, + .reducedClasspathFailure, + .commandLineExpansionFailure, + .jdepsReadIoException, + .reducedClasspathFallbackCleanupFailure, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_ActionRewinding { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_ActionRewinding.Code = .actionRewindingUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case actionRewindingUnknown // = 0 + case lostInputTooManyTimes // = 1 + case lostInputIsSource // = 2 + case UNRECOGNIZED(Int) + + public init() { + self = .actionRewindingUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .actionRewindingUnknown + case 1: self = .lostInputTooManyTimes + case 2: self = .lostInputIsSource + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .actionRewindingUnknown: return 0 + case .lostInputTooManyTimes: return 1 + case .lostInputIsSource: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_ActionRewinding.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_ActionRewinding.Code] = [ + .actionRewindingUnknown, + .lostInputTooManyTimes, + .lostInputIsSource, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_CppCompile { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_CppCompile.Code = .cppCompileUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case cppCompileUnknown // = 0 + case findUsedHeadersIoException // = 1 + case copyOutErrFailure // = 2 + case dFileReadFailure // = 3 + case commandGenerationFailure // = 4 + case moduleExpansionTimeout // = 5 + case includePathOutsideExecRoot // = 6 + case fakeCommandGenerationFailure // = 7 + case undeclaredInclusions // = 8 + case dFileParseFailure // = 9 + case coverageNotesCreationFailure // = 10 + case moduleExpansionMissingData // = 11 + case UNRECOGNIZED(Int) + + public init() { + self = .cppCompileUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .cppCompileUnknown + case 1: self = .findUsedHeadersIoException + case 2: self = .copyOutErrFailure + case 3: self = .dFileReadFailure + case 4: self = .commandGenerationFailure + case 5: self = .moduleExpansionTimeout + case 6: self = .includePathOutsideExecRoot + case 7: self = .fakeCommandGenerationFailure + case 8: self = .undeclaredInclusions + case 9: self = .dFileParseFailure + case 10: self = .coverageNotesCreationFailure + case 11: self = .moduleExpansionMissingData + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .cppCompileUnknown: return 0 + case .findUsedHeadersIoException: return 1 + case .copyOutErrFailure: return 2 + case .dFileReadFailure: return 3 + case .commandGenerationFailure: return 4 + case .moduleExpansionTimeout: return 5 + case .includePathOutsideExecRoot: return 6 + case .fakeCommandGenerationFailure: return 7 + case .undeclaredInclusions: return 8 + case .dFileParseFailure: return 9 + case .coverageNotesCreationFailure: return 10 + case .moduleExpansionMissingData: return 11 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_CppCompile.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_CppCompile.Code] = [ + .cppCompileUnknown, + .findUsedHeadersIoException, + .copyOutErrFailure, + .dFileReadFailure, + .commandGenerationFailure, + .moduleExpansionTimeout, + .includePathOutsideExecRoot, + .fakeCommandGenerationFailure, + .undeclaredInclusions, + .dFileParseFailure, + .coverageNotesCreationFailure, + .moduleExpansionMissingData, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_StarlarkAction { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_StarlarkAction.Code = .starlarkActionUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case starlarkActionUnknown // = 0 + case unusedInputListReadFailure // = 1 + case unusedInputListFileNotFound // = 2 + case UNRECOGNIZED(Int) + + public init() { + self = .starlarkActionUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .starlarkActionUnknown + case 1: self = .unusedInputListReadFailure + case 2: self = .unusedInputListFileNotFound + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .starlarkActionUnknown: return 0 + case .unusedInputListReadFailure: return 1 + case .unusedInputListFileNotFound: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_StarlarkAction.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_StarlarkAction.Code] = [ + .starlarkActionUnknown, + .unusedInputListReadFailure, + .unusedInputListFileNotFound, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_NinjaAction { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_NinjaAction.Code = .ninjaActionUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case ninjaActionUnknown // = 0 + case invalidDepfileDeclaredDependency // = 1 + case dFileParseFailure // = 2 + case UNRECOGNIZED(Int) + + public init() { + self = .ninjaActionUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .ninjaActionUnknown + case 1: self = .invalidDepfileDeclaredDependency + case 2: self = .dFileParseFailure + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .ninjaActionUnknown: return 0 + case .invalidDepfileDeclaredDependency: return 1 + case .dFileParseFailure: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_NinjaAction.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_NinjaAction.Code] = [ + .ninjaActionUnknown, + .invalidDepfileDeclaredDependency, + .dFileParseFailure, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_DynamicExecution { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_DynamicExecution.Code = .dynamicExecutionUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case dynamicExecutionUnknown // = 0 + case xcodeRelatedPrereqUnmet // = 1 + case actionLogMoveFailure // = 2 + case runFailure // = 3 + case noUsableStrategyFound // = 4 + case UNRECOGNIZED(Int) + + public init() { + self = .dynamicExecutionUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .dynamicExecutionUnknown + case 1: self = .xcodeRelatedPrereqUnmet + case 2: self = .actionLogMoveFailure + case 3: self = .runFailure + case 4: self = .noUsableStrategyFound + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .dynamicExecutionUnknown: return 0 + case .xcodeRelatedPrereqUnmet: return 1 + case .actionLogMoveFailure: return 2 + case .runFailure: return 3 + case .noUsableStrategyFound: return 4 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_DynamicExecution.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_DynamicExecution.Code] = [ + .dynamicExecutionUnknown, + .xcodeRelatedPrereqUnmet, + .actionLogMoveFailure, + .runFailure, + .noUsableStrategyFound, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_FailAction { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_FailAction.Code = .failActionUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case failActionUnknown // = 0 + case intentionalFailure // = 1 + case incorrectPythonVersion // = 2 + case proguardSpecsMissing // = 3 + case dynamicLinkingNotSupported // = 4 + case sourceFilesMissing // = 5 + case incorrectToolchain // = 6 + case fragmentClassMissing // = 7 + case cantBuildIncompatibleTarget // = 10 + case UNRECOGNIZED(Int) + + public init() { + self = .failActionUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .failActionUnknown + case 1: self = .intentionalFailure + case 2: self = .incorrectPythonVersion + case 3: self = .proguardSpecsMissing + case 4: self = .dynamicLinkingNotSupported + case 5: self = .sourceFilesMissing + case 6: self = .incorrectToolchain + case 7: self = .fragmentClassMissing + case 10: self = .cantBuildIncompatibleTarget + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .failActionUnknown: return 0 + case .intentionalFailure: return 1 + case .incorrectPythonVersion: return 2 + case .proguardSpecsMissing: return 3 + case .dynamicLinkingNotSupported: return 4 + case .sourceFilesMissing: return 5 + case .incorrectToolchain: return 6 + case .fragmentClassMissing: return 7 + case .cantBuildIncompatibleTarget: return 10 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_FailAction.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_FailAction.Code] = [ + .failActionUnknown, + .intentionalFailure, + .incorrectPythonVersion, + .proguardSpecsMissing, + .dynamicLinkingNotSupported, + .sourceFilesMissing, + .incorrectToolchain, + .fragmentClassMissing, + .cantBuildIncompatibleTarget, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_SymlinkAction { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_SymlinkAction.Code = .symlinkActionUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case symlinkActionUnknown // = 0 + case executableInputNotFile // = 1 + case executableInputIsNot // = 2 + case executableInputCheckIoException // = 3 + case linkCreationIoException // = 4 + case linkTouchIoException // = 5 + case UNRECOGNIZED(Int) + + public init() { + self = .symlinkActionUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .symlinkActionUnknown + case 1: self = .executableInputNotFile + case 2: self = .executableInputIsNot + case 3: self = .executableInputCheckIoException + case 4: self = .linkCreationIoException + case 5: self = .linkTouchIoException + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .symlinkActionUnknown: return 0 + case .executableInputNotFile: return 1 + case .executableInputIsNot: return 2 + case .executableInputCheckIoException: return 3 + case .linkCreationIoException: return 4 + case .linkTouchIoException: return 5 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_SymlinkAction.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_SymlinkAction.Code] = [ + .symlinkActionUnknown, + .executableInputNotFile, + .executableInputIsNot, + .executableInputCheckIoException, + .linkCreationIoException, + .linkTouchIoException, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_CppLink { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_CppLink.Code = .cppLinkUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case cppLinkUnknown // = 0 + case commandGenerationFailure // = 1 + case fakeCommandGenerationFailure // = 2 + case UNRECOGNIZED(Int) + + public init() { + self = .cppLinkUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .cppLinkUnknown + case 1: self = .commandGenerationFailure + case 2: self = .fakeCommandGenerationFailure + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .cppLinkUnknown: return 0 + case .commandGenerationFailure: return 1 + case .fakeCommandGenerationFailure: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_CppLink.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_CppLink.Code] = [ + .cppLinkUnknown, + .commandGenerationFailure, + .fakeCommandGenerationFailure, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_LtoAction { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_LtoAction.Code = .ltoActionUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case ltoActionUnknown // = 0 + case invalidAbsolutePathInImports // = 1 + case missingBitcodeFiles // = 2 + case importsReadIoException // = 3 + case UNRECOGNIZED(Int) + + public init() { + self = .ltoActionUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .ltoActionUnknown + case 1: self = .invalidAbsolutePathInImports + case 2: self = .missingBitcodeFiles + case 3: self = .importsReadIoException + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .ltoActionUnknown: return 0 + case .invalidAbsolutePathInImports: return 1 + case .missingBitcodeFiles: return 2 + case .importsReadIoException: return 3 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_LtoAction.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_LtoAction.Code] = [ + .ltoActionUnknown, + .invalidAbsolutePathInImports, + .missingBitcodeFiles, + .importsReadIoException, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_TestAction { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_TestAction.Code = .testActionUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case testActionUnknown // = 0 + case noKeepGoingTestFailure // = 1 + case localTestPrereqUnmet // = 2 + case commandLineExpansionFailure // = 3 + case duplicateCpuTags // = 4 + case invalidCpuTag // = 5 + case UNRECOGNIZED(Int) + + public init() { + self = .testActionUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .testActionUnknown + case 1: self = .noKeepGoingTestFailure + case 2: self = .localTestPrereqUnmet + case 3: self = .commandLineExpansionFailure + case 4: self = .duplicateCpuTags + case 5: self = .invalidCpuTag + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .testActionUnknown: return 0 + case .noKeepGoingTestFailure: return 1 + case .localTestPrereqUnmet: return 2 + case .commandLineExpansionFailure: return 3 + case .duplicateCpuTags: return 4 + case .invalidCpuTag: return 5 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_TestAction.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_TestAction.Code] = [ + .testActionUnknown, + .noKeepGoingTestFailure, + .localTestPrereqUnmet, + .commandLineExpansionFailure, + .duplicateCpuTags, + .invalidCpuTag, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_Worker { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_Worker.Code = .workerUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case workerUnknown // = 0 + case multiplexerInstanceRemovalFailure // = 1 + case multiplexerDoesNotExist // = 2 + case noTools // = 3 + case noFlagfile // = 4 + case virtualInputMaterializationFailure // = 5 + case borrowFailure // = 6 + case prefetchFailure // = 7 + case prepareFailure // = 8 + case requestFailure // = 9 + case parseResponseFailure // = 10 + case noResponse // = 11 + case finishFailure // = 12 + case UNRECOGNIZED(Int) + + public init() { + self = .workerUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .workerUnknown + case 1: self = .multiplexerInstanceRemovalFailure + case 2: self = .multiplexerDoesNotExist + case 3: self = .noTools + case 4: self = .noFlagfile + case 5: self = .virtualInputMaterializationFailure + case 6: self = .borrowFailure + case 7: self = .prefetchFailure + case 8: self = .prepareFailure + case 9: self = .requestFailure + case 10: self = .parseResponseFailure + case 11: self = .noResponse + case 12: self = .finishFailure + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .workerUnknown: return 0 + case .multiplexerInstanceRemovalFailure: return 1 + case .multiplexerDoesNotExist: return 2 + case .noTools: return 3 + case .noFlagfile: return 4 + case .virtualInputMaterializationFailure: return 5 + case .borrowFailure: return 6 + case .prefetchFailure: return 7 + case .prepareFailure: return 8 + case .requestFailure: return 9 + case .parseResponseFailure: return 10 + case .noResponse: return 11 + case .finishFailure: return 12 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_Worker.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_Worker.Code] = [ + .workerUnknown, + .multiplexerInstanceRemovalFailure, + .multiplexerDoesNotExist, + .noTools, + .noFlagfile, + .virtualInputMaterializationFailure, + .borrowFailure, + .prefetchFailure, + .prepareFailure, + .requestFailure, + .parseResponseFailure, + .noResponse, + .finishFailure, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_Analysis { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_Analysis.Code = .analysisUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case analysisUnknown // = 0 + case loadFailure // = 1 + + /// TODO(b/138456686): this code should be deprecated in favor of more finely + /// resolved loading-phase codes. + case genericLoadingPhaseFailure // = 2 + case notAllTargetsAnalyzed // = 3 + case cycle // = 4 + case parameterizedTopLevelAspectInvalid // = 5 + case aspectLabelSyntaxError // = 6 + case aspectPrereqUnmet // = 7 + case aspectNotFound // = 8 + case actionConflict // = 9 + case artifactPrefixConflict // = 10 + case unexpectedAnalysisException // = 11 + case targetsMissingEnvironments // = 12 + case invalidEnvironment // = 13 + case environmentMissingFromGroups // = 14 + case execGroupMissing // = 15 + case invalidExecutionPlatform // = 16 + case aspectCreationFailed // = 17 + case configuredValueCreationFailed // = 18 + case incompatibleTargetRequested // = 19 + case UNRECOGNIZED(Int) + + public init() { + self = .analysisUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .analysisUnknown + case 1: self = .loadFailure + case 2: self = .genericLoadingPhaseFailure + case 3: self = .notAllTargetsAnalyzed + case 4: self = .cycle + case 5: self = .parameterizedTopLevelAspectInvalid + case 6: self = .aspectLabelSyntaxError + case 7: self = .aspectPrereqUnmet + case 8: self = .aspectNotFound + case 9: self = .actionConflict + case 10: self = .artifactPrefixConflict + case 11: self = .unexpectedAnalysisException + case 12: self = .targetsMissingEnvironments + case 13: self = .invalidEnvironment + case 14: self = .environmentMissingFromGroups + case 15: self = .execGroupMissing + case 16: self = .invalidExecutionPlatform + case 17: self = .aspectCreationFailed + case 18: self = .configuredValueCreationFailed + case 19: self = .incompatibleTargetRequested + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .analysisUnknown: return 0 + case .loadFailure: return 1 + case .genericLoadingPhaseFailure: return 2 + case .notAllTargetsAnalyzed: return 3 + case .cycle: return 4 + case .parameterizedTopLevelAspectInvalid: return 5 + case .aspectLabelSyntaxError: return 6 + case .aspectPrereqUnmet: return 7 + case .aspectNotFound: return 8 + case .actionConflict: return 9 + case .artifactPrefixConflict: return 10 + case .unexpectedAnalysisException: return 11 + case .targetsMissingEnvironments: return 12 + case .invalidEnvironment: return 13 + case .environmentMissingFromGroups: return 14 + case .execGroupMissing: return 15 + case .invalidExecutionPlatform: return 16 + case .aspectCreationFailed: return 17 + case .configuredValueCreationFailed: return 18 + case .incompatibleTargetRequested: return 19 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_Analysis.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_Analysis.Code] = [ + .analysisUnknown, + .loadFailure, + .genericLoadingPhaseFailure, + .notAllTargetsAnalyzed, + .cycle, + .parameterizedTopLevelAspectInvalid, + .aspectLabelSyntaxError, + .aspectPrereqUnmet, + .aspectNotFound, + .actionConflict, + .artifactPrefixConflict, + .unexpectedAnalysisException, + .targetsMissingEnvironments, + .invalidEnvironment, + .environmentMissingFromGroups, + .execGroupMissing, + .invalidExecutionPlatform, + .aspectCreationFailed, + .configuredValueCreationFailed, + .incompatibleTargetRequested, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_PackageLoading { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_PackageLoading.Code = .packageLoadingUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case packageLoadingUnknown // = 0 + case workspaceFileError // = 1 + case maxComputationStepsExceeded // = 2 + case buildFileMissing // = 3 + case repositoryMissing // = 4 + case persistentInconsistentFilesystemError // = 5 + case transientInconsistentFilesystemError // = 6 + case invalidName // = 7 + case evalGlobsSymlinkError // = 9 + case importStarlarkFileError // = 10 + case packageMissing // = 11 + case targetMissing // = 12 + case noSuchThing // = 13 + case globIoException // = 14 + case duplicateLabel // = 15 + case invalidPackageSpecification // = 16 + case syntaxError // = 17 + case environmentInDifferentPackage // = 18 + case defaultEnvironmentUndeclared // = 19 + case environmentInMultipleGroups // = 20 + case environmentDoesNotExist // = 21 + case environmentInvalid // = 22 + case environmentNotInGroup // = 23 + case packageNameInvalid // = 24 + case starlarkEvalError // = 25 + case licenseParseFailure // = 26 + case distributionsParseFailure // = 27 + case labelCrossesPackageBoundary // = 28 + case UNRECOGNIZED(Int) + + public init() { + self = .packageLoadingUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .packageLoadingUnknown + case 1: self = .workspaceFileError + case 2: self = .maxComputationStepsExceeded + case 3: self = .buildFileMissing + case 4: self = .repositoryMissing + case 5: self = .persistentInconsistentFilesystemError + case 6: self = .transientInconsistentFilesystemError + case 7: self = .invalidName + case 9: self = .evalGlobsSymlinkError + case 10: self = .importStarlarkFileError + case 11: self = .packageMissing + case 12: self = .targetMissing + case 13: self = .noSuchThing + case 14: self = .globIoException + case 15: self = .duplicateLabel + case 16: self = .invalidPackageSpecification + case 17: self = .syntaxError + case 18: self = .environmentInDifferentPackage + case 19: self = .defaultEnvironmentUndeclared + case 20: self = .environmentInMultipleGroups + case 21: self = .environmentDoesNotExist + case 22: self = .environmentInvalid + case 23: self = .environmentNotInGroup + case 24: self = .packageNameInvalid + case 25: self = .starlarkEvalError + case 26: self = .licenseParseFailure + case 27: self = .distributionsParseFailure + case 28: self = .labelCrossesPackageBoundary + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .packageLoadingUnknown: return 0 + case .workspaceFileError: return 1 + case .maxComputationStepsExceeded: return 2 + case .buildFileMissing: return 3 + case .repositoryMissing: return 4 + case .persistentInconsistentFilesystemError: return 5 + case .transientInconsistentFilesystemError: return 6 + case .invalidName: return 7 + case .evalGlobsSymlinkError: return 9 + case .importStarlarkFileError: return 10 + case .packageMissing: return 11 + case .targetMissing: return 12 + case .noSuchThing: return 13 + case .globIoException: return 14 + case .duplicateLabel: return 15 + case .invalidPackageSpecification: return 16 + case .syntaxError: return 17 + case .environmentInDifferentPackage: return 18 + case .defaultEnvironmentUndeclared: return 19 + case .environmentInMultipleGroups: return 20 + case .environmentDoesNotExist: return 21 + case .environmentInvalid: return 22 + case .environmentNotInGroup: return 23 + case .packageNameInvalid: return 24 + case .starlarkEvalError: return 25 + case .licenseParseFailure: return 26 + case .distributionsParseFailure: return 27 + case .labelCrossesPackageBoundary: return 28 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_PackageLoading.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_PackageLoading.Code] = [ + .packageLoadingUnknown, + .workspaceFileError, + .maxComputationStepsExceeded, + .buildFileMissing, + .repositoryMissing, + .persistentInconsistentFilesystemError, + .transientInconsistentFilesystemError, + .invalidName, + .evalGlobsSymlinkError, + .importStarlarkFileError, + .packageMissing, + .targetMissing, + .noSuchThing, + .globIoException, + .duplicateLabel, + .invalidPackageSpecification, + .syntaxError, + .environmentInDifferentPackage, + .defaultEnvironmentUndeclared, + .environmentInMultipleGroups, + .environmentDoesNotExist, + .environmentInvalid, + .environmentNotInGroup, + .packageNameInvalid, + .starlarkEvalError, + .licenseParseFailure, + .distributionsParseFailure, + .labelCrossesPackageBoundary, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_Toolchain { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_Toolchain.Code = .toolchainUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case toolchainUnknown // = 0 + case missingProvider // = 1 + case invalidConstraintValue // = 2 + case invalidPlatformValue // = 3 + case invalidToolchain // = 4 + case noMatchingExecutionPlatform // = 5 + case noMatchingToolchain // = 6 + case invalidToolchainType // = 7 + case UNRECOGNIZED(Int) + + public init() { + self = .toolchainUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .toolchainUnknown + case 1: self = .missingProvider + case 2: self = .invalidConstraintValue + case 3: self = .invalidPlatformValue + case 4: self = .invalidToolchain + case 5: self = .noMatchingExecutionPlatform + case 6: self = .noMatchingToolchain + case 7: self = .invalidToolchainType + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .toolchainUnknown: return 0 + case .missingProvider: return 1 + case .invalidConstraintValue: return 2 + case .invalidPlatformValue: return 3 + case .invalidToolchain: return 4 + case .noMatchingExecutionPlatform: return 5 + case .noMatchingToolchain: return 6 + case .invalidToolchainType: return 7 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_Toolchain.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_Toolchain.Code] = [ + .toolchainUnknown, + .missingProvider, + .invalidConstraintValue, + .invalidPlatformValue, + .invalidToolchain, + .noMatchingExecutionPlatform, + .noMatchingToolchain, + .invalidToolchainType, + ] +} + +#endif // swift(>=4.2) + +public struct FailureDetails_StarlarkLoading { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + public var code: FailureDetails_StarlarkLoading.Code = .starlarkLoadingUnknown + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Code: SwiftProtobuf.Enum { + public typealias RawValue = Int + case starlarkLoadingUnknown // = 0 + case cycle // = 1 + case compileError // = 2 + case parseError // = 3 + case evalError // = 4 + case containingPackageNotFound // = 5 + case packageNotFound // = 6 + case ioError // = 7 + case labelCrossesPackageBoundary // = 8 + case builtinsError // = 9 + case UNRECOGNIZED(Int) + + public init() { + self = .starlarkLoadingUnknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .starlarkLoadingUnknown + case 1: self = .cycle + case 2: self = .compileError + case 3: self = .parseError + case 4: self = .evalError + case 5: self = .containingPackageNotFound + case 6: self = .packageNotFound + case 7: self = .ioError + case 8: self = .labelCrossesPackageBoundary + case 9: self = .builtinsError + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .starlarkLoadingUnknown: return 0 + case .cycle: return 1 + case .compileError: return 2 + case .parseError: return 3 + case .evalError: return 4 + case .containingPackageNotFound: return 5 + case .packageNotFound: return 6 + case .ioError: return 7 + case .labelCrossesPackageBoundary: return 8 + case .builtinsError: return 9 + case .UNRECOGNIZED(let i): return i + } + } + + } + + public init() {} +} + +#if swift(>=4.2) + +extension FailureDetails_StarlarkLoading.Code: CaseIterable { + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static var allCases: [FailureDetails_StarlarkLoading.Code] = [ + .starlarkLoadingUnknown, + .cycle, + .compileError, + .parseError, + .evalError, + .containingPackageNotFound, + .packageNotFound, + .ioError, + .labelCrossesPackageBoundary, + .builtinsError, + ] +} + +#endif // swift(>=4.2) + +// MARK: - Extension support defined in failure_details.proto. + +// MARK: - Extension Properties + +// Swift Extensions on the exteneded Messages to add easy access to the declared +// extension fields. The names are based on the extension field name from the proto +// declaration. To avoid naming collisions, the names are prefixed with the name of +// the scope where the extend directive occurs. + +extension SwiftProtobuf.Google_Protobuf_EnumValueOptions { + + public var FailureDetails_metadata: FailureDetails_FailureDetailMetadata { + get {return getExtensionValue(ext: FailureDetails_Extensions_metadata) ?? FailureDetails_FailureDetailMetadata()} + set {setExtensionValue(ext: FailureDetails_Extensions_metadata, value: newValue)} + } + /// Returns true if extension `FailureDetails_Extensions_metadata` + /// has been explicitly set. + public var hasFailureDetails_metadata: Bool { + return hasExtensionValue(ext: FailureDetails_Extensions_metadata) + } + /// Clears the value of extension `FailureDetails_Extensions_metadata`. + /// Subsequent reads from it will return its default value. + public mutating func clearFailureDetails_metadata() { + clearExtensionValue(ext: FailureDetails_Extensions_metadata) + } + +} + +// MARK: - File's ExtensionMap: FailureDetails_FailureDetails_Extensions + +/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by +/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed +/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create +/// a larger `SwiftProtobuf.SimpleExtensionMap`. +public let FailureDetails_FailureDetails_Extensions: SwiftProtobuf.SimpleExtensionMap = [ + FailureDetails_Extensions_metadata +] + +// Extension Objects - The only reason these might be needed is when manually +// constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_ +// accessors for the extension fields on the messages directly. + +public let FailureDetails_Extensions_metadata = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_EnumValueOptions>( + _protobuf_fieldNumber: 1078, + fieldName: "failure_details.metadata" +) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "failure_details" + +extension FailureDetails_FailureDetailMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".FailureDetailMetadata" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "exit_code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularUInt32Field(value: &self.exitCode) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.exitCode != 0 { + try visitor.visitSingularUInt32Field(value: self.exitCode, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_FailureDetailMetadata, rhs: FailureDetails_FailureDetailMetadata) -> Bool { + if lhs.exitCode != rhs.exitCode {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_FailureDetail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".FailureDetail" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "message"), + 101: .same(proto: "interrupted"), + 103: .standard(proto: "external_repository"), + 104: .standard(proto: "build_progress"), + 106: .standard(proto: "remote_options"), + 107: .standard(proto: "client_environment"), + 108: .same(proto: "crash"), + 110: .standard(proto: "symlink_forest"), + 114: .standard(proto: "package_options"), + 115: .standard(proto: "remote_execution"), + 116: .same(proto: "execution"), + 117: .same(proto: "workspaces"), + 118: .standard(proto: "crash_options"), + 119: .same(proto: "filesystem"), + 121: .standard(proto: "execution_options"), + 122: .same(proto: "command"), + 123: .same(proto: "spawn"), + 124: .standard(proto: "grpc_server"), + 125: .standard(proto: "canonicalize_flags"), + 126: .standard(proto: "build_configuration"), + 127: .standard(proto: "info_command"), + 129: .standard(proto: "memory_options"), + 130: .same(proto: "query"), + 132: .standard(proto: "local_execution"), + 134: .standard(proto: "action_cache"), + 135: .standard(proto: "fetch_command"), + 136: .standard(proto: "sync_command"), + 137: .same(proto: "sandbox"), + 139: .standard(proto: "include_scanning"), + 140: .standard(proto: "test_command"), + 141: .standard(proto: "action_query"), + 142: .standard(proto: "target_patterns"), + 144: .standard(proto: "clean_command"), + 145: .standard(proto: "config_command"), + 146: .standard(proto: "configurable_query"), + 147: .standard(proto: "dump_command"), + 148: .standard(proto: "help_command"), + 150: .standard(proto: "mobile_install"), + 151: .standard(proto: "profile_command"), + 152: .standard(proto: "run_command"), + 153: .standard(proto: "version_command"), + 154: .standard(proto: "print_action_command"), + 158: .standard(proto: "workspace_status"), + 159: .standard(proto: "java_compile"), + 160: .standard(proto: "action_rewinding"), + 161: .standard(proto: "cpp_compile"), + 162: .standard(proto: "starlark_action"), + 163: .standard(proto: "ninja_action"), + 164: .standard(proto: "dynamic_execution"), + 166: .standard(proto: "fail_action"), + 167: .standard(proto: "symlink_action"), + 168: .standard(proto: "cpp_link"), + 169: .standard(proto: "lto_action"), + 172: .standard(proto: "test_action"), + 173: .same(proto: "worker"), + 174: .same(proto: "analysis"), + 175: .standard(proto: "package_loading"), + 177: .same(proto: "toolchain"), + 179: .standard(proto: "starlark_loading"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.message) }() + case 101: try { + var v: FailureDetails_Interrupted? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .interrupted(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .interrupted(v) + } + }() + case 103: try { + var v: FailureDetails_ExternalRepository? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .externalRepository(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .externalRepository(v) + } + }() + case 104: try { + var v: FailureDetails_BuildProgress? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .buildProgress(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .buildProgress(v) + } + }() + case 106: try { + var v: FailureDetails_RemoteOptions? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .remoteOptions(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .remoteOptions(v) + } + }() + case 107: try { + var v: FailureDetails_ClientEnvironment? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .clientEnvironment(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .clientEnvironment(v) + } + }() + case 108: try { + var v: FailureDetails_Crash? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .crash(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .crash(v) + } + }() + case 110: try { + var v: FailureDetails_SymlinkForest? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .symlinkForest(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .symlinkForest(v) + } + }() + case 114: try { + var v: FailureDetails_PackageOptions? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .packageOptions(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .packageOptions(v) + } + }() + case 115: try { + var v: FailureDetails_RemoteExecution? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .remoteExecution(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .remoteExecution(v) + } + }() + case 116: try { + var v: FailureDetails_Execution? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .execution(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .execution(v) + } + }() + case 117: try { + var v: FailureDetails_Workspaces? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .workspaces(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .workspaces(v) + } + }() + case 118: try { + var v: FailureDetails_CrashOptions? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .crashOptions(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .crashOptions(v) + } + }() + case 119: try { + var v: FailureDetails_Filesystem? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .filesystem(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .filesystem(v) + } + }() + case 121: try { + var v: FailureDetails_ExecutionOptions? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .executionOptions(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .executionOptions(v) + } + }() + case 122: try { + var v: FailureDetails_Command? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .command(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .command(v) + } + }() + case 123: try { + var v: FailureDetails_Spawn? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .spawn(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .spawn(v) + } + }() + case 124: try { + var v: FailureDetails_GrpcServer? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .grpcServer(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .grpcServer(v) + } + }() + case 125: try { + var v: FailureDetails_CanonicalizeFlags? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .canonicalizeFlags(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .canonicalizeFlags(v) + } + }() + case 126: try { + var v: FailureDetails_BuildConfiguration? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .buildConfiguration(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .buildConfiguration(v) + } + }() + case 127: try { + var v: FailureDetails_InfoCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .infoCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .infoCommand(v) + } + }() + case 129: try { + var v: FailureDetails_MemoryOptions? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .memoryOptions(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .memoryOptions(v) + } + }() + case 130: try { + var v: FailureDetails_Query? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .query(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .query(v) + } + }() + case 132: try { + var v: FailureDetails_LocalExecution? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .localExecution(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .localExecution(v) + } + }() + case 134: try { + var v: FailureDetails_ActionCache? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .actionCache(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .actionCache(v) + } + }() + case 135: try { + var v: FailureDetails_FetchCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .fetchCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .fetchCommand(v) + } + }() + case 136: try { + var v: FailureDetails_SyncCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .syncCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .syncCommand(v) + } + }() + case 137: try { + var v: FailureDetails_Sandbox? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .sandbox(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .sandbox(v) + } + }() + case 139: try { + var v: FailureDetails_IncludeScanning? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .includeScanning(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .includeScanning(v) + } + }() + case 140: try { + var v: FailureDetails_TestCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .testCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .testCommand(v) + } + }() + case 141: try { + var v: FailureDetails_ActionQuery? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .actionQuery(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .actionQuery(v) + } + }() + case 142: try { + var v: FailureDetails_TargetPatterns? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .targetPatterns(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .targetPatterns(v) + } + }() + case 144: try { + var v: FailureDetails_CleanCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .cleanCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .cleanCommand(v) + } + }() + case 145: try { + var v: FailureDetails_ConfigCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .configCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .configCommand(v) + } + }() + case 146: try { + var v: FailureDetails_ConfigurableQuery? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .configurableQuery(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .configurableQuery(v) + } + }() + case 147: try { + var v: FailureDetails_DumpCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .dumpCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .dumpCommand(v) + } + }() + case 148: try { + var v: FailureDetails_HelpCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .helpCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .helpCommand(v) + } + }() + case 150: try { + var v: FailureDetails_MobileInstall? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .mobileInstall(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .mobileInstall(v) + } + }() + case 151: try { + var v: FailureDetails_ProfileCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .profileCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .profileCommand(v) + } + }() + case 152: try { + var v: FailureDetails_RunCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .runCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .runCommand(v) + } + }() + case 153: try { + var v: FailureDetails_VersionCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .versionCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .versionCommand(v) + } + }() + case 154: try { + var v: FailureDetails_PrintActionCommand? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .printActionCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .printActionCommand(v) + } + }() + case 158: try { + var v: FailureDetails_WorkspaceStatus? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .workspaceStatus(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .workspaceStatus(v) + } + }() + case 159: try { + var v: FailureDetails_JavaCompile? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .javaCompile(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .javaCompile(v) + } + }() + case 160: try { + var v: FailureDetails_ActionRewinding? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .actionRewinding(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .actionRewinding(v) + } + }() + case 161: try { + var v: FailureDetails_CppCompile? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .cppCompile(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .cppCompile(v) + } + }() + case 162: try { + var v: FailureDetails_StarlarkAction? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .starlarkAction(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .starlarkAction(v) + } + }() + case 163: try { + var v: FailureDetails_NinjaAction? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .ninjaAction(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .ninjaAction(v) + } + }() + case 164: try { + var v: FailureDetails_DynamicExecution? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .dynamicExecution(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .dynamicExecution(v) + } + }() + case 166: try { + var v: FailureDetails_FailAction? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .failAction(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .failAction(v) + } + }() + case 167: try { + var v: FailureDetails_SymlinkAction? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .symlinkAction(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .symlinkAction(v) + } + }() + case 168: try { + var v: FailureDetails_CppLink? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .cppLink(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .cppLink(v) + } + }() + case 169: try { + var v: FailureDetails_LtoAction? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .ltoAction(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .ltoAction(v) + } + }() + case 172: try { + var v: FailureDetails_TestAction? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .testAction(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .testAction(v) + } + }() + case 173: try { + var v: FailureDetails_Worker? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .worker(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .worker(v) + } + }() + case 174: try { + var v: FailureDetails_Analysis? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .analysis(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .analysis(v) + } + }() + case 175: try { + var v: FailureDetails_PackageLoading? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .packageLoading(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .packageLoading(v) + } + }() + case 177: try { + var v: FailureDetails_Toolchain? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .toolchain(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .toolchain(v) + } + }() + case 179: try { + var v: FailureDetails_StarlarkLoading? + var hadOneofValue = false + if let current = self.category { + hadOneofValue = true + if case .starlarkLoading(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.category = .starlarkLoading(v) + } + }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.message.isEmpty { + try visitor.visitSingularStringField(value: self.message, fieldNumber: 1) + } + switch self.category { + case .interrupted?: try { + guard case .interrupted(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 101) + }() + case .externalRepository?: try { + guard case .externalRepository(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 103) + }() + case .buildProgress?: try { + guard case .buildProgress(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 104) + }() + case .remoteOptions?: try { + guard case .remoteOptions(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 106) + }() + case .clientEnvironment?: try { + guard case .clientEnvironment(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 107) + }() + case .crash?: try { + guard case .crash(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 108) + }() + case .symlinkForest?: try { + guard case .symlinkForest(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 110) + }() + case .packageOptions?: try { + guard case .packageOptions(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 114) + }() + case .remoteExecution?: try { + guard case .remoteExecution(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 115) + }() + case .execution?: try { + guard case .execution(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 116) + }() + case .workspaces?: try { + guard case .workspaces(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 117) + }() + case .crashOptions?: try { + guard case .crashOptions(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 118) + }() + case .filesystem?: try { + guard case .filesystem(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 119) + }() + case .executionOptions?: try { + guard case .executionOptions(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 121) + }() + case .command?: try { + guard case .command(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 122) + }() + case .spawn?: try { + guard case .spawn(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 123) + }() + case .grpcServer?: try { + guard case .grpcServer(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 124) + }() + case .canonicalizeFlags?: try { + guard case .canonicalizeFlags(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 125) + }() + case .buildConfiguration?: try { + guard case .buildConfiguration(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 126) + }() + case .infoCommand?: try { + guard case .infoCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 127) + }() + case .memoryOptions?: try { + guard case .memoryOptions(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 129) + }() + case .query?: try { + guard case .query(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 130) + }() + case .localExecution?: try { + guard case .localExecution(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 132) + }() + case .actionCache?: try { + guard case .actionCache(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 134) + }() + case .fetchCommand?: try { + guard case .fetchCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 135) + }() + case .syncCommand?: try { + guard case .syncCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 136) + }() + case .sandbox?: try { + guard case .sandbox(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 137) + }() + case .includeScanning?: try { + guard case .includeScanning(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 139) + }() + case .testCommand?: try { + guard case .testCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 140) + }() + case .actionQuery?: try { + guard case .actionQuery(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 141) + }() + case .targetPatterns?: try { + guard case .targetPatterns(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 142) + }() + case .cleanCommand?: try { + guard case .cleanCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 144) + }() + case .configCommand?: try { + guard case .configCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 145) + }() + case .configurableQuery?: try { + guard case .configurableQuery(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 146) + }() + case .dumpCommand?: try { + guard case .dumpCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 147) + }() + case .helpCommand?: try { + guard case .helpCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 148) + }() + case .mobileInstall?: try { + guard case .mobileInstall(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 150) + }() + case .profileCommand?: try { + guard case .profileCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 151) + }() + case .runCommand?: try { + guard case .runCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 152) + }() + case .versionCommand?: try { + guard case .versionCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 153) + }() + case .printActionCommand?: try { + guard case .printActionCommand(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 154) + }() + case .workspaceStatus?: try { + guard case .workspaceStatus(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 158) + }() + case .javaCompile?: try { + guard case .javaCompile(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 159) + }() + case .actionRewinding?: try { + guard case .actionRewinding(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 160) + }() + case .cppCompile?: try { + guard case .cppCompile(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 161) + }() + case .starlarkAction?: try { + guard case .starlarkAction(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 162) + }() + case .ninjaAction?: try { + guard case .ninjaAction(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 163) + }() + case .dynamicExecution?: try { + guard case .dynamicExecution(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 164) + }() + case .failAction?: try { + guard case .failAction(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 166) + }() + case .symlinkAction?: try { + guard case .symlinkAction(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 167) + }() + case .cppLink?: try { + guard case .cppLink(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 168) + }() + case .ltoAction?: try { + guard case .ltoAction(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 169) + }() + case .testAction?: try { + guard case .testAction(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 172) + }() + case .worker?: try { + guard case .worker(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 173) + }() + case .analysis?: try { + guard case .analysis(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 174) + }() + case .packageLoading?: try { + guard case .packageLoading(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 175) + }() + case .toolchain?: try { + guard case .toolchain(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 177) + }() + case .starlarkLoading?: try { + guard case .starlarkLoading(let v)? = self.category else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 179) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_FailureDetail, rhs: FailureDetails_FailureDetail) -> Bool { + if lhs.message != rhs.message {return false} + if lhs.category != rhs.category {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_Interrupted: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Interrupted" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .interruptedUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_Interrupted, rhs: FailureDetails_Interrupted) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_Interrupted.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "INTERRUPTED_UNKNOWN"), + 4: .same(proto: "DEPRECATED_BUILD"), + 5: .same(proto: "DEPRECATED_BUILD_COMPLETION"), + 6: .same(proto: "DEPRECATED_PACKAGE_LOADING_SYNC"), + 7: .same(proto: "DEPRECATED_EXECUTOR_COMPLETION"), + 8: .same(proto: "DEPRECATED_COMMAND_DISPATCH"), + 9: .same(proto: "DEPRECATED_INFO_ITEM"), + 10: .same(proto: "DEPRECATED_AFTER_QUERY"), + 17: .same(proto: "DEPRECATED_FETCH_COMMAND"), + 18: .same(proto: "DEPRECATED_SYNC_COMMAND"), + 20: .same(proto: "DEPRECATED_CLEAN_COMMAND"), + 21: .same(proto: "DEPRECATED_MOBILE_INSTALL_COMMAND"), + 22: .same(proto: "DEPRECATED_QUERY"), + 23: .same(proto: "DEPRECATED_RUN_COMMAND"), + 27: .same(proto: "DEPRECATED_OPTIONS_PARSING"), + 28: .same(proto: "INTERRUPTED"), + ] +} + +extension FailureDetails_Spawn: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Spawn" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + 2: .same(proto: "catastrophic"), + 3: .standard(proto: "spawn_exit_code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self.catastrophic) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self.spawnExitCode) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .spawnUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + if self.catastrophic != false { + try visitor.visitSingularBoolField(value: self.catastrophic, fieldNumber: 2) + } + if self.spawnExitCode != 0 { + try visitor.visitSingularInt32Field(value: self.spawnExitCode, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_Spawn, rhs: FailureDetails_Spawn) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.catastrophic != rhs.catastrophic {return false} + if lhs.spawnExitCode != rhs.spawnExitCode {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_Spawn.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "SPAWN_UNKNOWN"), + 1: .same(proto: "NON_ZERO_EXIT"), + 2: .same(proto: "TIMEOUT"), + 3: .same(proto: "OUT_OF_MEMORY"), + 4: .same(proto: "EXECUTION_FAILED"), + 5: .same(proto: "EXECUTION_DENIED"), + 6: .same(proto: "REMOTE_CACHE_FAILED"), + 7: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), + 8: .same(proto: "EXEC_IO_EXCEPTION"), + 9: .same(proto: "INVALID_TIMEOUT"), + 10: .same(proto: "INVALID_REMOTE_EXECUTION_PROPERTIES"), + 11: .same(proto: "NO_USABLE_STRATEGY_FOUND"), + 12: .same(proto: "UNSPECIFIED_EXECUTION_FAILURE"), + ] +} + +extension FailureDetails_ExternalRepository: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ExternalRepository" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .externalRepositoryUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_ExternalRepository, rhs: FailureDetails_ExternalRepository) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_ExternalRepository.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "EXTERNAL_REPOSITORY_UNKNOWN"), + 1: .same(proto: "OVERRIDE_DISALLOWED_MANAGED_DIRECTORIES"), + 2: .same(proto: "BAD_DOWNLOADER_CONFIG"), + ] +} + +extension FailureDetails_BuildProgress: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".BuildProgress" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .buildProgressUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_BuildProgress, rhs: FailureDetails_BuildProgress) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_BuildProgress.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "BUILD_PROGRESS_UNKNOWN"), + 3: .same(proto: "OUTPUT_INITIALIZATION"), + 4: .same(proto: "BES_RUNS_PER_TEST_LIMIT_UNSUPPORTED"), + 5: .same(proto: "BES_LOCAL_WRITE_ERROR"), + 6: .same(proto: "BES_INITIALIZATION_ERROR"), + 7: .same(proto: "BES_UPLOAD_TIMEOUT_ERROR"), + 8: .same(proto: "BES_FILE_WRITE_TIMEOUT"), + 9: .same(proto: "BES_FILE_WRITE_IO_ERROR"), + 10: .same(proto: "BES_FILE_WRITE_INTERRUPTED"), + 11: .same(proto: "BES_FILE_WRITE_CANCELED"), + 12: .same(proto: "BES_FILE_WRITE_UNKNOWN_ERROR"), + 13: .same(proto: "BES_UPLOAD_LOCAL_FILE_ERROR"), + 14: .same(proto: "BES_STREAM_NOT_RETRYING_FAILURE"), + 15: .same(proto: "BES_STREAM_COMPLETED_WITH_UNACK_EVENTS_ERROR"), + 16: .same(proto: "BES_STREAM_COMPLETED_WITH_UNSENT_EVENTS_ERROR"), + 17: .same(proto: "BES_UPLOAD_RETRY_LIMIT_EXCEEDED_FAILURE"), + ] +} + +extension FailureDetails_RemoteOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".RemoteOptions" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .remoteOptionsUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_RemoteOptions, rhs: FailureDetails_RemoteOptions) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_RemoteOptions.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "REMOTE_OPTIONS_UNKNOWN"), + 1: .same(proto: "REMOTE_DEFAULT_EXEC_PROPERTIES_LOGIC_ERROR"), + 2: .same(proto: "CREDENTIALS_READ_FAILURE"), + 3: .same(proto: "CREDENTIALS_WRITE_FAILURE"), + 4: .same(proto: "DOWNLOADER_WITHOUT_GRPC_CACHE"), + 5: .same(proto: "EXECUTION_WITH_INVALID_CACHE"), + ] +} + +extension FailureDetails_ClientEnvironment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ClientEnvironment" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .clientEnvironmentUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_ClientEnvironment, rhs: FailureDetails_ClientEnvironment) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_ClientEnvironment.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CLIENT_ENVIRONMENT_UNKNOWN"), + 1: .same(proto: "CLIENT_CWD_MALFORMED"), + ] +} + +extension FailureDetails_Crash: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Crash" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + 2: .same(proto: "causes"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.causes) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .crashUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + if !self.causes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.causes, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_Crash, rhs: FailureDetails_Crash) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.causes != rhs.causes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_Crash.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CRASH_UNKNOWN"), + 1: .same(proto: "CRASH_OOM"), + ] +} + +extension FailureDetails_Throwable: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Throwable" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "throwable_class"), + 2: .same(proto: "message"), + 3: .standard(proto: "stack_trace"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self.throwableClass) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.message) }() + case 3: try { try decoder.decodeRepeatedStringField(value: &self.stackTrace) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.throwableClass.isEmpty { + try visitor.visitSingularStringField(value: self.throwableClass, fieldNumber: 1) + } + if !self.message.isEmpty { + try visitor.visitSingularStringField(value: self.message, fieldNumber: 2) + } + if !self.stackTrace.isEmpty { + try visitor.visitRepeatedStringField(value: self.stackTrace, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_Throwable, rhs: FailureDetails_Throwable) -> Bool { + if lhs.throwableClass != rhs.throwableClass {return false} + if lhs.message != rhs.message {return false} + if lhs.stackTrace != rhs.stackTrace {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_SymlinkForest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SymlinkForest" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .symlinkForestUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_SymlinkForest, rhs: FailureDetails_SymlinkForest) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_SymlinkForest.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "SYMLINK_FOREST_UNKNOWN"), + 1: .same(proto: "TOPLEVEL_OUTDIR_PACKAGE_PATH_CONFLICT"), + 2: .same(proto: "TOPLEVEL_OUTDIR_USED_AS_SOURCE"), + 3: .same(proto: "CREATION_FAILED"), + ] +} + +extension FailureDetails_PackageOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".PackageOptions" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .packageOptionsUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_PackageOptions, rhs: FailureDetails_PackageOptions) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_PackageOptions.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "PACKAGE_OPTIONS_UNKNOWN"), + 1: .same(proto: "PACKAGE_PATH_INVALID"), + ] +} + +extension FailureDetails_RemoteExecution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".RemoteExecution" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .remoteExecutionUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_RemoteExecution, rhs: FailureDetails_RemoteExecution) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_RemoteExecution.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "REMOTE_EXECUTION_UNKNOWN"), + 1: .same(proto: "CAPABILITIES_QUERY_FAILURE"), + 2: .same(proto: "CREDENTIALS_INIT_FAILURE"), + 3: .same(proto: "CACHE_INIT_FAILURE"), + 4: .same(proto: "RPC_LOG_FAILURE"), + 5: .same(proto: "EXEC_CHANNEL_INIT_FAILURE"), + 6: .same(proto: "CACHE_CHANNEL_INIT_FAILURE"), + 7: .same(proto: "DOWNLOADER_CHANNEL_INIT_FAILURE"), + 8: .same(proto: "LOG_DIR_CLEANUP_FAILURE"), + 9: .same(proto: "CLIENT_SERVER_INCOMPATIBLE"), + 10: .same(proto: "DOWNLOADED_INPUTS_DELETION_FAILURE"), + 11: .same(proto: "REMOTE_DOWNLOAD_OUTPUTS_MINIMAL_WITHOUT_INMEMORY_DOTD"), + 12: .same(proto: "REMOTE_DOWNLOAD_OUTPUTS_MINIMAL_WITHOUT_INMEMORY_JDEPS"), + 13: .same(proto: "INCOMPLETE_OUTPUT_DOWNLOAD_CLEANUP_FAILURE"), + 14: .same(proto: "REMOTE_DEFAULT_PLATFORM_PROPERTIES_PARSE_FAILURE"), + 15: .same(proto: "ILLEGAL_OUTPUT"), + 16: .same(proto: "INVALID_EXEC_AND_PLATFORM_PROPERTIES"), + ] +} + +extension FailureDetails_Execution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Execution" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .executionUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_Execution, rhs: FailureDetails_Execution) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_Execution.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "EXECUTION_UNKNOWN"), + 1: .same(proto: "EXECUTION_LOG_INITIALIZATION_FAILURE"), + 2: .same(proto: "EXECUTION_LOG_WRITE_FAILURE"), + 3: .same(proto: "EXECROOT_CREATION_FAILURE"), + 4: .same(proto: "TEMP_ACTION_OUTPUT_DIRECTORY_DELETION_FAILURE"), + 5: .same(proto: "TEMP_ACTION_OUTPUT_DIRECTORY_CREATION_FAILURE"), + 6: .same(proto: "PERSISTENT_ACTION_OUTPUT_DIRECTORY_CREATION_FAILURE"), + 7: .same(proto: "LOCAL_OUTPUT_DIRECTORY_SYMLINK_FAILURE"), + 9: .same(proto: "LOCAL_TEMPLATE_EXPANSION_FAILURE"), + 10: .same(proto: "INPUT_DIRECTORY_CHECK_IO_EXCEPTION"), + 11: .same(proto: "EXTRA_ACTION_OUTPUT_CREATION_FAILURE"), + 12: .same(proto: "TEST_RUNNER_IO_EXCEPTION"), + 13: .same(proto: "FILE_WRITE_IO_EXCEPTION"), + 14: .same(proto: "TEST_OUT_ERR_IO_EXCEPTION"), + 15: .same(proto: "SYMLINK_TREE_MANIFEST_COPY_IO_EXCEPTION"), + 16: .same(proto: "SYMLINK_TREE_MANIFEST_LINK_IO_EXCEPTION"), + 17: .same(proto: "SYMLINK_TREE_CREATION_IO_EXCEPTION"), + 18: .same(proto: "SYMLINK_TREE_CREATION_COMMAND_EXCEPTION"), + 19: .same(proto: "ACTION_INPUT_READ_IO_EXCEPTION"), + 20: .same(proto: "ACTION_NOT_UP_TO_DATE"), + 21: .same(proto: "PSEUDO_ACTION_EXECUTION_PROHIBITED"), + 22: .same(proto: "DISCOVERED_INPUT_DOES_NOT_EXIST"), + 23: .same(proto: "ACTION_OUTPUTS_DELETION_FAILURE"), + 24: .same(proto: "ACTION_OUTPUTS_NOT_CREATED"), + 25: .same(proto: "ACTION_FINALIZATION_FAILURE"), + 26: .same(proto: "ACTION_INPUT_LOST"), + 27: .same(proto: "FILESYSTEM_CONTEXT_UPDATE_FAILURE"), + 28: .same(proto: "ACTION_OUTPUT_CLOSE_FAILURE"), + 29: .same(proto: "INPUT_DISCOVERY_IO_EXCEPTION"), + 30: .same(proto: "TREE_ARTIFACT_DIRECTORY_CREATION_FAILURE"), + 31: .same(proto: "ACTION_OUTPUT_DIRECTORY_CREATION_FAILURE"), + 32: .same(proto: "ACTION_FS_OUTPUT_DIRECTORY_CREATION_FAILURE"), + 33: .same(proto: "ACTION_FS_OUT_ERR_DIRECTORY_CREATION_FAILURE"), + 34: .same(proto: "NON_ACTION_EXECUTION_FAILURE"), + 35: .same(proto: "CYCLE"), + 36: .same(proto: "SOURCE_INPUT_MISSING"), + 37: .same(proto: "UNEXPECTED_EXCEPTION"), + 39: .same(proto: "SOURCE_INPUT_IO_EXCEPTION"), + ] +} + +extension FailureDetails_Workspaces: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Workspaces" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .workspacesUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_Workspaces, rhs: FailureDetails_Workspaces) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_Workspaces.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "WORKSPACES_UNKNOWN"), + 1: .same(proto: "WORKSPACES_LOG_INITIALIZATION_FAILURE"), + 2: .same(proto: "WORKSPACES_LOG_WRITE_FAILURE"), + 3: .same(proto: "ILLEGAL_WORKSPACE_FILE_SYMLINK_WITH_MANAGED_DIRECTORIES"), + 4: .same(proto: "WORKSPACE_FILE_READ_FAILURE_WITH_MANAGED_DIRECTORIES"), + ] +} + +extension FailureDetails_CrashOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".CrashOptions" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .crashOptionsUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_CrashOptions, rhs: FailureDetails_CrashOptions) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_CrashOptions.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CRASH_OPTIONS_UNKNOWN"), + ] +} + +extension FailureDetails_Filesystem: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Filesystem" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .filesystemUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_Filesystem, rhs: FailureDetails_Filesystem) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_Filesystem.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FILESYSTEM_UNKNOWN"), + 3: .same(proto: "EMBEDDED_BINARIES_ENUMERATION_FAILURE"), + 4: .same(proto: "SERVER_PID_TXT_FILE_READ_FAILURE"), + 5: .same(proto: "SERVER_FILE_WRITE_FAILURE"), + 6: .same(proto: "DEFAULT_DIGEST_HASH_FUNCTION_INVALID_VALUE"), + ] +} + +extension FailureDetails_ExecutionOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ExecutionOptions" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .executionOptionsUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_ExecutionOptions, rhs: FailureDetails_ExecutionOptions) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_ExecutionOptions.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "EXECUTION_OPTIONS_UNKNOWN"), + 3: .same(proto: "INVALID_STRATEGY"), + 4: .same(proto: "REQUESTED_STRATEGY_INCOMPATIBLE_WITH_SANDBOXING"), + 5: .same(proto: "DEPRECATED_LOCAL_RESOURCES_USED"), + 6: .same(proto: "INVALID_CYCLIC_DYNAMIC_STRATEGY"), + 7: .same(proto: "RESTRICTION_UNMATCHED_TO_ACTION_CONTEXT"), + 8: .same(proto: "REMOTE_FALLBACK_STRATEGY_NOT_ABSTRACT_SPAWN"), + 9: .same(proto: "STRATEGY_NOT_FOUND"), + 10: .same(proto: "DYNAMIC_STRATEGY_NOT_SANDBOXED"), + ] +} + +extension FailureDetails_Command: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Command" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .commandFailureUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_Command, rhs: FailureDetails_Command) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_Command.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "COMMAND_FAILURE_UNKNOWN"), + 1: .same(proto: "COMMAND_NOT_FOUND"), + 2: .same(proto: "ANOTHER_COMMAND_RUNNING"), + 3: .same(proto: "PREVIOUSLY_SHUTDOWN"), + 4: .same(proto: "STARLARK_CPU_PROFILE_FILE_INITIALIZATION_FAILURE"), + 5: .same(proto: "STARLARK_CPU_PROFILING_INITIALIZATION_FAILURE"), + 6: .same(proto: "STARLARK_CPU_PROFILE_FILE_WRITE_FAILURE"), + 7: .same(proto: "INVOCATION_POLICY_PARSE_FAILURE"), + 8: .same(proto: "INVOCATION_POLICY_INVALID"), + 9: .same(proto: "OPTIONS_PARSE_FAILURE"), + 10: .same(proto: "STARLARK_OPTIONS_PARSE_FAILURE"), + 11: .same(proto: "ARGUMENTS_NOT_RECOGNIZED"), + 12: .same(proto: "NOT_IN_WORKSPACE"), + 13: .same(proto: "SPACES_IN_WORKSPACE_PATH"), + 14: .same(proto: "IN_OUTPUT_DIRECTORY"), + ] +} + +extension FailureDetails_GrpcServer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GrpcServer" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .grpcServerUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_GrpcServer, rhs: FailureDetails_GrpcServer) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_GrpcServer.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "GRPC_SERVER_UNKNOWN"), + 1: .same(proto: "GRPC_SERVER_NOT_COMPILED_IN"), + 2: .same(proto: "SERVER_BIND_FAILURE"), + 3: .same(proto: "BAD_COOKIE"), + 4: .same(proto: "NO_CLIENT_DESCRIPTION"), + ] +} + +extension FailureDetails_CanonicalizeFlags: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".CanonicalizeFlags" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .canonicalizeFlagsUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_CanonicalizeFlags, rhs: FailureDetails_CanonicalizeFlags) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_CanonicalizeFlags.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CANONICALIZE_FLAGS_UNKNOWN"), + 1: .same(proto: "FOR_COMMAND_INVALID"), + ] +} + +extension FailureDetails_BuildConfiguration: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".BuildConfiguration" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .buildConfigurationUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_BuildConfiguration, rhs: FailureDetails_BuildConfiguration) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_BuildConfiguration.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "BUILD_CONFIGURATION_UNKNOWN"), + 1: .same(proto: "PLATFORM_MAPPING_EVALUATION_FAILURE"), + 2: .same(proto: "PLATFORM_MAPPINGS_FILE_IS_DIRECTORY"), + 3: .same(proto: "PLATFORM_MAPPINGS_FILE_NOT_FOUND"), + 4: .same(proto: "TOP_LEVEL_CONFIGURATION_CREATION_FAILURE"), + 5: .same(proto: "INVALID_CONFIGURATION"), + 6: .same(proto: "INVALID_BUILD_OPTIONS"), + 7: .same(proto: "MULTI_CPU_PREREQ_UNMET"), + 8: .same(proto: "HEURISTIC_INSTRUMENTATION_FILTER_INVALID"), + 9: .same(proto: "CYCLE"), + 10: .same(proto: "CONFLICTING_CONFIGURATIONS"), + 11: .same(proto: "INVALID_OUTPUT_DIRECTORY_MNEMONIC"), + ] +} + +extension FailureDetails_InfoCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".InfoCommand" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .infoCommandUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_InfoCommand, rhs: FailureDetails_InfoCommand) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_InfoCommand.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "INFO_COMMAND_UNKNOWN"), + 1: .same(proto: "TOO_MANY_KEYS"), + 2: .same(proto: "KEY_NOT_RECOGNIZED"), + 3: .same(proto: "INFO_BLOCK_WRITE_FAILURE"), + 4: .same(proto: "ALL_INFO_WRITE_FAILURE"), + ] +} + +extension FailureDetails_MemoryOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".MemoryOptions" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .memoryOptionsUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_MemoryOptions, rhs: FailureDetails_MemoryOptions) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_MemoryOptions.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "MEMORY_OPTIONS_UNKNOWN"), + 1: .same(proto: "EXPERIMENTAL_OOM_MORE_EAGERLY_THRESHOLD_INVALID_VALUE"), + 2: .same(proto: "EXPERIMENTAL_OOM_MORE_EAGERLY_NO_TENURED_COLLECTORS_FOUND"), + ] +} + +extension FailureDetails_Query: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Query" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .queryUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_Query, rhs: FailureDetails_Query) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_Query.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "QUERY_UNKNOWN"), + 1: .same(proto: "QUERY_FILE_WITH_COMMAND_LINE_EXPRESSION"), + 2: .same(proto: "QUERY_FILE_READ_FAILURE"), + 3: .same(proto: "COMMAND_LINE_EXPRESSION_MISSING"), + 4: .same(proto: "OUTPUT_FORMAT_INVALID"), + 5: .same(proto: "GRAPHLESS_PREREQ_UNMET"), + 6: .same(proto: "QUERY_OUTPUT_WRITE_FAILURE"), + 13: .same(proto: "QUERY_STDOUT_FLUSH_FAILURE"), + 14: .same(proto: "ANALYSIS_QUERY_PREREQ_UNMET"), + 15: .same(proto: "QUERY_RESULTS_FLUSH_FAILURE"), + 16: .same(proto: "DEPRECATED_UNCLOSED_QUOTATION_EXPRESSION_ERROR"), + 17: .same(proto: "VARIABLE_NAME_INVALID"), + 18: .same(proto: "VARIABLE_UNDEFINED"), + 19: .same(proto: "BUILDFILES_AND_LOADFILES_CANNOT_USE_OUTPUT_LOCATION_ERROR"), + 20: .same(proto: "BUILD_FILE_ERROR"), + 21: .same(proto: "CYCLE"), + 22: .same(proto: "UNIQUE_SKYKEY_THRESHOLD_EXCEEDED"), + 23: .same(proto: "TARGET_NOT_IN_UNIVERSE_SCOPE"), + 24: .same(proto: "INVALID_FULL_UNIVERSE_EXPRESSION"), + 25: .same(proto: "UNIVERSE_SCOPE_LIMIT_EXCEEDED"), + 26: .same(proto: "INVALIDATION_LIMIT_EXCEEDED"), + 27: .same(proto: "OUTPUT_FORMAT_PREREQ_UNMET"), + 28: .same(proto: "ARGUMENTS_MISSING"), + 29: .same(proto: "RBUILDFILES_FUNCTION_REQUIRES_SKYQUERY"), + 30: .same(proto: "FULL_TARGETS_NOT_SUPPORTED"), + 31: .same(proto: "DEPRECATED_UNEXPECTED_TOKEN_ERROR"), + 32: .same(proto: "DEPRECATED_INTEGER_LITERAL_MISSING"), + 33: .same(proto: "DEPRECATED_INVALID_STARTING_CHARACTER_ERROR"), + 34: .same(proto: "DEPRECATED_PREMATURE_END_OF_INPUT_ERROR"), + 35: .same(proto: "SYNTAX_ERROR"), + 36: .same(proto: "OUTPUT_FORMATTER_IO_EXCEPTION"), + 37: .same(proto: "SKYQUERY_TRANSITIVE_TARGET_ERROR"), + 38: .same(proto: "SKYQUERY_TARGET_EXCEPTION"), + 39: .same(proto: "INVALID_LABEL_IN_TEST_SUITE"), + 40: .same(proto: "ILLEGAL_FLAG_COMBINATION"), + ] +} + +extension FailureDetails_LocalExecution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".LocalExecution" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .localExecutionUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_LocalExecution, rhs: FailureDetails_LocalExecution) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_LocalExecution.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "LOCAL_EXECUTION_UNKNOWN"), + 1: .same(proto: "LOCKFREE_OUTPUT_PREREQ_UNMET"), + ] +} + +extension FailureDetails_ActionCache: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ActionCache" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .actionCacheUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_ActionCache, rhs: FailureDetails_ActionCache) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_ActionCache.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "ACTION_CACHE_UNKNOWN"), + 1: .same(proto: "INITIALIZATION_FAILURE"), + ] +} + +extension FailureDetails_FetchCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".FetchCommand" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .fetchCommandUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_FetchCommand, rhs: FailureDetails_FetchCommand) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_FetchCommand.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FETCH_COMMAND_UNKNOWN"), + 1: .same(proto: "EXPRESSION_MISSING"), + 2: .same(proto: "OPTIONS_INVALID"), + 3: .same(proto: "QUERY_PARSE_ERROR"), + 4: .same(proto: "QUERY_EVALUATION_ERROR"), + ] +} + +extension FailureDetails_SyncCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SyncCommand" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .syncCommandUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_SyncCommand, rhs: FailureDetails_SyncCommand) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_SyncCommand.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "message"), - 101: .same(proto: "interrupted"), - 103: .standard(proto: "external_repository"), - 104: .standard(proto: "build_progress"), - 106: .standard(proto: "remote_options"), - 107: .standard(proto: "client_environment"), - 108: .same(proto: "crash"), - 110: .standard(proto: "symlink_forest"), - 114: .standard(proto: "package_options"), - 115: .standard(proto: "remote_execution"), - 116: .same(proto: "execution"), - 117: .same(proto: "workspaces"), - 118: .standard(proto: "crash_options"), - 119: .same(proto: "filesystem"), - 121: .standard(proto: "execution_options"), - 122: .same(proto: "command"), - 123: .same(proto: "spawn"), - 124: .standard(proto: "grpc_server"), - 125: .standard(proto: "canonicalize_flags"), - 126: .standard(proto: "build_configuration"), - 127: .standard(proto: "info_command"), - 129: .standard(proto: "memory_options"), - 130: .same(proto: "query"), - 132: .standard(proto: "local_execution"), + 0: .same(proto: "SYNC_COMMAND_UNKNOWN"), + 1: .same(proto: "PACKAGE_LOOKUP_ERROR"), + 2: .same(proto: "WORKSPACE_EVALUATION_ERROR"), + 3: .same(proto: "REPOSITORY_FETCH_ERRORS"), + 4: .same(proto: "REPOSITORY_NAME_INVALID"), + ] +} + +extension FailureDetails_Sandbox: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Sandbox" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .sandboxFailureUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_Sandbox, rhs: FailureDetails_Sandbox) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_Sandbox.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "SANDBOX_FAILURE_UNKNOWN"), + 1: .same(proto: "INITIALIZATION_FAILURE"), + 2: .same(proto: "EXECUTION_IO_EXCEPTION"), + 3: .same(proto: "DOCKER_COMMAND_FAILURE"), + 4: .same(proto: "NO_DOCKER_IMAGE"), + 5: .same(proto: "DOCKER_IMAGE_PREPARATION_FAILURE"), + 6: .same(proto: "BIND_MOUNT_ANALYSIS_FAILURE"), + 7: .same(proto: "MOUNT_SOURCE_DOES_NOT_EXIST"), + 8: .same(proto: "MOUNT_SOURCE_TARGET_TYPE_MISMATCH"), + 9: .same(proto: "MOUNT_TARGET_DOES_NOT_EXIST"), + 10: .same(proto: "SUBPROCESS_START_FAILED"), + ] +} + +extension FailureDetails_IncludeScanning: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".IncludeScanning" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), ] - fileprivate class _StorageClass { - var _message: String = String() - var _category: FailureDetails_FailureDetail.OneOf_Category? + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .includeScanningUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_IncludeScanning, rhs: FailureDetails_IncludeScanning) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} - static let defaultInstance = _StorageClass() +extension FailureDetails_IncludeScanning.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "INCLUDE_SCANNING_UNKNOWN"), + 1: .same(proto: "INITIALIZE_INCLUDE_HINTS_ERROR"), + 2: .same(proto: "SCANNING_IO_EXCEPTION"), + 3: .same(proto: "INCLUDE_HINTS_FILE_NOT_IN_PACKAGE"), + 4: .same(proto: "INCLUDE_HINTS_READ_FAILURE"), + 5: .same(proto: "ILLEGAL_ABSOLUTE_PATH"), + 6: .same(proto: "PACKAGE_LOAD_FAILURE"), + ] +} - private init() {} +extension FailureDetails_TestCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".TestCommand" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] - init(copying source: _StorageClass) { - _message = source._message - _category = source._category + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } } } - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) + public func traverse(visitor: inout V) throws { + if self.code != .testCommandUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } - return _storage + try unknownFields.traverse(visitor: &visitor) } + public static func ==(lhs: FailureDetails_TestCommand, rhs: FailureDetails_TestCommand) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_TestCommand.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "TEST_COMMAND_UNKNOWN"), + 1: .same(proto: "NO_TEST_TARGETS"), + 2: .same(proto: "TEST_WITH_NOANALYZE"), + 3: .same(proto: "TESTS_FAILED"), + ] +} + +extension FailureDetails_ActionQuery: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ActionQuery" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &_storage._message) - case 101: - var v: FailureDetails_Interrupted? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .interrupted(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .interrupted(v)} - case 103: - var v: FailureDetails_ExternalRepository? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .externalRepository(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .externalRepository(v)} - case 104: - var v: FailureDetails_BuildProgress? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .buildProgress(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .buildProgress(v)} - case 106: - var v: FailureDetails_RemoteOptions? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .remoteOptions(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .remoteOptions(v)} - case 107: - var v: FailureDetails_ClientEnvironment? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .clientEnvironment(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .clientEnvironment(v)} - case 108: - var v: FailureDetails_Crash? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .crash(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .crash(v)} - case 110: - var v: FailureDetails_SymlinkForest? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .symlinkForest(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .symlinkForest(v)} - case 114: - var v: FailureDetails_PackageOptions? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .packageOptions(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .packageOptions(v)} - case 115: - var v: FailureDetails_RemoteExecution? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .remoteExecution(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .remoteExecution(v)} - case 116: - var v: FailureDetails_Execution? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .execution(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .execution(v)} - case 117: - var v: FailureDetails_Workspaces? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .workspaces(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .workspaces(v)} - case 118: - var v: FailureDetails_CrashOptions? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .crashOptions(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .crashOptions(v)} - case 119: - var v: FailureDetails_Filesystem? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .filesystem(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .filesystem(v)} - case 121: - var v: FailureDetails_ExecutionOptions? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .executionOptions(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .executionOptions(v)} - case 122: - var v: FailureDetails_Command? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .command(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .command(v)} - case 123: - var v: FailureDetails_Spawn? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .spawn(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .spawn(v)} - case 124: - var v: FailureDetails_GrpcServer? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .grpcServer(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .grpcServer(v)} - case 125: - var v: FailureDetails_CanonicalizeFlags? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .canonicalizeFlags(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .canonicalizeFlags(v)} - case 126: - var v: FailureDetails_BuildConfiguration? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .buildConfiguration(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .buildConfiguration(v)} - case 127: - var v: FailureDetails_InfoCommand? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .infoCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .infoCommand(v)} - case 129: - var v: FailureDetails_MemoryOptions? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .memoryOptions(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .memoryOptions(v)} - case 130: - var v: FailureDetails_Query? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .query(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .query(v)} - case 132: - var v: FailureDetails_LocalExecution? - if let current = _storage._category { - try decoder.handleConflictingOneOf() - if case .localExecution(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._category = .localExecution(v)} - default: break - } + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if !_storage._message.isEmpty { - try visitor.visitSingularStringField(value: _storage._message, fieldNumber: 1) - } - switch _storage._category { - case .interrupted(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 101) - case .externalRepository(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 103) - case .buildProgress(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 104) - case .remoteOptions(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 106) - case .clientEnvironment(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 107) - case .crash(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 108) - case .symlinkForest(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 110) - case .packageOptions(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 114) - case .remoteExecution(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 115) - case .execution(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 116) - case .workspaces(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 117) - case .crashOptions(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 118) - case .filesystem(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 119) - case .executionOptions(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 121) - case .command(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 122) - case .spawn(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 123) - case .grpcServer(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 124) - case .canonicalizeFlags(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 125) - case .buildConfiguration(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 126) - case .infoCommand(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 127) - case .memoryOptions(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 129) - case .query(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 130) - case .localExecution(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 132) - case nil: break + if self.code != .actionQueryUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_ActionQuery, rhs: FailureDetails_ActionQuery) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_ActionQuery.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "ACTION_QUERY_UNKNOWN"), + 1: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), + 2: .same(proto: "OUTPUT_FAILURE"), + 3: .same(proto: "COMMAND_LINE_EXPRESSION_MISSING"), + 4: .same(proto: "EXPRESSION_PARSE_FAILURE"), + 5: .same(proto: "SKYFRAME_STATE_WITH_COMMAND_LINE_EXPRESSION"), + 6: .same(proto: "INVALID_AQUERY_EXPRESSION"), + 7: .same(proto: "SKYFRAME_STATE_PREREQ_UNMET"), + 8: .same(proto: "AQUERY_OUTPUT_TOO_BIG"), + 9: .same(proto: "ILLEGAL_PATTERN_SYNTAX"), + 10: .same(proto: "INCORRECT_ARGUMENTS"), + 11: .same(proto: "TOP_LEVEL_TARGETS_WITH_SKYFRAME_STATE_NOT_SUPPORTED"), + 12: .same(proto: "SKYFRAME_STATE_AFTER_EXECUTION"), + ] +} + +extension FailureDetails_TargetPatterns: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".TargetPatterns" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break } } + } + + public func traverse(visitor: inout V) throws { + if self.code != .targetPatternsUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_FailureDetail, rhs: FailureDetails_FailureDetail) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._message != rhs_storage._message {return false} - if _storage._category != rhs_storage._category {return false} - return true + public static func ==(lhs: FailureDetails_TargetPatterns, rhs: FailureDetails_TargetPatterns) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_TargetPatterns.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "TARGET_PATTERNS_UNKNOWN"), + 1: .same(proto: "TARGET_PATTERN_FILE_WITH_COMMAND_LINE_PATTERN"), + 2: .same(proto: "TARGET_PATTERN_FILE_READ_FAILURE"), + 3: .same(proto: "TARGET_PATTERN_PARSE_FAILURE"), + 4: .same(proto: "PACKAGE_NOT_FOUND"), + 5: .same(proto: "TARGET_FORMAT_INVALID"), + 6: .same(proto: "ABSOLUTE_TARGET_PATTERN_INVALID"), + 7: .same(proto: "CANNOT_DETERMINE_TARGET_FROM_FILENAME"), + 8: .same(proto: "LABEL_SYNTAX_ERROR"), + 9: .same(proto: "TARGET_CANNOT_BE_EMPTY_STRING"), + 10: .same(proto: "PACKAGE_PART_CANNOT_END_IN_SLASH"), + 11: .same(proto: "CYCLE"), + 12: .same(proto: "CANNOT_PRELOAD_TARGET"), + 13: .same(proto: "TARGETS_MISSING"), + 14: .same(proto: "RECURSIVE_TARGET_PATTERNS_NOT_ALLOWED"), + 15: .same(proto: "UP_LEVEL_REFERENCES_NOT_ALLOWED"), + 16: .same(proto: "NEGATIVE_TARGET_PATTERN_NOT_ALLOWED"), + 17: .same(proto: "TARGET_MUST_BE_A_FILE"), + 18: .same(proto: "DEPENDENCY_NOT_FOUND"), + 19: .same(proto: "PACKAGE_NAME_INVALID"), + ] +} + +extension FailureDetails_CleanCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".CleanCommand" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break } - if !storagesAreEqual {return false} } + } + + public func traverse(visitor: inout V) throws { + if self.code != .cleanCommandUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_CleanCommand, rhs: FailureDetails_CleanCommand) -> Bool { + if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Interrupted: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Interrupted" +extension FailureDetails_CleanCommand.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CLEAN_COMMAND_UNKNOWN"), + 1: .same(proto: "OUTPUT_SERVICE_CLEAN_FAILURE"), + 2: .same(proto: "ACTION_CACHE_CLEAN_FAILURE"), + 3: .same(proto: "OUT_ERR_CLOSE_FAILURE"), + 4: .same(proto: "OUTPUT_BASE_DELETE_FAILURE"), + 5: .same(proto: "OUTPUT_BASE_TEMP_MOVE_FAILURE"), + 6: .same(proto: "ASYNC_OUTPUT_BASE_DELETE_FAILURE"), + 7: .same(proto: "EXECROOT_DELETE_FAILURE"), + 8: .same(proto: "EXECROOT_TEMP_MOVE_FAILURE"), + 9: .same(proto: "ASYNC_EXECROOT_DELETE_FAILURE"), + 10: .same(proto: "ARGUMENTS_NOT_RECOGNIZED"), + ] +} + +extension FailureDetails_ConfigCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConfigCommand" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .interruptedUnknown { + if self.code != .configCommandUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Interrupted, rhs: FailureDetails_Interrupted) -> Bool { + public static func ==(lhs: FailureDetails_ConfigCommand, rhs: FailureDetails_ConfigCommand) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Interrupted.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_ConfigCommand.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "INTERRUPTED_UNKNOWN"), - 4: .same(proto: "BUILD"), - 5: .same(proto: "BUILD_COMPLETION"), - 6: .same(proto: "PACKAGE_LOADING_SYNC"), - 7: .same(proto: "EXECUTOR_COMPLETION"), - 8: .same(proto: "COMMAND_DISPATCH"), - 9: .same(proto: "INFO_ITEM"), - 10: .same(proto: "AFTER_QUERY"), + 0: .same(proto: "CONFIG_COMMAND_UNKNOWN"), + 1: .same(proto: "TOO_MANY_CONFIG_IDS"), + 2: .same(proto: "CONFIGURATION_NOT_FOUND"), ] } -extension FailureDetails_Spawn: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Spawn" +extension FailureDetails_ConfigurableQuery: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ConfigurableQuery" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .configurableQueryUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_ConfigurableQuery, rhs: FailureDetails_ConfigurableQuery) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_ConfigurableQuery.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CONFIGURABLE_QUERY_UNKNOWN"), + 1: .same(proto: "COMMAND_LINE_EXPRESSION_MISSING"), + 2: .same(proto: "EXPRESSION_PARSE_FAILURE"), + 3: .same(proto: "FILTERS_NOT_SUPPORTED"), + 4: .same(proto: "BUILDFILES_FUNCTION_NOT_SUPPORTED"), + 5: .same(proto: "SIBLINGS_FUNCTION_NOT_SUPPORTED"), + 6: .same(proto: "VISIBLE_FUNCTION_NOT_SUPPORTED"), + 7: .same(proto: "ATTRIBUTE_MISSING"), + 8: .same(proto: "INCORRECT_CONFIG_ARGUMENT_ERROR"), + 9: .same(proto: "TARGET_MISSING"), + 10: .same(proto: "STARLARK_SYNTAX_ERROR"), + 11: .same(proto: "STARLARK_EVAL_ERROR"), + 12: .same(proto: "FORMAT_FUNCTION_ERROR"), + ] +} + +extension FailureDetails_DumpCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".DumpCommand" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "code"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.code != .dumpCommandUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: FailureDetails_DumpCommand, rhs: FailureDetails_DumpCommand) -> Bool { + if lhs.code != rhs.code {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension FailureDetails_DumpCommand.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "DUMP_COMMAND_UNKNOWN"), + 1: .same(proto: "NO_OUTPUT_SPECIFIED"), + 2: .same(proto: "ACTION_CACHE_DUMP_FAILED"), + 3: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), + 4: .same(proto: "ACTION_GRAPH_DUMP_FAILED"), + 5: .same(proto: "STARLARK_HEAP_DUMP_FAILED"), + ] +} + +extension FailureDetails_HelpCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".HelpCommand" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), - 2: .same(proto: "catastrophic"), - 3: .standard(proto: "spawn_exit_code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) - case 2: try decoder.decodeSingularBoolField(value: &self.catastrophic) - case 3: try decoder.decodeSingularInt32Field(value: &self.spawnExitCode) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .spawnUnknown { + if self.code != .helpCommandUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } - if self.catastrophic != false { - try visitor.visitSingularBoolField(value: self.catastrophic, fieldNumber: 2) - } - if self.spawnExitCode != 0 { - try visitor.visitSingularInt32Field(value: self.spawnExitCode, fieldNumber: 3) - } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Spawn, rhs: FailureDetails_Spawn) -> Bool { + public static func ==(lhs: FailureDetails_HelpCommand, rhs: FailureDetails_HelpCommand) -> Bool { if lhs.code != rhs.code {return false} - if lhs.catastrophic != rhs.catastrophic {return false} - if lhs.spawnExitCode != rhs.spawnExitCode {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Spawn.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_HelpCommand.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SPAWN_UNKNOWN"), - 1: .same(proto: "NON_ZERO_EXIT"), - 2: .same(proto: "TIMEOUT"), - 3: .same(proto: "OUT_OF_MEMORY"), - 4: .same(proto: "EXECUTION_FAILED"), - 5: .same(proto: "EXECUTION_DENIED"), - 6: .same(proto: "REMOTE_CACHE_FAILED"), + 0: .same(proto: "HELP_COMMAND_UNKNOWN"), + 1: .same(proto: "MISSING_ARGUMENT"), + 2: .same(proto: "COMMAND_NOT_FOUND"), ] } -extension FailureDetails_ExternalRepository: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ExternalRepository" +extension FailureDetails_MobileInstall: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".MobileInstall" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .externalRepositoryUnknown { + if self.code != .mobileInstallUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_ExternalRepository, rhs: FailureDetails_ExternalRepository) -> Bool { + public static func ==(lhs: FailureDetails_MobileInstall, rhs: FailureDetails_MobileInstall) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_ExternalRepository.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_MobileInstall.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "EXTERNAL_REPOSITORY_UNKNOWN"), - 1: .same(proto: "OVERRIDE_DISALLOWED_MANAGED_DIRECTORIES"), + 0: .same(proto: "MOBILE_INSTALL_UNKNOWN"), + 1: .same(proto: "CLASSIC_UNSUPPORTED"), + 2: .same(proto: "NO_TARGET_SPECIFIED"), + 3: .same(proto: "MULTIPLE_TARGETS_SPECIFIED"), + 4: .same(proto: "TARGET_TYPE_INVALID"), + 5: .same(proto: "NON_ZERO_EXIT"), + 6: .same(proto: "ERROR_RUNNING_PROGRAM"), ] } -extension FailureDetails_BuildProgress: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BuildProgress" +extension FailureDetails_ProfileCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ProfileCommand" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .buildProgressUnknown { + if self.code != .profileCommandUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_BuildProgress, rhs: FailureDetails_BuildProgress) -> Bool { + public static func ==(lhs: FailureDetails_ProfileCommand, rhs: FailureDetails_ProfileCommand) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_BuildProgress.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_ProfileCommand.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "BUILD_PROGRESS_UNKNOWN"), - 3: .same(proto: "OUTPUT_INITIALIZATION"), - 4: .same(proto: "BES_RUNS_PER_TEST_LIMIT_UNSUPPORTED"), - 5: .same(proto: "BES_LOCAL_WRITE_ERROR"), - 6: .same(proto: "BES_INITIALIZATION_ERROR"), - 7: .same(proto: "BES_UPLOAD_TIMEOUT_ERROR"), - 8: .same(proto: "BES_FILE_WRITE_TIMEOUT"), - 9: .same(proto: "BES_FILE_WRITE_IO_ERROR"), - 10: .same(proto: "BES_FILE_WRITE_INTERRUPTED"), - 11: .same(proto: "BES_FILE_WRITE_CANCELED"), - 12: .same(proto: "BES_FILE_WRITE_UNKNOWN_ERROR"), - 13: .same(proto: "BES_UPLOAD_LOCAL_FILE_ERROR"), - 14: .same(proto: "BES_STREAM_NOT_RETRYING_FAILURE"), - 15: .same(proto: "BES_STREAM_COMPLETED_WITH_UNACK_EVENTS_ERROR"), - 16: .same(proto: "BES_STREAM_COMPLETED_WITH_UNSENT_EVENTS_ERROR"), - 17: .same(proto: "BES_UPLOAD_RETRY_LIMIT_EXCEEDED_FAILURE"), + 0: .same(proto: "PROFILE_COMMAND_UNKNOWN"), + 1: .same(proto: "OLD_BINARY_FORMAT_UNSUPPORTED"), + 2: .same(proto: "FILE_READ_FAILURE"), ] } -extension FailureDetails_RemoteOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RemoteOptions" +extension FailureDetails_RunCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".RunCommand" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .remoteOptionsUnknown { + if self.code != .runCommandUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_RemoteOptions, rhs: FailureDetails_RemoteOptions) -> Bool { + public static func ==(lhs: FailureDetails_RunCommand, rhs: FailureDetails_RunCommand) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_RemoteOptions.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_RunCommand.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "REMOTE_OPTIONS_UNKNOWN"), - 1: .same(proto: "REMOTE_DEFAULT_EXEC_PROPERTIES_LOGIC_ERROR"), - 2: .same(proto: "CREDENTIALS_READ_FAILURE"), - 3: .same(proto: "CREDENTIALS_WRITE_FAILURE"), - 4: .same(proto: "DOWNLOADER_WITHOUT_GRPC_CACHE"), - 5: .same(proto: "EXECUTION_WITH_INVALID_CACHE"), + 0: .same(proto: "RUN_COMMAND_UNKNOWN"), + 1: .same(proto: "NO_TARGET_SPECIFIED"), + 2: .same(proto: "TOO_MANY_TARGETS_SPECIFIED"), + 3: .same(proto: "TARGET_NOT_EXECUTABLE"), + 4: .same(proto: "TARGET_BUILT_BUT_PATH_NOT_EXECUTABLE"), + 5: .same(proto: "TARGET_BUILT_BUT_PATH_VALIDATION_FAILED"), + 6: .same(proto: "RUN_UNDER_TARGET_NOT_BUILT"), + 7: .same(proto: "RUN_PREREQ_UNMET"), + 8: .same(proto: "TOO_MANY_TEST_SHARDS_OR_RUNS"), + 9: .same(proto: "TEST_ENVIRONMENT_SETUP_FAILURE"), + 10: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), + 11: .same(proto: "NO_SHELL_SPECIFIED"), + 12: .same(proto: "SCRIPT_WRITE_FAILURE"), + 13: .same(proto: "RUNFILES_DIRECTORIES_CREATION_FAILURE"), + 14: .same(proto: "RUNFILES_SYMLINKS_CREATION_FAILURE"), + 15: .same(proto: "TEST_ENVIRONMENT_SETUP_INTERRUPTED"), ] } -extension FailureDetails_ClientEnvironment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ClientEnvironment" +extension FailureDetails_VersionCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".VersionCommand" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .clientEnvironmentUnknown { + if self.code != .versionCommandUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_ClientEnvironment, rhs: FailureDetails_ClientEnvironment) -> Bool { + public static func ==(lhs: FailureDetails_VersionCommand, rhs: FailureDetails_VersionCommand) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_ClientEnvironment.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_VersionCommand.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CLIENT_ENVIRONMENT_UNKNOWN"), - 1: .same(proto: "CLIENT_CWD_MALFORMED"), + 0: .same(proto: "VERSION_COMMAND_UNKNOWN"), + 1: .same(proto: "NOT_AVAILABLE"), ] } -extension FailureDetails_Crash: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Crash" +extension FailureDetails_PrintActionCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".PrintActionCommand" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), - 2: .same(proto: "causes"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) - case 2: try decoder.decodeRepeatedMessageField(value: &self.causes) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .crashUnknown { + if self.code != .printActionCommandUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } - if !self.causes.isEmpty { - try visitor.visitRepeatedMessageField(value: self.causes, fieldNumber: 2) - } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Crash, rhs: FailureDetails_Crash) -> Bool { + public static func ==(lhs: FailureDetails_PrintActionCommand, rhs: FailureDetails_PrintActionCommand) -> Bool { if lhs.code != rhs.code {return false} - if lhs.causes != rhs.causes {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Crash.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_PrintActionCommand.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CRASH_UNKNOWN"), - 1: .same(proto: "CRASH_OOM"), + 0: .same(proto: "PRINT_ACTION_COMMAND_UNKNOWN"), + 1: .same(proto: "TARGET_NOT_FOUND"), + 2: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), + 3: .same(proto: "TARGET_KIND_UNSUPPORTED"), + 4: .same(proto: "ACTIONS_NOT_FOUND"), ] } -extension FailureDetails_Throwable: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Throwable" +extension FailureDetails_WorkspaceStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".WorkspaceStatus" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "throwable_class"), - 2: .same(proto: "message"), - 3: .standard(proto: "stack_trace"), + 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &self.throwableClass) - case 2: try decoder.decodeSingularStringField(value: &self.message) - case 3: try decoder.decodeRepeatedStringField(value: &self.stackTrace) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if !self.throwableClass.isEmpty { - try visitor.visitSingularStringField(value: self.throwableClass, fieldNumber: 1) - } - if !self.message.isEmpty { - try visitor.visitSingularStringField(value: self.message, fieldNumber: 2) - } - if !self.stackTrace.isEmpty { - try visitor.visitRepeatedStringField(value: self.stackTrace, fieldNumber: 3) + if self.code != .workspaceStatusUnknown { + try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Throwable, rhs: FailureDetails_Throwable) -> Bool { - if lhs.throwableClass != rhs.throwableClass {return false} - if lhs.message != rhs.message {return false} - if lhs.stackTrace != rhs.stackTrace {return false} + public static func ==(lhs: FailureDetails_WorkspaceStatus, rhs: FailureDetails_WorkspaceStatus) -> Bool { + if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_SymlinkForest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SymlinkForest" +extension FailureDetails_WorkspaceStatus.Code: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "WORKSPACE_STATUS_UNKNOWN"), + 1: .same(proto: "NON_ZERO_EXIT"), + 2: .same(proto: "ABNORMAL_TERMINATION"), + 3: .same(proto: "EXEC_FAILED"), + 4: .same(proto: "PARSE_FAILURE"), + 5: .same(proto: "VALIDATION_FAILURE"), + 6: .same(proto: "CONTENT_UPDATE_IO_EXCEPTION"), + 7: .same(proto: "STDERR_IO_EXCEPTION"), + ] +} + +extension FailureDetails_JavaCompile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".JavaCompile" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .symlinkForestUnknown { + if self.code != .javaCompileUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_SymlinkForest, rhs: FailureDetails_SymlinkForest) -> Bool { + public static func ==(lhs: FailureDetails_JavaCompile, rhs: FailureDetails_JavaCompile) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_SymlinkForest.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_JavaCompile.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SYMLINK_FOREST_UNKNOWN"), - 1: .same(proto: "TOPLEVEL_OUTDIR_PACKAGE_PATH_CONFLICT"), - 2: .same(proto: "TOPLEVEL_OUTDIR_USED_AS_SOURCE"), + 0: .same(proto: "JAVA_COMPILE_UNKNOWN"), + 1: .same(proto: "REDUCED_CLASSPATH_FAILURE"), + 2: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), + 3: .same(proto: "JDEPS_READ_IO_EXCEPTION"), + 4: .same(proto: "REDUCED_CLASSPATH_FALLBACK_CLEANUP_FAILURE"), ] } -extension FailureDetails_PackageOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PackageOptions" +extension FailureDetails_ActionRewinding: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ActionRewinding" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .packageOptionsUnknown { + if self.code != .actionRewindingUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_PackageOptions, rhs: FailureDetails_PackageOptions) -> Bool { + public static func ==(lhs: FailureDetails_ActionRewinding, rhs: FailureDetails_ActionRewinding) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_PackageOptions.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_ActionRewinding.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "PACKAGE_OPTIONS_UNKNOWN"), - 1: .same(proto: "PACKAGE_PATH_INVALID"), + 0: .same(proto: "ACTION_REWINDING_UNKNOWN"), + 1: .same(proto: "LOST_INPUT_TOO_MANY_TIMES"), + 2: .same(proto: "LOST_INPUT_IS_SOURCE"), ] } -extension FailureDetails_RemoteExecution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RemoteExecution" +extension FailureDetails_CppCompile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".CppCompile" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .remoteExecutionUnknown { + if self.code != .cppCompileUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_RemoteExecution, rhs: FailureDetails_RemoteExecution) -> Bool { + public static func ==(lhs: FailureDetails_CppCompile, rhs: FailureDetails_CppCompile) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_RemoteExecution.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_CppCompile.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "REMOTE_EXECUTION_UNKNOWN"), - 1: .same(proto: "CAPABILITIES_QUERY_FAILURE"), - 2: .same(proto: "CREDENTIALS_INIT_FAILURE"), - 3: .same(proto: "CACHE_INIT_FAILURE"), - 4: .same(proto: "RPC_LOG_FAILURE"), - 5: .same(proto: "EXEC_CHANNEL_INIT_FAILURE"), - 6: .same(proto: "CACHE_CHANNEL_INIT_FAILURE"), - 7: .same(proto: "DOWNLOADER_CHANNEL_INIT_FAILURE"), - 8: .same(proto: "LOG_DIR_CLEANUP_FAILURE"), - 9: .same(proto: "CLIENT_SERVER_INCOMPATIBLE"), - 10: .same(proto: "DOWNLOADED_INPUTS_DELETION_FAILURE"), - 11: .same(proto: "REMOTE_DOWNLOAD_OUTPUTS_MINIMAL_WITHOUT_INMEMORY_DOTD"), - 12: .same(proto: "REMOTE_DOWNLOAD_OUTPUTS_MINIMAL_WITHOUT_INMEMORY_JDEPS"), + 0: .same(proto: "CPP_COMPILE_UNKNOWN"), + 1: .same(proto: "FIND_USED_HEADERS_IO_EXCEPTION"), + 2: .same(proto: "COPY_OUT_ERR_FAILURE"), + 3: .same(proto: "D_FILE_READ_FAILURE"), + 4: .same(proto: "COMMAND_GENERATION_FAILURE"), + 5: .same(proto: "MODULE_EXPANSION_TIMEOUT"), + 6: .same(proto: "INCLUDE_PATH_OUTSIDE_EXEC_ROOT"), + 7: .same(proto: "FAKE_COMMAND_GENERATION_FAILURE"), + 8: .same(proto: "UNDECLARED_INCLUSIONS"), + 9: .same(proto: "D_FILE_PARSE_FAILURE"), + 10: .same(proto: "COVERAGE_NOTES_CREATION_FAILURE"), + 11: .same(proto: "MODULE_EXPANSION_MISSING_DATA"), ] } -extension FailureDetails_Execution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Execution" +extension FailureDetails_StarlarkAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".StarlarkAction" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .executionUnknown { + if self.code != .starlarkActionUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Execution, rhs: FailureDetails_Execution) -> Bool { + public static func ==(lhs: FailureDetails_StarlarkAction, rhs: FailureDetails_StarlarkAction) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Execution.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_StarlarkAction.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "EXECUTION_UNKNOWN"), - 1: .same(proto: "EXECUTION_LOG_INITIALIZATION_FAILURE"), - 2: .same(proto: "EXECUTION_LOG_WRITE_FAILURE"), + 0: .same(proto: "STARLARK_ACTION_UNKNOWN"), + 1: .same(proto: "UNUSED_INPUT_LIST_READ_FAILURE"), + 2: .same(proto: "UNUSED_INPUT_LIST_FILE_NOT_FOUND"), ] } -extension FailureDetails_Workspaces: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Workspaces" +extension FailureDetails_NinjaAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".NinjaAction" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .workspacesUnknown { + if self.code != .ninjaActionUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Workspaces, rhs: FailureDetails_Workspaces) -> Bool { + public static func ==(lhs: FailureDetails_NinjaAction, rhs: FailureDetails_NinjaAction) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Workspaces.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_NinjaAction.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "WORKSPACES_UNKNOWN"), - 1: .same(proto: "WORKSPACES_LOG_INITIALIZATION_FAILURE"), - 2: .same(proto: "WORKSPACES_LOG_WRITE_FAILURE"), - 3: .same(proto: "ILLEGAL_WORKSPACE_FILE_SYMLINK_WITH_MANAGED_DIRECTORIES"), - 4: .same(proto: "WORKSPACE_FILE_READ_FAILURE_WITH_MANAGED_DIRECTORIES"), + 0: .same(proto: "NINJA_ACTION_UNKNOWN"), + 1: .same(proto: "INVALID_DEPFILE_DECLARED_DEPENDENCY"), + 2: .same(proto: "D_FILE_PARSE_FAILURE"), ] } -extension FailureDetails_CrashOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CrashOptions" +extension FailureDetails_DynamicExecution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".DynamicExecution" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .crashOptionsUnknown { + if self.code != .dynamicExecutionUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_CrashOptions, rhs: FailureDetails_CrashOptions) -> Bool { + public static func ==(lhs: FailureDetails_DynamicExecution, rhs: FailureDetails_DynamicExecution) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_CrashOptions.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_DynamicExecution.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CRASH_OPTIONS_UNKNOWN"), + 0: .same(proto: "DYNAMIC_EXECUTION_UNKNOWN"), + 1: .same(proto: "XCODE_RELATED_PREREQ_UNMET"), + 2: .same(proto: "ACTION_LOG_MOVE_FAILURE"), + 3: .same(proto: "RUN_FAILURE"), + 4: .same(proto: "NO_USABLE_STRATEGY_FOUND"), ] } -extension FailureDetails_Filesystem: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Filesystem" +extension FailureDetails_FailAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".FailAction" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .filesystemUnknown { + if self.code != .failActionUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Filesystem, rhs: FailureDetails_Filesystem) -> Bool { + public static func ==(lhs: FailureDetails_FailAction, rhs: FailureDetails_FailAction) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Filesystem.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_FailAction.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "FILESYSTEM_UNKNOWN"), - 1: .same(proto: "DEFAULT_DIGEST_HASH_FUNCTION_CHANGED"), - 2: .same(proto: "DEFAULT_DIGEST_HASH_FUNCTION_NOT_SET"), - 3: .same(proto: "EMBEDDED_BINARIES_ENUMERATION_FAILURE"), - 4: .same(proto: "SERVER_PID_TXT_FILE_READ_FAILURE"), - 5: .same(proto: "SERVER_FILE_WRITE_FAILURE"), - 6: .same(proto: "DEFAULT_DIGEST_HASH_FUNCTION_INVALID_VALUE"), + 0: .same(proto: "FAIL_ACTION_UNKNOWN"), + 1: .same(proto: "INTENTIONAL_FAILURE"), + 2: .same(proto: "INCORRECT_PYTHON_VERSION"), + 3: .same(proto: "PROGUARD_SPECS_MISSING"), + 4: .same(proto: "DYNAMIC_LINKING_NOT_SUPPORTED"), + 5: .same(proto: "SOURCE_FILES_MISSING"), + 6: .same(proto: "INCORRECT_TOOLCHAIN"), + 7: .same(proto: "FRAGMENT_CLASS_MISSING"), + 10: .same(proto: "CANT_BUILD_INCOMPATIBLE_TARGET"), ] } -extension FailureDetails_ExecutionOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ExecutionOptions" +extension FailureDetails_SymlinkAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SymlinkAction" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .executionOptionsUnknown { + if self.code != .symlinkActionUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_ExecutionOptions, rhs: FailureDetails_ExecutionOptions) -> Bool { + public static func ==(lhs: FailureDetails_SymlinkAction, rhs: FailureDetails_SymlinkAction) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_ExecutionOptions.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_SymlinkAction.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "EXECUTION_OPTIONS_UNKNOWN"), - 3: .same(proto: "INVALID_STRATEGY"), - 4: .same(proto: "REQUESTED_STRATEGY_INCOMPATIBLE_WITH_SANDBOXING"), + 0: .same(proto: "SYMLINK_ACTION_UNKNOWN"), + 1: .same(proto: "EXECUTABLE_INPUT_NOT_FILE"), + 2: .same(proto: "EXECUTABLE_INPUT_IS_NOT"), + 3: .same(proto: "EXECUTABLE_INPUT_CHECK_IO_EXCEPTION"), + 4: .same(proto: "LINK_CREATION_IO_EXCEPTION"), + 5: .same(proto: "LINK_TOUCH_IO_EXCEPTION"), ] } -extension FailureDetails_Command: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Command" +extension FailureDetails_CppLink: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".CppLink" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .commandFailureUnknown { + if self.code != .cppLinkUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Command, rhs: FailureDetails_Command) -> Bool { + public static func ==(lhs: FailureDetails_CppLink, rhs: FailureDetails_CppLink) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Command.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_CppLink.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "COMMAND_FAILURE_UNKNOWN"), - 1: .same(proto: "COMMAND_NOT_FOUND"), - 2: .same(proto: "ANOTHER_COMMAND_RUNNING"), - 3: .same(proto: "PREVIOUSLY_SHUTDOWN"), - 4: .same(proto: "STARLARK_CPU_PROFILE_FILE_INITIALIZATION_FAILURE"), - 5: .same(proto: "STARLARK_CPU_PROFILING_INITIALIZATION_FAILURE"), - 6: .same(proto: "STARLARK_CPU_PROFILE_FILE_WRITE_FAILURE"), - 7: .same(proto: "INVOCATION_POLICY_PARSE_FAILURE"), - 8: .same(proto: "INVOCATION_POLICY_INVALID"), - 9: .same(proto: "OPTIONS_PARSE_FAILURE"), - 10: .same(proto: "STARLARK_OPTIONS_PARSE_FAILURE"), - 11: .same(proto: "ARGUMENTS_NOT_RECOGNIZED"), + 0: .same(proto: "CPP_LINK_UNKNOWN"), + 1: .same(proto: "COMMAND_GENERATION_FAILURE"), + 2: .same(proto: "FAKE_COMMAND_GENERATION_FAILURE"), ] } -extension FailureDetails_GrpcServer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GrpcServer" +extension FailureDetails_LtoAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".LtoAction" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .grpcServerUnknown { + if self.code != .ltoActionUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_GrpcServer, rhs: FailureDetails_GrpcServer) -> Bool { + public static func ==(lhs: FailureDetails_LtoAction, rhs: FailureDetails_LtoAction) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_GrpcServer.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_LtoAction.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "GRPC_SERVER_UNKNOWN"), - 1: .same(proto: "GRPC_SERVER_NOT_COMPILED_IN"), - 2: .same(proto: "SERVER_BIND_FAILURE"), - 3: .same(proto: "BAD_COOKIE"), - 4: .same(proto: "NO_CLIENT_DESCRIPTION"), + 0: .same(proto: "LTO_ACTION_UNKNOWN"), + 1: .same(proto: "INVALID_ABSOLUTE_PATH_IN_IMPORTS"), + 2: .same(proto: "MISSING_BITCODE_FILES"), + 3: .same(proto: "IMPORTS_READ_IO_EXCEPTION"), ] } -extension FailureDetails_CanonicalizeFlags: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CanonicalizeFlags" +extension FailureDetails_TestAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".TestAction" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .canonicalizeFlagsUnknown { + if self.code != .testActionUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_CanonicalizeFlags, rhs: FailureDetails_CanonicalizeFlags) -> Bool { + public static func ==(lhs: FailureDetails_TestAction, rhs: FailureDetails_TestAction) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_CanonicalizeFlags.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_TestAction.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CANONICALIZE_FLAGS_UNKNOWN"), - 1: .same(proto: "FOR_COMMAND_INVALID"), + 0: .same(proto: "TEST_ACTION_UNKNOWN"), + 1: .same(proto: "NO_KEEP_GOING_TEST_FAILURE"), + 2: .same(proto: "LOCAL_TEST_PREREQ_UNMET"), + 3: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), + 4: .same(proto: "DUPLICATE_CPU_TAGS"), + 5: .same(proto: "INVALID_CPU_TAG"), ] } -extension FailureDetails_BuildConfiguration: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BuildConfiguration" +extension FailureDetails_Worker: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Worker" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .buildConfigurationUnknown { + if self.code != .workerUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_BuildConfiguration, rhs: FailureDetails_BuildConfiguration) -> Bool { + public static func ==(lhs: FailureDetails_Worker, rhs: FailureDetails_Worker) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_BuildConfiguration.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_Worker.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "BUILD_CONFIGURATION_UNKNOWN"), - 1: .same(proto: "PLATFORM_MAPPING_EVALUATION_FAILURE"), + 0: .same(proto: "WORKER_UNKNOWN"), + 1: .same(proto: "MULTIPLEXER_INSTANCE_REMOVAL_FAILURE"), + 2: .same(proto: "MULTIPLEXER_DOES_NOT_EXIST"), + 3: .same(proto: "NO_TOOLS"), + 4: .same(proto: "NO_FLAGFILE"), + 5: .same(proto: "VIRTUAL_INPUT_MATERIALIZATION_FAILURE"), + 6: .same(proto: "BORROW_FAILURE"), + 7: .same(proto: "PREFETCH_FAILURE"), + 8: .same(proto: "PREPARE_FAILURE"), + 9: .same(proto: "REQUEST_FAILURE"), + 10: .same(proto: "PARSE_RESPONSE_FAILURE"), + 11: .same(proto: "NO_RESPONSE"), + 12: .same(proto: "FINISH_FAILURE"), ] } -extension FailureDetails_InfoCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".InfoCommand" +extension FailureDetails_Analysis: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Analysis" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .infoCommandUnknown { + if self.code != .analysisUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_InfoCommand, rhs: FailureDetails_InfoCommand) -> Bool { + public static func ==(lhs: FailureDetails_Analysis, rhs: FailureDetails_Analysis) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_InfoCommand.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_Analysis.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "INFO_COMMAND_UNKNOWN"), - 1: .same(proto: "TOO_MANY_KEYS"), - 2: .same(proto: "KEY_NOT_RECOGNIZED"), - 3: .same(proto: "INFO_BLOCK_WRITE_FAILURE"), - 4: .same(proto: "ALL_INFO_WRITE_FAILURE"), + 0: .same(proto: "ANALYSIS_UNKNOWN"), + 1: .same(proto: "LOAD_FAILURE"), + 2: .same(proto: "GENERIC_LOADING_PHASE_FAILURE"), + 3: .same(proto: "NOT_ALL_TARGETS_ANALYZED"), + 4: .same(proto: "CYCLE"), + 5: .same(proto: "PARAMETERIZED_TOP_LEVEL_ASPECT_INVALID"), + 6: .same(proto: "ASPECT_LABEL_SYNTAX_ERROR"), + 7: .same(proto: "ASPECT_PREREQ_UNMET"), + 8: .same(proto: "ASPECT_NOT_FOUND"), + 9: .same(proto: "ACTION_CONFLICT"), + 10: .same(proto: "ARTIFACT_PREFIX_CONFLICT"), + 11: .same(proto: "UNEXPECTED_ANALYSIS_EXCEPTION"), + 12: .same(proto: "TARGETS_MISSING_ENVIRONMENTS"), + 13: .same(proto: "INVALID_ENVIRONMENT"), + 14: .same(proto: "ENVIRONMENT_MISSING_FROM_GROUPS"), + 15: .same(proto: "EXEC_GROUP_MISSING"), + 16: .same(proto: "INVALID_EXECUTION_PLATFORM"), + 17: .same(proto: "ASPECT_CREATION_FAILED"), + 18: .same(proto: "CONFIGURED_VALUE_CREATION_FAILED"), + 19: .same(proto: "INCOMPATIBLE_TARGET_REQUESTED"), ] } -extension FailureDetails_MemoryOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MemoryOptions" +extension FailureDetails_PackageLoading: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".PackageLoading" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .memoryOptionsUnknown { + if self.code != .packageLoadingUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_MemoryOptions, rhs: FailureDetails_MemoryOptions) -> Bool { + public static func ==(lhs: FailureDetails_PackageLoading, rhs: FailureDetails_PackageLoading) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_MemoryOptions.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_PackageLoading.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "MEMORY_OPTIONS_UNKNOWN"), - 1: .same(proto: "EXPERIMENTAL_OOM_MORE_EAGERLY_THRESHOLD_INVALID_VALUE"), + 0: .same(proto: "PACKAGE_LOADING_UNKNOWN"), + 1: .same(proto: "WORKSPACE_FILE_ERROR"), + 2: .same(proto: "MAX_COMPUTATION_STEPS_EXCEEDED"), + 3: .same(proto: "BUILD_FILE_MISSING"), + 4: .same(proto: "REPOSITORY_MISSING"), + 5: .same(proto: "PERSISTENT_INCONSISTENT_FILESYSTEM_ERROR"), + 6: .same(proto: "TRANSIENT_INCONSISTENT_FILESYSTEM_ERROR"), + 7: .same(proto: "INVALID_NAME"), + 9: .same(proto: "EVAL_GLOBS_SYMLINK_ERROR"), + 10: .same(proto: "IMPORT_STARLARK_FILE_ERROR"), + 11: .same(proto: "PACKAGE_MISSING"), + 12: .same(proto: "TARGET_MISSING"), + 13: .same(proto: "NO_SUCH_THING"), + 14: .same(proto: "GLOB_IO_EXCEPTION"), + 15: .same(proto: "DUPLICATE_LABEL"), + 16: .same(proto: "INVALID_PACKAGE_SPECIFICATION"), + 17: .same(proto: "SYNTAX_ERROR"), + 18: .same(proto: "ENVIRONMENT_IN_DIFFERENT_PACKAGE"), + 19: .same(proto: "DEFAULT_ENVIRONMENT_UNDECLARED"), + 20: .same(proto: "ENVIRONMENT_IN_MULTIPLE_GROUPS"), + 21: .same(proto: "ENVIRONMENT_DOES_NOT_EXIST"), + 22: .same(proto: "ENVIRONMENT_INVALID"), + 23: .same(proto: "ENVIRONMENT_NOT_IN_GROUP"), + 24: .same(proto: "PACKAGE_NAME_INVALID"), + 25: .same(proto: "STARLARK_EVAL_ERROR"), + 26: .same(proto: "LICENSE_PARSE_FAILURE"), + 27: .same(proto: "DISTRIBUTIONS_PARSE_FAILURE"), + 28: .same(proto: "LABEL_CROSSES_PACKAGE_BOUNDARY"), ] } -extension FailureDetails_Query: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Query" +extension FailureDetails_Toolchain: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Toolchain" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .queryUnknown { + if self.code != .toolchainUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Query, rhs: FailureDetails_Query) -> Bool { + public static func ==(lhs: FailureDetails_Toolchain, rhs: FailureDetails_Toolchain) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Query.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_Toolchain.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "QUERY_UNKNOWN"), - 1: .same(proto: "QUERY_FILE_WITH_COMMAND_LINE_EXPRESSION"), - 2: .same(proto: "QUERY_FILE_READ_FAILURE"), - 3: .same(proto: "COMMAND_LINE_EXPRESSION_MISSING"), - 4: .same(proto: "OUTPUT_FORMAT_INVALID"), - 5: .same(proto: "GRAPHLESS_PREREQ_UNMET"), - 6: .same(proto: "QUERY_OUTPUT_WRITE_FAILURE"), - 13: .same(proto: "QUERY_STDOUT_FLUSH_FAILURE"), - 14: .same(proto: "ANALYSIS_QUERY_PREREQ_UNMET"), + 0: .same(proto: "TOOLCHAIN_UNKNOWN"), + 1: .same(proto: "MISSING_PROVIDER"), + 2: .same(proto: "INVALID_CONSTRAINT_VALUE"), + 3: .same(proto: "INVALID_PLATFORM_VALUE"), + 4: .same(proto: "INVALID_TOOLCHAIN"), + 5: .same(proto: "NO_MATCHING_EXECUTION_PLATFORM"), + 6: .same(proto: "NO_MATCHING_TOOLCHAIN"), + 7: .same(proto: "INVALID_TOOLCHAIN_TYPE"), ] } -extension FailureDetails_LocalExecution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LocalExecution" +extension FailureDetails_StarlarkLoading: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".StarlarkLoading" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .localExecutionUnknown { + if self.code != .starlarkLoadingUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_LocalExecution, rhs: FailureDetails_LocalExecution) -> Bool { + public static func ==(lhs: FailureDetails_StarlarkLoading, rhs: FailureDetails_StarlarkLoading) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_LocalExecution.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_StarlarkLoading.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "LOCAL_EXECUTION_UNKNOWN"), - 1: .same(proto: "LOCKFREE_OUTPUT_PREREQ_UNMET"), + 0: .same(proto: "STARLARK_LOADING_UNKNOWN"), + 1: .same(proto: "CYCLE"), + 2: .same(proto: "COMPILE_ERROR"), + 3: .same(proto: "PARSE_ERROR"), + 4: .same(proto: "EVAL_ERROR"), + 5: .same(proto: "CONTAINING_PACKAGE_NOT_FOUND"), + 6: .same(proto: "PACKAGE_NOT_FOUND"), + 7: .same(proto: "IO_ERROR"), + 8: .same(proto: "LABEL_CROSSES_PACKAGE_BOUNDARY"), + 9: .same(proto: "BUILTINS_ERROR"), ] } diff --git a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/invocation_policy.pb.swift b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/invocation_policy.pb.swift old mode 100755 new mode 100644 index f1e6f2c..976e338 --- a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/invocation_policy.pb.swift +++ b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/invocation_policy.pb.swift @@ -1,4 +1,5 @@ // DO NOT EDIT. +// swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: src/main/protobuf/invocation_policy.proto @@ -6,24 +7,44 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ +// Copyright 2015 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that your are building against the same version of the API +// Please ensure that you are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } +/// The --invocation_policy flag takes a base64-encoded binary-serialized or text +/// formatted InvocationPolicy message. public struct Blaze_InvocationPolicy_InvocationPolicy { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Order matters. + /// After expanding policies on expansion flags or flags with implicit + /// requirements, only the final policy on a specific flag will be enforced + /// onto the user's command line. public var flagPolicies: [Blaze_InvocationPolicy_FlagPolicy] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -31,60 +52,72 @@ public struct Blaze_InvocationPolicy_InvocationPolicy { public init() {} } +/// A policy for controlling the value of a flag. public struct Blaze_InvocationPolicy_FlagPolicy { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// The name of the flag to enforce this policy on. + /// + /// Note that this should be the full name of the flag, not the abbreviated + /// name of the flag. If the user specifies the abbreviated name of a flag, + /// that flag will be matched using its full name. + /// + /// The "no" prefix will not be parsed, so for boolean flags, use + /// the flag's full name and explicitly set it to true or false. public var flagName: String { - get {return _storage._flagName ?? String()} - set {_uniqueStorage()._flagName = newValue} + get {return _flagName ?? String()} + set {_flagName = newValue} } /// Returns true if `flagName` has been explicitly set. - public var hasFlagName: Bool {return _storage._flagName != nil} + public var hasFlagName: Bool {return self._flagName != nil} /// Clears the value of `flagName`. Subsequent reads from it will return its default value. - public mutating func clearFlagName() {_uniqueStorage()._flagName = nil} + public mutating func clearFlagName() {self._flagName = nil} - public var commands: [String] { - get {return _storage._commands} - set {_uniqueStorage()._commands = newValue} - } + /// If set, this flag policy is applied only if one of the given commands or a + /// command that inherits from one of the given commands is being run. For + /// instance, if "build" is one of the commands here, then this policy will + /// apply to any command that inherits from build, such as info, coverage, or + /// test. If empty, this flag policy is applied for all commands. This allows + /// the policy setter to add all policies to the proto without having to + /// determine which Bazel command the user is actually running. Additionally, + /// Bazel allows multiple flags to be defined by the same name, and the + /// specific flag definition is determined by the command. + public var commands: [String] = [] - public var operation: OneOf_Operation? { - get {return _storage._operation} - set {_uniqueStorage()._operation = newValue} - } + public var operation: Blaze_InvocationPolicy_FlagPolicy.OneOf_Operation? = nil public var setValue: Blaze_InvocationPolicy_SetValue { get { - if case .setValue(let v)? = _storage._operation {return v} + if case .setValue(let v)? = operation {return v} return Blaze_InvocationPolicy_SetValue() } - set {_uniqueStorage()._operation = .setValue(newValue)} + set {operation = .setValue(newValue)} } public var useDefault: Blaze_InvocationPolicy_UseDefault { get { - if case .useDefault(let v)? = _storage._operation {return v} + if case .useDefault(let v)? = operation {return v} return Blaze_InvocationPolicy_UseDefault() } - set {_uniqueStorage()._operation = .useDefault(newValue)} + set {operation = .useDefault(newValue)} } public var disallowValues: Blaze_InvocationPolicy_DisallowValues { get { - if case .disallowValues(let v)? = _storage._operation {return v} + if case .disallowValues(let v)? = operation {return v} return Blaze_InvocationPolicy_DisallowValues() } - set {_uniqueStorage()._operation = .disallowValues(newValue)} + set {operation = .disallowValues(newValue)} } public var allowValues: Blaze_InvocationPolicy_AllowValues { get { - if case .allowValues(let v)? = _storage._operation {return v} + if case .allowValues(let v)? = operation {return v} return Blaze_InvocationPolicy_AllowValues() } - set {_uniqueStorage()._operation = .allowValues(newValue)} + set {operation = .allowValues(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -97,11 +130,26 @@ public struct Blaze_InvocationPolicy_FlagPolicy { #if !swift(>=4.1) public static func ==(lhs: Blaze_InvocationPolicy_FlagPolicy.OneOf_Operation, rhs: Blaze_InvocationPolicy_FlagPolicy.OneOf_Operation) -> Bool { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.setValue(let l), .setValue(let r)): return l == r - case (.useDefault(let l), .useDefault(let r)): return l == r - case (.disallowValues(let l), .disallowValues(let r)): return l == r - case (.allowValues(let l), .allowValues(let r)): return l == r + case (.setValue, .setValue): return { + guard case .setValue(let l) = lhs, case .setValue(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.useDefault, .useDefault): return { + guard case .useDefault(let l) = lhs, case .useDefault(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.disallowValues, .disallowValues): return { + guard case .disallowValues(let l) = lhs, case .disallowValues(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.allowValues, .allowValues): return { + guard case .allowValues(let l) = lhs, case .allowValues(let r) = rhs else { preconditionFailure() } + return l == r + }() default: return false } } @@ -110,7 +158,7 @@ public struct Blaze_InvocationPolicy_FlagPolicy { public init() {} - fileprivate var _storage = _StorageClass.defaultInstance + fileprivate var _flagName: String? = nil } public struct Blaze_InvocationPolicy_SetValue { @@ -118,8 +166,49 @@ public struct Blaze_InvocationPolicy_SetValue { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. + /// Use this value for the specified flag, overriding any default or user-set + /// value (unless append is set to true for repeatable flags). + /// + /// This field is repeated for repeatable flags. It is an error to set + /// multiple values for a flag that is not actually a repeatable flag. + /// This requires at least 1 value, if even the empty string. + /// + /// If the flag allows multiple values, all of its values are replaced with the + /// value or values from the policy (i.e., no diffing or merging is performed), + /// unless the append field (see below) is set to true. + /// + /// Note that some flags are tricky. For example, some flags look like boolean + /// flags, but are actually Void expansion flags that expand into other flags. + /// The Bazel flag parser will accept "--void_flag=false", but because + /// the flag is Void, the "=false" is ignored. It can get even trickier, like + /// "--novoid_flag" which is also an expansion flag with the type Void whose + /// name is explicitly "novoid_flag" and which expands into other flags that + /// are the opposite of "--void_flag". For expansion flags, it's best to + /// explicitly override the flags they expand into. + /// + /// Other flags may be differently tricky: A flag could have a converter that + /// converts some string to a list of values, but that flag may not itself have + /// allowMultiple set to true. + /// + /// An example is "--test_tag_filters": this flag sets its converter to + /// CommaSeparatedOptionListConverter, but does not set allowMultiple to true. + /// So "--test_tag_filters=foo,bar" results in ["foo", "bar"], however + /// "--test_tag_filters=foo --test_tag_filters=bar" results in just ["bar"] + /// since the 2nd value overrides the 1st. + /// + /// Similarly, "--test_tag_filters=foo,bar --test_tag_filters=baz,qux" results + /// in ["baz", "qux"]. For flags like these, the policy should specify + /// "foo,bar" instead of separately specifying "foo" and "bar" so that the + /// converter is appropriately invoked. + /// + /// Note that the opposite is not necessarily + /// true: for a flag that specifies allowMultiple=true, "--flag=foo,bar" + /// may fail to parse or result in an unexpected value. public var flagValue: [String] = [] + /// Whether to allow this policy to be overridden by user-specified values. + /// When set, if the user specified a value for this flag, use the value + /// from the user, otherwise use the value specified in this policy. public var overridable: Bool { get {return _overridable ?? false} set {_overridable = newValue} @@ -129,6 +218,10 @@ public struct Blaze_InvocationPolicy_SetValue { /// Clears the value of `overridable`. Subsequent reads from it will return its default value. public mutating func clearOverridable() {self._overridable = nil} + /// If true, and if the flag named in the policy is a repeatable flag, then + /// the values listed in flag_value do not replace all the user-set or default + /// values of the flag, but instead append to them. If the flag is not + /// repeatable, then this has no effect. public var append: Bool { get {return _append ?? false} set {_append = newValue} @@ -146,6 +239,17 @@ public struct Blaze_InvocationPolicy_SetValue { fileprivate var _append: Bool? = nil } +/// Use the default value of the flag, as defined by Bazel (or equivalently, do +/// not allow the user to set this flag). +/// +/// Note on implementation: UseDefault sets the default by clearing the flag, +/// so that when the value is requested and no flag is found, the flag parser +/// returns the default. This is mostly relevant for expansion flags: it will +/// erase user values in *all* flags that the expansion flag expands to. Only +/// use this on expansion flags if this is acceptable behavior. Since the last +/// policy wins, later policies on this same flag will still remove the +/// expanded UseDefault, so there is a way around, but it's really best not to +/// use this on expansion flags at all. public struct Blaze_InvocationPolicy_UseDefault { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -161,43 +265,81 @@ public struct Blaze_InvocationPolicy_DisallowValues { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var disallowedValues: [String] { - get {return _storage._disallowedValues} - set {_uniqueStorage()._disallowedValues = newValue} - } - - public var replacementValue: OneOf_ReplacementValue? { - get {return _storage._replacementValue} - set {_uniqueStorage()._replacementValue = newValue} - } - + /// It is an error for the user to use any of these values (that is, the Bazel + /// command will fail), unless new_value or use_default is set. + /// + /// For repeatable flags, if any one of the values in the flag matches a value + /// in the list of disallowed values, an error is thrown. + /// + /// Care must be taken for flags with complicated converters. For example, + /// it's possible for a repeated flag to be of type List>, so that + /// "--foo=a,b --foo=c,d" results in foo=[["a","b"], ["c", "d"]]. In this case, + /// it is not possible to disallow just "b", nor will ["b", "a"] match, nor + /// will ["b", "c"] (but ["a", "b"] will still match). + public var disallowedValues: [String] = [] + + public var replacementValue: Blaze_InvocationPolicy_DisallowValues.OneOf_ReplacementValue? = nil + + /// If set and if the value of the flag is disallowed (including the default + /// value of the flag if the user doesn't specify a value), use this value as + /// the value of the flag instead of raising an error. This does not apply to + /// repeatable flags and is ignored if the flag is a repeatable flag. public var newValue: String { get { - if case .newValue(let v)? = _storage._replacementValue {return v} + if case .newValue(let v)? = replacementValue {return v} return String() } - set {_uniqueStorage()._replacementValue = .newValue(newValue)} + set {replacementValue = .newValue(newValue)} } + /// If set and if the value of the flag is disallowed, use the default value + /// of the flag instead of raising an error. Unlike new_value, this works for + /// repeatable flags, but note that the default value for repeatable flags is + /// always empty. + /// + /// Note that it is an error to disallow the default value of the flag and + /// to set use_default, unless the flag is a repeatable flag where the + /// default value is always the empty list. public var useDefault: Blaze_InvocationPolicy_UseDefault { get { - if case .useDefault(let v)? = _storage._replacementValue {return v} + if case .useDefault(let v)? = replacementValue {return v} return Blaze_InvocationPolicy_UseDefault() } - set {_uniqueStorage()._replacementValue = .useDefault(newValue)} + set {replacementValue = .useDefault(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_ReplacementValue: Equatable { + /// If set and if the value of the flag is disallowed (including the default + /// value of the flag if the user doesn't specify a value), use this value as + /// the value of the flag instead of raising an error. This does not apply to + /// repeatable flags and is ignored if the flag is a repeatable flag. case newValue(String) + /// If set and if the value of the flag is disallowed, use the default value + /// of the flag instead of raising an error. Unlike new_value, this works for + /// repeatable flags, but note that the default value for repeatable flags is + /// always empty. + /// + /// Note that it is an error to disallow the default value of the flag and + /// to set use_default, unless the flag is a repeatable flag where the + /// default value is always the empty list. case useDefault(Blaze_InvocationPolicy_UseDefault) #if !swift(>=4.1) public static func ==(lhs: Blaze_InvocationPolicy_DisallowValues.OneOf_ReplacementValue, rhs: Blaze_InvocationPolicy_DisallowValues.OneOf_ReplacementValue) -> Bool { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.newValue(let l), .newValue(let r)): return l == r - case (.useDefault(let l), .useDefault(let r)): return l == r + case (.newValue, .newValue): return { + guard case .newValue(let l) = lhs, case .newValue(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.useDefault, .useDefault): return { + guard case .useDefault(let l) = lhs, case .useDefault(let r) = rhs else { preconditionFailure() } + return l == r + }() default: return false } } @@ -205,8 +347,6 @@ public struct Blaze_InvocationPolicy_DisallowValues { } public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance } public struct Blaze_InvocationPolicy_AllowValues { @@ -214,43 +354,72 @@ public struct Blaze_InvocationPolicy_AllowValues { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var allowedValues: [String] { - get {return _storage._allowedValues} - set {_uniqueStorage()._allowedValues = newValue} - } + /// It is an error for the user to use any value not in this list, unless + /// new_value or use_default is set. + public var allowedValues: [String] = [] - public var replacementValue: OneOf_ReplacementValue? { - get {return _storage._replacementValue} - set {_uniqueStorage()._replacementValue = newValue} - } + public var replacementValue: Blaze_InvocationPolicy_AllowValues.OneOf_ReplacementValue? = nil + /// If set and if the value of the flag is disallowed (including the default + /// value of the flag if the user doesn't specify a value), use this value as + /// the value of the flag instead of raising an error. This does not apply to + /// repeatable flags and is ignored if the flag is a repeatable flag. public var newValue: String { get { - if case .newValue(let v)? = _storage._replacementValue {return v} + if case .newValue(let v)? = replacementValue {return v} return String() } - set {_uniqueStorage()._replacementValue = .newValue(newValue)} + set {replacementValue = .newValue(newValue)} } + /// If set and if the value of the flag is disallowed, use the default value + /// of the flag instead of raising an error. Unlike new_value, this works for + /// repeatable flags, but note that the default value for repeatable flags is + /// always empty. + /// + /// Note that it is an error to disallow the default value of the flag and + /// to set use_default, unless the flag is a repeatable flag where the + /// default value is always the empty list. public var useDefault: Blaze_InvocationPolicy_UseDefault { get { - if case .useDefault(let v)? = _storage._replacementValue {return v} + if case .useDefault(let v)? = replacementValue {return v} return Blaze_InvocationPolicy_UseDefault() } - set {_uniqueStorage()._replacementValue = .useDefault(newValue)} + set {replacementValue = .useDefault(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_ReplacementValue: Equatable { + /// If set and if the value of the flag is disallowed (including the default + /// value of the flag if the user doesn't specify a value), use this value as + /// the value of the flag instead of raising an error. This does not apply to + /// repeatable flags and is ignored if the flag is a repeatable flag. case newValue(String) + /// If set and if the value of the flag is disallowed, use the default value + /// of the flag instead of raising an error. Unlike new_value, this works for + /// repeatable flags, but note that the default value for repeatable flags is + /// always empty. + /// + /// Note that it is an error to disallow the default value of the flag and + /// to set use_default, unless the flag is a repeatable flag where the + /// default value is always the empty list. case useDefault(Blaze_InvocationPolicy_UseDefault) #if !swift(>=4.1) public static func ==(lhs: Blaze_InvocationPolicy_AllowValues.OneOf_ReplacementValue, rhs: Blaze_InvocationPolicy_AllowValues.OneOf_ReplacementValue) -> Bool { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.newValue(let l), .newValue(let r)): return l == r - case (.useDefault(let l), .useDefault(let r)): return l == r + case (.newValue, .newValue): return { + guard case .newValue(let l) = lhs, case .newValue(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.useDefault, .useDefault): return { + guard case .useDefault(let l) = lhs, case .useDefault(let r) = rhs else { preconditionFailure() } + return l == r + }() default: return false } } @@ -258,8 +427,6 @@ public struct Blaze_InvocationPolicy_AllowValues { } public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance } // MARK: - Code below here is support for the SwiftProtobuf runtime. @@ -274,8 +441,11 @@ extension Blaze_InvocationPolicy_InvocationPolicy: SwiftProtobuf.Message, SwiftP public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeRepeatedMessageField(value: &self.flagPolicies) + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.flagPolicies) }() default: break } } @@ -306,109 +476,108 @@ extension Blaze_InvocationPolicy_FlagPolicy: SwiftProtobuf.Message, SwiftProtobu 6: .standard(proto: "allow_values"), ] - fileprivate class _StorageClass { - var _flagName: String? = nil - var _commands: [String] = [] - var _operation: Blaze_InvocationPolicy_FlagPolicy.OneOf_Operation? - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _flagName = source._flagName - _commands = source._commands - _operation = source._operation - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeSingularStringField(value: &_storage._flagName) - case 2: try decoder.decodeRepeatedStringField(value: &_storage._commands) - case 3: - var v: Blaze_InvocationPolicy_SetValue? - if let current = _storage._operation { - try decoder.handleConflictingOneOf() - if case .setValue(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._operation = .setValue(v)} - case 4: - var v: Blaze_InvocationPolicy_UseDefault? - if let current = _storage._operation { - try decoder.handleConflictingOneOf() - if case .useDefault(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._operation = .useDefault(v)} - case 5: - var v: Blaze_InvocationPolicy_DisallowValues? - if let current = _storage._operation { - try decoder.handleConflictingOneOf() - if case .disallowValues(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._operation = .disallowValues(v)} - case 6: - var v: Blaze_InvocationPolicy_AllowValues? - if let current = _storage._operation { - try decoder.handleConflictingOneOf() - if case .allowValues(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._operation = .allowValues(v)} - default: break + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._flagName) }() + case 2: try { try decoder.decodeRepeatedStringField(value: &self.commands) }() + case 3: try { + var v: Blaze_InvocationPolicy_SetValue? + var hadOneofValue = false + if let current = self.operation { + hadOneofValue = true + if case .setValue(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.operation = .setValue(v) + } + }() + case 4: try { + var v: Blaze_InvocationPolicy_UseDefault? + var hadOneofValue = false + if let current = self.operation { + hadOneofValue = true + if case .useDefault(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.operation = .useDefault(v) + } + }() + case 5: try { + var v: Blaze_InvocationPolicy_DisallowValues? + var hadOneofValue = false + if let current = self.operation { + hadOneofValue = true + if case .disallowValues(let m) = current {v = m} } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.operation = .disallowValues(v) + } + }() + case 6: try { + var v: Blaze_InvocationPolicy_AllowValues? + var hadOneofValue = false + if let current = self.operation { + hadOneofValue = true + if case .allowValues(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.operation = .allowValues(v) + } + }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if let v = _storage._flagName { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } - if !_storage._commands.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._commands, fieldNumber: 2) - } - switch _storage._operation { - case .setValue(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - case .useDefault(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - case .disallowValues(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - case .allowValues(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - case nil: break - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._flagName { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + if !self.commands.isEmpty { + try visitor.visitRepeatedStringField(value: self.commands, fieldNumber: 2) + } + switch self.operation { + case .setValue?: try { + guard case .setValue(let v)? = self.operation else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + }() + case .useDefault?: try { + guard case .useDefault(let v)? = self.operation else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + }() + case .disallowValues?: try { + guard case .disallowValues(let v)? = self.operation else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + }() + case .allowValues?: try { + guard case .allowValues(let v)? = self.operation else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + }() + case nil: break } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Blaze_InvocationPolicy_FlagPolicy, rhs: Blaze_InvocationPolicy_FlagPolicy) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._flagName != rhs_storage._flagName {return false} - if _storage._commands != rhs_storage._commands {return false} - if _storage._operation != rhs_storage._operation {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs._flagName != rhs._flagName {return false} + if lhs.commands != rhs.commands {return false} + if lhs.operation != rhs.operation {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -424,25 +593,32 @@ extension Blaze_InvocationPolicy_SetValue: SwiftProtobuf.Message, SwiftProtobuf. public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try decoder.decodeRepeatedStringField(value: &self.flagValue) - case 2: try decoder.decodeSingularBoolField(value: &self._overridable) - case 3: try decoder.decodeSingularBoolField(value: &self._append) + case 1: try { try decoder.decodeRepeatedStringField(value: &self.flagValue) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self._overridable) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self._append) }() default: break } } } public func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 if !self.flagValue.isEmpty { try visitor.visitRepeatedStringField(value: self.flagValue, fieldNumber: 1) } - if let v = self._overridable { + try { if let v = self._overridable { try visitor.visitSingularBoolField(value: v, fieldNumber: 2) - } - if let v = self._append { + } }() + try { if let v = self._append { try visitor.visitSingularBoolField(value: v, fieldNumber: 3) - } + } }() try unknownFields.traverse(visitor: &visitor) } @@ -482,79 +658,64 @@ extension Blaze_InvocationPolicy_DisallowValues: SwiftProtobuf.Message, SwiftPro 4: .standard(proto: "use_default"), ] - fileprivate class _StorageClass { - var _disallowedValues: [String] = [] - var _replacementValue: Blaze_InvocationPolicy_DisallowValues.OneOf_ReplacementValue? - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _disallowedValues = source._disallowedValues - _replacementValue = source._replacementValue - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeRepeatedStringField(value: &_storage._disallowedValues) - case 3: - if _storage._replacementValue != nil {try decoder.handleConflictingOneOf()} - var v: String? - try decoder.decodeSingularStringField(value: &v) - if let v = v {_storage._replacementValue = .newValue(v)} - case 4: - var v: Blaze_InvocationPolicy_UseDefault? - if let current = _storage._replacementValue { - try decoder.handleConflictingOneOf() - if case .useDefault(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._replacementValue = .useDefault(v)} - default: break + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedStringField(value: &self.disallowedValues) }() + case 3: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.replacementValue != nil {try decoder.handleConflictingOneOf()} + self.replacementValue = .newValue(v) + } + }() + case 4: try { + var v: Blaze_InvocationPolicy_UseDefault? + var hadOneofValue = false + if let current = self.replacementValue { + hadOneofValue = true + if case .useDefault(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.replacementValue = .useDefault(v) } + }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if !_storage._disallowedValues.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._disallowedValues, fieldNumber: 1) - } - switch _storage._replacementValue { - case .newValue(let v)?: - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - case .useDefault(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - case nil: break - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.disallowedValues.isEmpty { + try visitor.visitRepeatedStringField(value: self.disallowedValues, fieldNumber: 1) + } + switch self.replacementValue { + case .newValue?: try { + guard case .newValue(let v)? = self.replacementValue else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + }() + case .useDefault?: try { + guard case .useDefault(let v)? = self.replacementValue else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + }() + case nil: break } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Blaze_InvocationPolicy_DisallowValues, rhs: Blaze_InvocationPolicy_DisallowValues) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._disallowedValues != rhs_storage._disallowedValues {return false} - if _storage._replacementValue != rhs_storage._replacementValue {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.disallowedValues != rhs.disallowedValues {return false} + if lhs.replacementValue != rhs.replacementValue {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -568,79 +729,64 @@ extension Blaze_InvocationPolicy_AllowValues: SwiftProtobuf.Message, SwiftProtob 4: .standard(proto: "use_default"), ] - fileprivate class _StorageClass { - var _allowedValues: [String] = [] - var _replacementValue: Blaze_InvocationPolicy_AllowValues.OneOf_ReplacementValue? - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _allowedValues = source._allowedValues - _replacementValue = source._replacementValue - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - switch fieldNumber { - case 1: try decoder.decodeRepeatedStringField(value: &_storage._allowedValues) - case 3: - if _storage._replacementValue != nil {try decoder.handleConflictingOneOf()} - var v: String? - try decoder.decodeSingularStringField(value: &v) - if let v = v {_storage._replacementValue = .newValue(v)} - case 4: - var v: Blaze_InvocationPolicy_UseDefault? - if let current = _storage._replacementValue { - try decoder.handleConflictingOneOf() - if case .useDefault(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v {_storage._replacementValue = .useDefault(v)} - default: break + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedStringField(value: &self.allowedValues) }() + case 3: try { + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v { + if self.replacementValue != nil {try decoder.handleConflictingOneOf()} + self.replacementValue = .newValue(v) + } + }() + case 4: try { + var v: Blaze_InvocationPolicy_UseDefault? + var hadOneofValue = false + if let current = self.replacementValue { + hadOneofValue = true + if case .useDefault(let m) = current {v = m} } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.replacementValue = .useDefault(v) + } + }() + default: break } } } public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if !_storage._allowedValues.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._allowedValues, fieldNumber: 1) - } - switch _storage._replacementValue { - case .newValue(let v)?: - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - case .useDefault(let v)?: - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - case nil: break - } + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.allowedValues.isEmpty { + try visitor.visitRepeatedStringField(value: self.allowedValues, fieldNumber: 1) + } + switch self.replacementValue { + case .newValue?: try { + guard case .newValue(let v)? = self.replacementValue else { preconditionFailure() } + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + }() + case .useDefault?: try { + guard case .useDefault(let v)? = self.replacementValue else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + }() + case nil: break } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Blaze_InvocationPolicy_AllowValues, rhs: Blaze_InvocationPolicy_AllowValues) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._allowedValues != rhs_storage._allowedValues {return false} - if _storage._replacementValue != rhs_storage._replacementValue {return false} - return true - } - if !storagesAreEqual {return false} - } + if lhs.allowedValues != rhs.allowedValues {return false} + if lhs.replacementValue != rhs.replacementValue {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/option_filters.pb.swift b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/option_filters.pb.swift old mode 100755 new mode 100644 index ce267d7..2c14f3b --- a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/option_filters.pb.swift +++ b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/option_filters.pb.swift @@ -1,4 +1,5 @@ // DO NOT EDIT. +// swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: src/main/protobuf/option_filters.proto @@ -6,22 +7,41 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ +/// Copyright 2017 The Bazel Authors. All rights reserved. +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. + import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that your are building against the same version of the API +// Please ensure that you are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } +/// Docs in java enum. public enum Options_OptionEffectTag: SwiftProtobuf.Enum { public typealias RawValue = Int + + /// This option's effect or intent is unknown. case unknown // = 0 + + /// This flag has literally no effect. case noOp // = 1 case losesIncrementalState // = 2 case changesInputs // = 3 @@ -111,6 +131,7 @@ extension Options_OptionEffectTag: CaseIterable { #endif // swift(>=4.2) +/// Docs in java enum. public enum Options_OptionMetadataTag: SwiftProtobuf.Enum { public typealias RawValue = Int case experimental // = 0 From 8233a8909e5ccb3d34107958ce2a0bb113cb81b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 18:37:30 -0500 Subject: [PATCH 04/30] added completed tasks logic --- .../Sources/BazelBuild.swift | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift index 8a1b641..64454cc 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift @@ -50,6 +50,8 @@ final class BazelBuild { private var buildProgress: Double = -1.0 private var initialActionCount: Int = 0 + private var totalActions: Int = 0 + private var completedActions: Int = 0 private let bazelTargets: [(target: Target, label: String, xcodeLabel: String)] private let nonBazelTargets: [Target] @@ -418,10 +420,11 @@ final class BazelBuild { let actualTargetPatterns = actualLabels.joined(separator: " ") buildContext.planningStarted() - buildContext.progressUpdate("Building with Bazel", percentComplete: -1.0, showInLog: true) + buildContext.progressUpdate("Building with Bazel", completedTasks: "", percentComplete: -1.0, showInLog: true) if !bazelTargets.isEmpty { buildContext.progressUpdate( - "Preparing build for \(actualLabels.count == 1 ? "label" : "labels"): \(actualTargetPatterns)", + "Preparing build for: \(actualTargetPatterns)", + completedTasks: "", percentComplete: -1.0, showInLog: true ) @@ -444,6 +447,7 @@ final class BazelBuild { if uniquedActions { buildContext.progressUpdate( "Actually building \(uniqueActualLabels.count == 1 ? "label" : "labels"): \(uniqueActualLabels.joined(separator: " "))", + completedTasks: "", percentComplete: -1.0, showInLog: true ) @@ -519,6 +523,7 @@ final class BazelBuild { if bazelTargets.count > 1 { buildContext.progressUpdate( "Determining unique targets", + completedTasks: "", percentComplete: -1.0, showInLog: true ) @@ -616,6 +621,8 @@ final class BazelBuild { let completedActions = Int(completedActionsString), let totalActions = Int(totalActionsString) { + self.totalActions = totalActions + self.completedActions = completedActions if self.initialActionCount == 0, completedActions > 0, completedActions != totalActions { self.initialActionCount = completedActions } @@ -634,7 +641,7 @@ final class BazelBuild { // Take the last message in the case of multiple lines, as well as the most recent `buildProgress` if let message = progressMessage { - buildContext.progressUpdate(message, percentComplete: self.buildProgress) + buildContext.progressUpdate(message, completedTasks: "\(self.completedActions)/\(self.totalActions)", percentComplete: self.buildProgress) } }, terminationHandler: { [buildContext, bazelTargets] exitCode, cancelled in @@ -683,11 +690,11 @@ private extension BuildContext where ResponsePayload == BazelXCBBuildServiceResp sendResponseMessage(BuildOperationReportPathMap()) } - func progressUpdate(_ message: String, percentComplete: Double, showInLog: Bool = false) { + func progressUpdate(_ message: String, completedTasks: String, percentComplete: Double, showInLog: Bool = false) { sendResponseMessage( BuildOperationProgressUpdated( - targetName: nil, statusMessage: message, + completedTasks: completedTasks, percentComplete: percentComplete, showInLog: showInLog ) From db963c32e42792dc9294c93fbb133e40e8d7142a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 18:37:49 -0500 Subject: [PATCH 05/30] deleted symlink --- .../Build Operation/BuildOperationProgressUpdated.swift | 1 - 1 file changed, 1 deletion(-) delete mode 120000 Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift diff --git a/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift b/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift deleted file mode 120000 index ae579f2..0000000 --- a/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift +++ /dev/null @@ -1 +0,0 @@ -../../XCBProtocol_11_4/Build Operation/BuildOperationProgressUpdated.swift \ No newline at end of file From 034f134327ef854e6d00a2ef0c468202b1ceff27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 18:38:08 -0500 Subject: [PATCH 06/30] new progress update for xcode 13 --- .../BuildOperationProgressUpdated.swift | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift diff --git a/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift b/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift new file mode 100644 index 0000000..843f2d0 --- /dev/null +++ b/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift @@ -0,0 +1,49 @@ +import Foundation +import MessagePack +import XCBProtocol + +public struct BuildOperationProgressUpdated { + public let statusMessage: String + public let completedTasks: String // Should be in the format 1/10 + public let percentComplete: Double + public let showInLog: Bool + + public init(statusMessage: String, completedTasks: String, percentComplete: Double, showInLog: Bool) { + self.statusMessage = statusMessage + self.completedTasks = completedTasks + self.percentComplete = percentComplete + self.showInLog = showInLog + } +} + +// MARK: - ResponsePayloadConvertible + +extension BuildOperationProgressUpdated: ResponsePayloadConvertible { + public func toResponsePayload() -> ResponsePayload { .buildOperationProgressUpdated(self) } +} + +// MARK: - Decoding + +extension BuildOperationProgressUpdated: DecodableRPCPayload { + public init(args: [MessagePackValue], indexPath: IndexPath) throws { + guard args.count == 4 else { throw RPCPayloadDecodingError.invalidCount(args.count, indexPath: indexPath) } + + self.statusMessage = try args.parseString(indexPath: indexPath + IndexPath(index: 0)) + self.completedTasks = try args.parseString(indexPath: indexPath + IndexPath(index: 1)) + self.percentComplete = try args.parseDouble(indexPath: indexPath + IndexPath(index: 2)) + self.showInLog = try args.parseBool(indexPath: indexPath + IndexPath(index: 3)) + } +} + +// MARK: - Encoding + +extension BuildOperationProgressUpdated: EncodableRPCPayload { + public func encode() -> [MessagePackValue] { + return [ + .string(statusMessage), + .string(completedTasks), + .double(percentComplete), + .bool(showInLog), + ] + } +} From 9d8bc2fb36fa2e2b44981b35c76eb604ca32e889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 19:14:29 -0500 Subject: [PATCH 07/30] commented targtes --- Examples/BazelXCBBuildService/Sources/BazelBuild.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift index 64454cc..64ed95b 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift @@ -103,9 +103,13 @@ final class BazelBuild { default: self.buildProcess = BazelClient() - (self.bazelTargets, self.nonBazelTargets) = targets.bazelTargets( - for: buildRequest.parameters.configuration - ) + //RAPPI: Override of targets since we only have one + self.bazelTargets = targets.map { ($0, $0.name, "") } + self.nonBazelTargets = [] + //RAPPI: Kept original implementation +// (self.bazelTargets, self.nonBazelTargets) = targets.bazelTargets( +// for: buildRequest.parameters.configuration +// ) } } From 344c832424b1d2fd60018ac114f2784c0eb9de21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 19:14:48 -0500 Subject: [PATCH 08/30] commented command line not needed --- .../Sources/BazelBuild.swift | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift index 64ed95b..3ad071b 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift @@ -478,23 +478,26 @@ final class BazelBuild { let sdkRoot = "\(platformDeveloperDir)/SDKs/\(parameters.activeRunDestination.sdkVariant)" //TODO: .directoryName let configuration = parameters.configuration - let commandLineString = startProcessHandler( - uniqueBazelTargets.map(\.xcodeLabel).joined(separator: " "), - workingDirectory, - installTarget.flatMap { - Self.generateEnvironment( - baseEnvironment: baseEnvironment, - buildRequest: buildRequest, - xcodeBuildVersion: xcodeBuildVersion, - developerDir: developerDir, - platformDir: platformDir, - platformDeveloperDir: platformDeveloperDir, - sdkRoot: sdkRoot, - target: $0 - ) - } ?? baseEnvironment - ) + let commandLineString = "" + //RAPPI: No need to run bazel shell since we are calling it in Xcode +// let commandLineString = startProcessHandler( +// uniqueBazelTargets.map(\.xcodeLabel).joined(separator: " "), +// workingDirectory, +// installTarget.flatMap { +// Self.generateEnvironment( +// baseEnvironment: baseEnvironment, +// buildRequest: buildRequest, +// xcodeBuildVersion: xcodeBuildVersion, +// developerDir: developerDir, +// platformDir: platformDir, +// platformDeveloperDir: platformDeveloperDir, +// sdkRoot: sdkRoot, +// target: $0 +// ) +// } ?? baseEnvironment +// ) + if let installTarget = installTarget { buildContext.targetStarted( id: 0, From c6ddd29a3609cd978118a05d89b3a345b7a0e2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 19:15:13 -0500 Subject: [PATCH 09/30] enbled logs --- .../BazelXCBBuildService/Sources/BazelBuild.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift index 3ad071b..334b35a 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift @@ -601,10 +601,18 @@ final class BazelBuild { }, bepHandler: { [buildContext] event in var progressMessage: String? + event.progress.stdout.split(separator: "\n").forEach { message in + guard !message.isEmpty else { return } + + let message = String(message) + logger.info("message out: \(message)") + } + event.progress.stderr.split(separator: "\n").forEach { message in guard !message.isEmpty else { return } let message = String(message) + logger.info("message err: \(message)") if let match = Self.progressRegex.firstMatch( @@ -646,9 +654,13 @@ final class BazelBuild { self.buildProgress = 100 } + logger.info("Rappi - progressMessage: \(progressMessage) object: \(self)") + // Take the last message in the case of multiple lines, as well as the most recent `buildProgress` if let message = progressMessage { - buildContext.progressUpdate(message, completedTasks: "\(self.completedActions)/\(self.totalActions)", percentComplete: self.buildProgress) + logger.info("Progress: \(self.buildProgress)") + buildContext.progressUpdate(message, completedTasks: "\(self.completedActions)/\(self.totalActions)", percentComplete: self.buildProgress, showInLog: true) +// buildContext.progressUpdate("Some", completedTasks: "1/10", percentComplete: 10, showInLog: true) } }, terminationHandler: { [buildContext, bazelTargets] exitCode, cancelled in From aee16b906430700b2f0800649cac854805a88a25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 19:15:32 -0500 Subject: [PATCH 10/30] modification to use another bep file --- .../BazelXCBBuildService/Sources/BazelBuildProcess.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift b/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift index c44b5ce..70dea86 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift @@ -43,9 +43,11 @@ final class BazelClient: BazelBuildProcess { private let bepPath: String init() { - self.bepPath = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true) - .appendingPathComponent(ProcessInfo().globallyUniqueString).path - + //RAPPI: We use the same BEP path as XCBuildKit since it was first implemented in Rappi + self.bepPath = "/tmp/bep.bep" +// self.bepPath = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true) +// .appendingPathComponent(ProcessInfo().globallyUniqueString).path + print("BEP Path: \(self.bepPath)") self.process = Process() // Automatically terminate process if our process exits From abd5793579ba21e69bdc2002528405d29b64744d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 19:16:12 -0500 Subject: [PATCH 11/30] commented implementation that runs bazel --- .../Sources/BazelBuildProcess.swift | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift b/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift index 70dea86..6fd0686 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift @@ -211,32 +211,34 @@ final class BazelClient: BazelBuildProcess { ) }, { [process, bepPath] finalTargetPatterns, workingDirectory, environment in - var environment = environment - environment["NBS_BEP_PATH"] = bepPath - - process.launchPath = "/bin/bash" - process.currentDirectoryPath = workingDirectory - process.environment = environment - process.arguments = [ - "-c", - "bazel/xcode.sh nbs \(finalTargetPatterns)", - ] - - let command = "\(process.launchPath!) \(process.arguments!.joined(separator: " "))" - logger.info("Starting Bazel with command: \(command)") - - process.launch() - - return """ - cd \(process.currentDirectoryPath) - \( - (process.environment ?? [:]) - .sorted { $0.key < $1.key } - .map { "export \($0)=\($1.exportQuoted)" } - .joined(separator: "\n") - ) - \(command) - """ + //RAPPI: We handle our own Bazel build process + return "" +// var environment = environment +// environment["NBS_BEP_PATH"] = bepPath +// +// process.launchPath = "/bin/bash" +// process.currentDirectoryPath = workingDirectory +// process.environment = environment +// process.arguments = [ +// "-c", +// "bazel/xcode.sh nbs \(finalTargetPatterns)", +// ] +// +// let command = "\(process.launchPath!) \(process.arguments!.joined(separator: " "))" +// logger.info("Starting Bazel with command: \(command)") +// +// process.launch() +// +// return """ +// cd \(process.currentDirectoryPath) +// \( +// (process.environment ?? [:]) +// .sorted { $0.key < $1.key } +// .map { "export \($0)=\($1.exportQuoted)" } +// .joined(separator: "\n") +// ) +// \(command) +// """ } ) } From d2e7786f7732a0e242cee4376a125919deb5131a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 19:16:38 -0500 Subject: [PATCH 12/30] improved log --- Examples/BazelXCBBuildService/Sources/RequestHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index d004e1a..78ceabf 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -147,7 +147,7 @@ final class RequestHandler: HybridXCBBuildServiceRequestHandler { sessionBazelBuilds[session] = nil handleBazelTargets(session: session) { baseEnvironment, bazelTargets, xcodeBuildVersion in - logger.trace("Parsed targets for BazelXCBBuildService: \(bazelTargets)") + logger.trace("Parsed targets for BazelXCBBuildService: \(bazelTargets.map { $1.name })") var desiredTargets: [BazelBuild.Target] = [] for target in message.buildRequest.configuredTargets { From d2ba9e652984c7ba8eac14758b99e645a937c6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 19:17:15 -0500 Subject: [PATCH 13/30] commented validations --- .../Sources/RequestHandler.swift | 60 +++++++++++-------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index 78ceabf..899fb40 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -149,35 +149,45 @@ final class RequestHandler: HybridXCBBuildServiceRequestHandler { handleBazelTargets(session: session) { baseEnvironment, bazelTargets, xcodeBuildVersion in logger.trace("Parsed targets for BazelXCBBuildService: \(bazelTargets.map { $1.name })") - var desiredTargets: [BazelBuild.Target] = [] - for target in message.buildRequest.configuredTargets { - let guid = target.guid - - guard var bazelTarget = bazelTargets[guid] else { - context.sendErrorResponse( - "[\(session)] Parsed target not found for GUID “\(guid)”", - request: request - ) - return - } - - // TODO: Do this check after uniquing targets, to allow excluding of "Testing" modules as well - guard !BazelBuild.shouldSkipTarget(bazelTarget, buildRequest: message.buildRequest) else { - logger.info("Skipping target for Bazel build: \(bazelTarget.name)") - continue - } - - bazelTarget.parameters = target.parameters - - desiredTargets.append(bazelTarget) - } +// var desiredTargets: [BazelBuild.Target] = [] +// for target in message.buildRequest.configuredTargets { +// let guid = target.guid +// +// guard var bazelTarget = bazelTargets[guid] else { +// //RAPPI: Don't send the error since only Bazel target will use it +// continue +//// context.sendErrorResponse( +//// "[\(session)] Parsed target not found for GUID “\(guid)”", +//// request: request +//// ) +//// return +// } +// +// // TODO: Do this check after uniquing targets, to allow excluding of "Testing" modules as well +// guard !BazelBuild.shouldSkipTarget(bazelTarget, buildRequest: message.buildRequest) else { +// logger.info("Skipping target for Bazel build: \(bazelTarget.name)") +// continue +// } +// +// bazelTarget.parameters = target.parameters +// +// desiredTargets.append(bazelTarget) +// } - guard BazelBuild.shouldBuild(targets: desiredTargets, buildRequest: message.buildRequest) else { - // There were no bazel based targets, so we will build normally + //RAPPI: Couldnt get Bazel target, continuing normal flow + guard bazelTargets.contains(where: { $0.value.name == "Bazel" }) else { +// guard !desiredTargets.isEmpty else { context.forwardRequest() return } + //RAPPI: Commented original implementation for sync purposes +// guard BazelBuild.shouldBuild(targets: desiredTargets, buildRequest: message.buildRequest) else { +// // There were no bazel based targets, so we will build normally +// context.forwardRequest() +// return +// } + self.lastBazelBuildNumber -= 1 let buildNumber = self.lastBazelBuildNumber @@ -195,7 +205,7 @@ final class RequestHandler: HybridXCBBuildServiceRequestHandler { xcodeBuildVersion: xcodeBuildVersion, developerDir: baseEnvironment["DEVELOPER_DIR"]!, buildRequest: message.buildRequest, - targets: desiredTargets + targets: Array(bazelTargets.values) ) self.sessionBazelBuilds[session] = build From 74c7737cb3956c39afa934b734bcb05618844e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 19:17:31 -0500 Subject: [PATCH 14/30] new rappi promise --- .../Sources/RequestHandler.swift | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index 899fb40..e5cb73c 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -299,20 +299,26 @@ extension RequestHandler { context: Context, workspacePIFFuture: EventLoopFuture ) -> EventLoopFuture { - return workspacePIFFuture.flatMap { [fileIO] pif in - let path = "\(pif.path)/xcshareddata/BazelXCBBuildServiceSettings.plist" - return fileIO.openFile(path: path, eventLoop: context.eventLoop) - .map { fileHandle, _ in - // Close the file, we just wanted to ensure it exists for now - // Later we might read the contents - try? fileHandle.close() - logger.debug("“\(path)” found. Building with Bazel.") - return true - }.recover { error in - logger.debug("“\(path)” could not be opened (\(error)). Not building with Bazel.") - return false - } - } + //RAPPI: By default every project will be enabled, it will be filtered by the targets instead + let promise = context.eventLoop.makePromise(of: Bool.self) + promise.succeed(true) + return promise.futureResult + //RAPPI: Keeped original solution for merge/sync facilities + +// return workspacePIFFuture.flatMap { [fileIO] pif in +// let path = "\(pif.path)/xcshareddata/BazelXCBBuildServiceSettings.plist" +// return fileIO.openFile(path: path, eventLoop: context.eventLoop) +// .map { fileHandle, _ in +// // Close the file, we just wanted to ensure it exists for now +// // Later we might read the contents +// try? fileHandle.close() +// logger.debug("“\(path)” found. Building with Bazel.") +// return true +// }.recover { error in +// logger.debug("“\(path)” could not be opened (\(error)). Not building with Bazel.") +// return false +// } +// } } /// - Returns: parsed projects or an error, if we should build with Bazel, or `nil` if we shouldn't. From 940d754323b9e9eaedd052d2e8de99be57e14be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 19:17:41 -0500 Subject: [PATCH 15/30] enables only bazel target --- Examples/BazelXCBBuildService/Sources/RequestHandler.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index e5cb73c..e35fc8a 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -358,7 +358,10 @@ extension RequestHandler { }.flatMap { futures in EventLoopFuture.reduce(into: [:], futures, on: context.eventLoop) { targetMappings, projectTargets in for case let projectTarget in projectTargets { - targetMappings[projectTarget.xcodeGUID] = projectTarget + //RAPPI: We only need Bazel target since everything is wrapped in it + if projectTarget.name == "Bazel" { + targetMappings[projectTarget.xcodeGUID] = projectTarget + } } } }.map { .some($0) } From d970844ea0de576c9a4cfddaa1bf162162322e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 19:17:47 -0500 Subject: [PATCH 16/30] added log --- Examples/BazelXCBBuildService/Sources/RequestHandler.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index e35fc8a..f58eb6c 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -191,6 +191,8 @@ final class RequestHandler: HybridXCBBuildServiceRequestHandler { self.lastBazelBuildNumber -= 1 let buildNumber = self.lastBazelBuildNumber + logger.info("Rappi - message.responseChannel: \(message.responseChannel) build command: \(message.buildRequest.buildCommand)") + let buildContext = BuildContext( sendResponse: context.sendResponse, session: session, From f5f989dca506b944518fa7ecde56c77a6955bdd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 19:20:09 -0500 Subject: [PATCH 17/30] added validations --- Examples/BazelXCBBuildService/Sources/RequestHandler.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index d004e1a..db1b5c5 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -144,8 +144,11 @@ final class RequestHandler: HybridXCBBuildServiceRequestHandler { let session = message.sessionHandle // Reset in case we decide not to build + sessionBazelBuilds[session]?.cancel() sessionBazelBuilds[session] = nil + guard message.buildRequest.buildCommand.command == .build else { return } + handleBazelTargets(session: session) { baseEnvironment, bazelTargets, xcodeBuildVersion in logger.trace("Parsed targets for BazelXCBBuildService: \(bazelTargets)") From d64e54eb4cf404684d8e3946aa08cf7231a08ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Tue, 12 Oct 2021 20:07:46 -0500 Subject: [PATCH 18/30] fixes error where it is stucked by letting pass the right targets --- .../Sources/BazelBuildProcess.swift | 17 +++--- .../Sources/RequestHandler.swift | 52 +++++++++---------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift b/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift index 6fd0686..1cd41a7 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift @@ -202,13 +202,16 @@ final class BazelClient: BazelBuildProcess { startedHandler( { [uniqueTargetsProcess] targetPatterns, workingDirectory, environment, finishStartup in - uniqueTargetsProcess.start( - targetPatterns: targetPatterns, - workingDirectory: workingDirectory, - environment: environment, - errorOutputHandler: outputHandler, - uniqueBuildLabelsHandler: finishStartup - ) + //RAPPI: Our unique target is Bazel dummy target + finishStartup(.success(["Bazel"])) + //RAPPI: Commented for sync purposes +// uniqueTargetsProcess.start( +// targetPatterns: targetPatterns, +// workingDirectory: workingDirectory, +// environment: environment, +// errorOutputHandler: outputHandler, +// uniqueBuildLabelsHandler: finishStartup +// ) }, { [process, bepPath] finalTargetPatterns, workingDirectory, environment in //RAPPI: We handle our own Bazel build process diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index abc8619..e643329 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -152,34 +152,35 @@ final class RequestHandler: HybridXCBBuildServiceRequestHandler { handleBazelTargets(session: session) { baseEnvironment, bazelTargets, xcodeBuildVersion in logger.trace("Parsed targets for BazelXCBBuildService: \(bazelTargets.map { $1.name })") -// var desiredTargets: [BazelBuild.Target] = [] -// for target in message.buildRequest.configuredTargets { -// let guid = target.guid -// -// guard var bazelTarget = bazelTargets[guid] else { -// //RAPPI: Don't send the error since only Bazel target will use it -// continue -//// context.sendErrorResponse( -//// "[\(session)] Parsed target not found for GUID “\(guid)”", -//// request: request -//// ) -//// return -// } -// -// // TODO: Do this check after uniquing targets, to allow excluding of "Testing" modules as well + var desiredTargets: [BazelBuild.Target] = [] + for target in message.buildRequest.configuredTargets { + let guid = target.guid + + guard var bazelTarget = bazelTargets[guid] else { + context.sendErrorResponse( + "[\(session)] Parsed target not found for GUID “\(guid)”", + request: request + ) + return + } + + //RAPPI: Commented for sync purposes + // TODO: Do this check after uniquing targets, to allow excluding of "Testing" modules as well // guard !BazelBuild.shouldSkipTarget(bazelTarget, buildRequest: message.buildRequest) else { // logger.info("Skipping target for Bazel build: \(bazelTarget.name)") // continue // } -// -// bazelTarget.parameters = target.parameters -// -// desiredTargets.append(bazelTarget) -// } + + //RAPPI: Here we will filter bazel target + guard bazelTarget.name == "Bazel" else { continue } + + bazelTarget.parameters = target.parameters + + desiredTargets.append(bazelTarget) + } - //RAPPI: Couldnt get Bazel target, continuing normal flow - guard bazelTargets.contains(where: { $0.value.name == "Bazel" }) else { -// guard !desiredTargets.isEmpty else { + //RAPPI: At this point we will continue only if Bazel target is being compiled + guard !desiredTargets.isEmpty else { context.forwardRequest() return } @@ -363,10 +364,7 @@ extension RequestHandler { }.flatMap { futures in EventLoopFuture.reduce(into: [:], futures, on: context.eventLoop) { targetMappings, projectTargets in for case let projectTarget in projectTargets { - //RAPPI: We only need Bazel target since everything is wrapped in it - if projectTarget.name == "Bazel" { - targetMappings[projectTarget.xcodeGUID] = projectTarget - } + targetMappings[projectTarget.xcodeGUID] = projectTarget } } }.map { .some($0) } From 527d2346547f498efc6daa3276cfdfbdd408c2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Wed, 13 Oct 2021 11:39:18 -0500 Subject: [PATCH 19/30] reverted progress update, this works but it gets stucked building bazel --- Examples/BazelXCBBuildService/Sources/BazelBuild.swift | 8 ++++---- .../BazelXCBBuildService/Sources/RequestHandler.swift | 4 ++-- .../Build Operation/BuildOperationProgressUpdated.swift | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift index 334b35a..278be9e 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift @@ -424,11 +424,11 @@ final class BazelBuild { let actualTargetPatterns = actualLabels.joined(separator: " ") buildContext.planningStarted() - buildContext.progressUpdate("Building with Bazel", completedTasks: "", percentComplete: -1.0, showInLog: true) + buildContext.progressUpdate("Building with Bazel", completedTasks: "1/1", percentComplete: -1.0, showInLog: true) if !bazelTargets.isEmpty { buildContext.progressUpdate( "Preparing build for: \(actualTargetPatterns)", - completedTasks: "", + completedTasks: "1/1", percentComplete: -1.0, showInLog: true ) @@ -451,7 +451,7 @@ final class BazelBuild { if uniquedActions { buildContext.progressUpdate( "Actually building \(uniqueActualLabels.count == 1 ? "label" : "labels"): \(uniqueActualLabels.joined(separator: " "))", - completedTasks: "", + completedTasks: "1/1", percentComplete: -1.0, showInLog: true ) @@ -530,7 +530,7 @@ final class BazelBuild { if bazelTargets.count > 1 { buildContext.progressUpdate( "Determining unique targets", - completedTasks: "", + completedTasks: "1/1", percentComplete: -1.0, showInLog: true ) diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index e643329..1dd187c 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -171,8 +171,8 @@ final class RequestHandler: HybridXCBBuildServiceRequestHandler { // continue // } - //RAPPI: Here we will filter bazel target - guard bazelTarget.name == "Bazel" else { continue } + //RAPPI: Here we will filter Grability target + guard bazelTarget.name == "Grability" else { continue } bazelTarget.parameters = target.parameters diff --git a/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift b/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift index 843f2d0..166e30f 100644 --- a/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift +++ b/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift @@ -28,8 +28,8 @@ extension BuildOperationProgressUpdated: DecodableRPCPayload { public init(args: [MessagePackValue], indexPath: IndexPath) throws { guard args.count == 4 else { throw RPCPayloadDecodingError.invalidCount(args.count, indexPath: indexPath) } - self.statusMessage = try args.parseString(indexPath: indexPath + IndexPath(index: 0)) - self.completedTasks = try args.parseString(indexPath: indexPath + IndexPath(index: 1)) + self.statusMessage = try args.parseString(indexPath: indexPath + IndexPath(index: 1)) + self.completedTasks = try args.parseString(indexPath: indexPath + IndexPath(index: 0)) self.percentComplete = try args.parseDouble(indexPath: indexPath + IndexPath(index: 2)) self.showInLog = try args.parseBool(indexPath: indexPath + IndexPath(index: 3)) } @@ -40,8 +40,8 @@ extension BuildOperationProgressUpdated: DecodableRPCPayload { extension BuildOperationProgressUpdated: EncodableRPCPayload { public func encode() -> [MessagePackValue] { return [ - .string(statusMessage), .string(completedTasks), + .string(statusMessage), .double(percentComplete), .bool(showInLog), ] From b8b4e560f6cf1f4e07583e7482f7ed76fd417d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Wed, 13 Oct 2021 17:24:27 -0500 Subject: [PATCH 20/30] logic for progress --- .../BazelProgressXCBBuildService/BUILD.bazel | 27 ++++ .../Package.resolved | 34 +++++ .../Package.swift | 34 +++++ .../Sources/BazelBuild.swift | 113 +++++++++++++++++ .../Sources/BazelBuildProcess.swift | 120 ++++++++++++++++++ .../Sources/RequestHandler.swift | 59 +++++++++ .../Sources/main.swift | 47 +++++++ Examples/BazelXCBBuildService/Package.swift | 4 + 8 files changed, 438 insertions(+) create mode 100644 Examples/BazelProgressXCBBuildService/BUILD.bazel create mode 100644 Examples/BazelProgressXCBBuildService/Package.resolved create mode 100644 Examples/BazelProgressXCBBuildService/Package.swift create mode 100644 Examples/BazelProgressXCBBuildService/Sources/BazelBuild.swift create mode 100644 Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift create mode 100644 Examples/BazelProgressXCBBuildService/Sources/RequestHandler.swift create mode 100644 Examples/BazelProgressXCBBuildService/Sources/main.swift diff --git a/Examples/BazelProgressXCBBuildService/BUILD.bazel b/Examples/BazelProgressXCBBuildService/BUILD.bazel new file mode 100644 index 0000000..74238cc --- /dev/null +++ b/Examples/BazelProgressXCBBuildService/BUILD.bazel @@ -0,0 +1,27 @@ +load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library", "swift_proto_library") +load("@build_bazel_rules_apple//apple:macos.bzl", "macos_command_line_application") + +swift_proto_library( + name = "build_event_stream_proto", + deps = ["@build_bazel_bazel//src/main/java/com/google/devtools/build/lib/buildeventstream/proto:build_event_stream_proto"], +) + +swift_library( + name = "BazelProgressXCBBuildService.library", + module_name = "BazelProgressXCBBuildService", + srcs = glob(["Sources/**/*.swift"]), + deps = [ + ":build_event_stream_proto", + "@com_github_apple_swift_log//:Logging", + "@com_github_apple_swift_nio//:NIO", + "@com_github_target_xcbbuildserviceproxy//:XCBBuildServiceProxy", + "@com_github_target_xcbbuildserviceproxy//:XCBProtocol", + "@com_github_target_xcbbuildserviceproxy//:XCBProtocol_12_0", + ], +) + +macos_command_line_application( + name = "BazelProgressXCBBuildService", + minimum_os_version = "10.15", + deps = [":BazelProgressXCBBuildService.library"], +) diff --git a/Examples/BazelProgressXCBBuildService/Package.resolved b/Examples/BazelProgressXCBBuildService/Package.resolved new file mode 100644 index 0000000..8cb18f7 --- /dev/null +++ b/Examples/BazelProgressXCBBuildService/Package.resolved @@ -0,0 +1,34 @@ +{ + "object": { + "pins": [ + { + "package": "swift-log", + "repositoryURL": "https://github.com/apple/swift-log.git", + "state": { + "branch": null, + "revision": "5d66f7ba25daf4f94100e7022febf3c75e37a6c7", + "version": "1.4.2" + } + }, + { + "package": "swift-nio", + "repositoryURL": "https://github.com/apple/swift-nio.git", + "state": { + "branch": null, + "revision": "6aa9347d9bc5bbfe6a84983aec955c17ffea96ef", + "version": "2.33.0" + } + }, + { + "package": "SwiftProtobuf", + "repositoryURL": "https://github.com/apple/swift-protobuf.git", + "state": { + "branch": null, + "revision": "7e2c5f3cbbeea68e004915e3a8961e20bd11d824", + "version": "1.18.0" + } + } + ] + }, + "version": 1 +} diff --git a/Examples/BazelProgressXCBBuildService/Package.swift b/Examples/BazelProgressXCBBuildService/Package.swift new file mode 100644 index 0000000..74f9c9e --- /dev/null +++ b/Examples/BazelProgressXCBBuildService/Package.swift @@ -0,0 +1,34 @@ +// swift-tools-version:5.1 + +import PackageDescription + +let package = Package( + name: "BazelProgressXCBBuildService", + platforms: [.macOS(.v10_14)], + products: [ + .executable(name: "BazelProgressXCBBuildService", targets: ["BazelProgressXCBBuildService"]), + ], + dependencies: [ + .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"), + .package(url: "https://github.com/apple/swift-nio.git", from: "2.17.0"), + .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.9.0"), + // XCBBuildServiceProxy lives up two levels from here + .package(path: "../../"), + .package(path: "../BazelXCBBuildService/"), + ], + targets: [ + .target( + name: "BazelProgressXCBBuildService", + dependencies: [ + "src_main_java_com_google_devtools_build_lib_buildeventstream_proto_build_event_stream_proto", + "Logging", + "NIO", + "SwiftProtobuf", + "XCBBuildServiceProxy", + "XCBProtocol", + "XCBProtocol_13_0", + ], + path: "Sources" + ), + ] +) diff --git a/Examples/BazelProgressXCBBuildService/Sources/BazelBuild.swift b/Examples/BazelProgressXCBBuildService/Sources/BazelBuild.swift new file mode 100644 index 0000000..2a063b8 --- /dev/null +++ b/Examples/BazelProgressXCBBuildService/Sources/BazelBuild.swift @@ -0,0 +1,113 @@ +import Foundation +import XCBBuildServiceProxy +import XCBProtocol +@_exported import XCBProtocol_13_0 + +// swiftformat:disable braces + +final class BazelBuild { + + private let buildContext: BuildContext + private let buildProcess: BazelBuildProcess + + private var buildProgress: Double = -1.0 + private var initialActionCount: Int = 0 + private var totalActions: Int = 0 + private var completedActions: Int = 0 + + /// This regex is used to minimally remove the timestamp at the start of our messages. + /// After that we try to parse out the execution progress + /// (see https://github.com/bazelbuild/bazel/blob/9bea69aee3acf18b780b397c8c441ac5715d03ae/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionProgressReceiver.java#L150-L157 ). + /// Finally we throw away any " ... (8 actions running)" like messages (see https://github.com/bazelbuild/bazel/blob/4f0b710e2b935b4249e0bbf633f43628bbf93d7b/src/main/java/com/google/devtools/build/lib/runtime/UiStateTracker.java#L1158 ). + private static let progressRegex = try! NSRegularExpression( + pattern: #"^(?:\(\d{1,2}:\d{1,2}:\d{1,2}\) )?(?:\[(\d{1,3}(,\d{3})*) \/ (\d{1,3}(,\d{3})*)\] )?(?:(?:INFO|ERROR|WARNING): )?(.*?)(?: \.\.\. \(.*\))?$"# + ) + + init(buildContext: BuildContext) throws { + self.buildContext = buildContext + self.buildProcess = BazelClient() + } + + func start() throws { + try buildProcess.start( + bepHandler: { [buildContext] event in + var progressMessage: String? + event.progress.stdout.split(separator: "\n").forEach { message in + guard !message.isEmpty else { return } + + let message = String(message) + logger.info("message out: \(message)") + } + + event.progress.stderr.split(separator: "\n").forEach { message in + guard !message.isEmpty else { return } + + let message = String(message) + logger.info("message err: \(message)") + + if + let match = Self.progressRegex.firstMatch( + in: message, + options: [], + range: NSRange(message.startIndex ..< message.endIndex, in: message) + ), + match.numberOfRanges == 6, + let finalMessageRange = Range(match.range(at: 5), in: message), + let completedActionsRange = Range(match.range(at: 1), in: message), + let totalActionsRange = Range(match.range(at: 3), in: message) + { + progressMessage = String(message[finalMessageRange]) + + let completedActionsString = message[completedActionsRange] + .replacingOccurrences(of: ",", with: "") + let totalActionsString = message[totalActionsRange] + .replacingOccurrences(of: ",", with: "") + + if + let completedActions = Int(completedActionsString), + let totalActions = Int(totalActionsString) + { + self.totalActions = totalActions + self.completedActions = completedActions + if self.initialActionCount == 0, completedActions > 0, completedActions != totalActions { + self.initialActionCount = completedActions + } + + self.buildProgress = 100 * Double(completedActions - self.initialActionCount) / Double(totalActions - self.initialActionCount) + } else { + logger.error("Failed to parse progress out of BEP message: \(message)") + } + } + } + + if event.lastMessage { + progressMessage = progressMessage ?? "Compilation complete" + self.buildProgress = 100 + } + + // Take the last message in the case of multiple lines, as well as the most recent `buildProgress` + if let message = progressMessage { + buildContext.progressUpdate(message, completedTasks: "\(self.completedActions)/\(self.totalActions)", percentComplete: self.buildProgress) + } + } + ) + } + + func cancel() { + buildProcess.stop() + } +} + + +private extension BuildContext where ResponsePayload == BazelXCBBuildServiceResponsePayload { + func progressUpdate(_ message: String, completedTasks: String, percentComplete: Double, showInLog: Bool = false) { + sendResponseMessage( + BuildOperationProgressUpdated( + statusMessage: message, + completedTasks: completedTasks, + percentComplete: percentComplete, + showInLog: showInLog + ) + ) + } +} diff --git a/Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift b/Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift new file mode 100644 index 0000000..0748d9c --- /dev/null +++ b/Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift @@ -0,0 +1,120 @@ +import Foundation +import src_main_java_com_google_devtools_build_lib_buildeventstream_proto_build_event_stream_proto +import SwiftProtobuf + +protocol BazelBuildProcess { + func start(bepHandler: @escaping (BuildEventStream_BuildEvent) -> Void) throws + func stop() +} + +enum BazelBuildProcessError: Error { + case alreadyStarted + case failedToCreateBEPFile +} + +/// Encapsulates a child Bazel script process. +final class BazelClient: BazelBuildProcess { + /// Queue used to ensure proper ordering of results from process output/termination. + private let processResultsQueue = DispatchQueue( + label: "BazelXCBBuildService.BazelBuildProcess", + qos: .userInitiated + ) + + private var isRunning = false + private var isCancelled = false + private let bepPath: String + + init() { + //RAPPI: We use the same BEP path as XCBuildKit + self.bepPath = "/tmp/bep.bep" + print("BEP Path: \(self.bepPath)") + } + + func start(bepHandler: @escaping (BuildEventStream_BuildEvent) -> Void) throws { + guard !isRunning else { + throw BazelBuildProcessError.alreadyStarted + } + isRunning = true + + let fileManager = FileManager.default + + fileManager.createFile(atPath: bepPath, contents: Data()) + guard let bepFileHandle = FileHandle(forReadingAtPath: bepPath) else { + logger.error("Failed to create file for BEP stream at “\(bepPath)”") + throw BazelBuildProcessError.failedToCreateBEPFile + } + + /// Dispatch group used to ensure that stdout and stderr are processed before the process termination. + /// This is needed since all three notifications come in on different threads. + let processDispatchGroup = DispatchGroup() + + /// `true` if the `terminationHandler` has been called. Xcode will crash if we send more events after that. + var isTerminated = false + + // Bazel works by appending content to a file, specifically, Java's `BufferedOutputStream`. + // Naively using an input stream for the path and waiting for available data simply does not work with + // whatever `BufferedOutputStream.flush()` is doing internally. + // + // Reference: + // https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/FileTransport.java + // + // Perhaps, SwiftProtobuf can come up with a better solution to read from files or upstream similar code: + // https://github.com/apple/swift-protobuf/issues/130 + // + // Logic: + // - Create a few file + // - When the build starts, Bazel will attempt to reuse the inode, and stream to it + // - Then, via `FileHandle`, wait for data to be available and read all the bytes + bepFileHandle.readabilityHandler = { [processResultsQueue] _ in + // `bepFileHandle` is captured in the closure, which keeps the reference around + let data = bepFileHandle.availableData + guard !data.isEmpty else { + return + } + + processDispatchGroup.enter() + processResultsQueue.async { + defer { processDispatchGroup.leave() } + + // We don't want to report any more progress if the build has been terminated + guard !isTerminated else { + bepFileHandle.closeFile() + bepFileHandle.readabilityHandler = nil + return + } + + // Wrap the file handle in an `InputStream` for SwiftProtobuf to read + // We read the stream until the (current) end of the file + let input = InputStream(data: data) + input.open() + while input.hasBytesAvailable { + do { + let event = try BinaryDelimited.parse(messageType: BuildEventStream_BuildEvent.self, from: input) + + logger.trace("Received BEP event: \(event)") + + bepHandler(event) + + if event.lastMessage { + logger.trace("Received last BEP event") + + bepFileHandle.closeFile() + bepFileHandle.readabilityHandler = nil + } + } catch { + logger.error("Failed to parse BEP event: \(error)") + return + } + } + } + } + + processDispatchGroup.notify(queue: processResultsQueue) { + isTerminated = true + } + } + + func stop() { + isCancelled = true + } +} diff --git a/Examples/BazelProgressXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelProgressXCBBuildService/Sources/RequestHandler.swift new file mode 100644 index 0000000..9d5d458 --- /dev/null +++ b/Examples/BazelProgressXCBBuildService/Sources/RequestHandler.swift @@ -0,0 +1,59 @@ +import Foundation +import Logging +import NIO +import XCBBuildServiceProxy +import XCBProtocol + +@_exported import XCBProtocol_13_0 +typealias BazelXCBBuildServiceRequestPayload = XCBProtocol_13_0.RequestPayload +typealias BazelXCBBuildServiceResponsePayload = XCBProtocol_13_0.ResponsePayload + +final class RequestHandler: HybridXCBBuildServiceRequestHandler { + typealias Context = HybridXCBBuildServiceRequestHandlerContext + + private typealias SessionHandle = String + private var sessionBazelBuilds: [SessionHandle: BazelBuild] = [:] + + func handleRequest(_ request: RPCRequest, context: Context) { + defer { + // We are injecting Bazel progress but the build is still in charge of the original XCBBuildService + context.forwardRequest() + } + + switch request.payload { + case let .createBuildRequest(message): + // Only showing progress of build command + guard message.buildRequest.buildCommand.command == .build else { return } + let session = message.sessionHandle + // Reset in case we decide not to build + sessionBazelBuilds[session]?.cancel() + sessionBazelBuilds[session] = nil + + logger.info("Response channel: \(message.responseChannel)") + + let buildContext = BuildContext( + sendResponse: context.sendResponse, + session: session, + buildNumber: -1, // Fixed build number since we are not compiling + responseChannel: message.responseChannel + ) + + do { + self.sessionBazelBuilds[session] = try BazelBuild(buildContext: buildContext) + } catch { + context.sendErrorResponse(error, session: session, request: request) + } + case let .buildStartRequest(message): + let session = message.sessionHandle + guard let build = sessionBazelBuilds[session] else { return } + do { + try build.start() + } catch { + context.sendErrorResponse(error, session: session, request: request) + } + case let .buildCancelRequest(message): + sessionBazelBuilds[message.sessionHandle]?.cancel() + default: break + } + } +} diff --git a/Examples/BazelProgressXCBBuildService/Sources/main.swift b/Examples/BazelProgressXCBBuildService/Sources/main.swift new file mode 100644 index 0000000..03b23d9 --- /dev/null +++ b/Examples/BazelProgressXCBBuildService/Sources/main.swift @@ -0,0 +1,47 @@ +import Foundation +import Logging +import NIO +import XCBBuildServiceProxy + +LoggingSystem.bootstrap { label in + var handler = StreamLogHandler.standardError(label: label) + + let logLevel: Logger.Level + switch ProcessInfo.processInfo.environment["BAZELXCBBUILDSERVICE_LOGLEVEL"]?.lowercased() { + case "debug": logLevel = .debug + case "trace": logLevel = .trace + default: logLevel = .info + } + + handler.logLevel = logLevel + return handler +} + +let logger = Logger(label: "BazelXCBBuildService") + +let group = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount) + +let threadPool = NIOThreadPool(numberOfThreads: System.coreCount) +threadPool.start() + +let fileIO = NonBlockingFileIO(threadPool: threadPool) + +do { + let service = try HybridXCBBuildService( + name: "BazelXCBBuildService", + group: group, + fileIO: fileIO, + requestHandler: RequestHandler() + ) + + do { + let channel = try service.start() + try channel.closeFuture.wait() + } catch { + logger.error("\(error)") + } + + service.stop() +} catch { + logger.critical("\(error)") +} diff --git a/Examples/BazelXCBBuildService/Package.swift b/Examples/BazelXCBBuildService/Package.swift index a97dd75..ce6dab6 100644 --- a/Examples/BazelXCBBuildService/Package.swift +++ b/Examples/BazelXCBBuildService/Package.swift @@ -7,6 +7,10 @@ let package = Package( platforms: [.macOS(.v10_14)], products: [ .executable(name: "BazelXCBBuildService", targets: ["BazelXCBBuildService"]), + .library( + name: "src_main_java_com_google_devtools_build_lib_buildeventstream_proto_build_event_stream_proto", + targets: ["src_main_java_com_google_devtools_build_lib_buildeventstream_proto_build_event_stream_proto"] + ) ], dependencies: [ .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"), From b893339e7ad41faf392a163f390371a4a7d7c6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Wed, 13 Oct 2021 18:16:23 -0500 Subject: [PATCH 21/30] reverts process code --- .../Sources/BazelBuildProcess.swift | 60 ++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift b/Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift index 0748d9c..61a20aa 100644 --- a/Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift +++ b/Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift @@ -22,19 +22,26 @@ final class BazelClient: BazelBuildProcess { private var isRunning = false private var isCancelled = false + private let process: Process private let bepPath: String init() { //RAPPI: We use the same BEP path as XCBuildKit self.bepPath = "/tmp/bep.bep" print("BEP Path: \(self.bepPath)") + self.process = Process() + + // Automatically terminate process if our process exits + let selector = Selector(("setStartsNewProcessGroup:")) + if process.responds(to: selector) { + process.perform(selector, with: false as NSNumber) + } } func start(bepHandler: @escaping (BuildEventStream_BuildEvent) -> Void) throws { - guard !isRunning else { + guard !process.isRunning else { throw BazelBuildProcessError.alreadyStarted } - isRunning = true let fileManager = FileManager.default @@ -109,12 +116,61 @@ final class BazelClient: BazelBuildProcess { } } + let stdout = Pipe() + let stderr = Pipe() + + processDispatchGroup.enter() + stdout.fileHandleForReading.readabilityHandler = { [processResultsQueue] handle in + let data = handle.availableData + guard !data.isEmpty else { + logger.trace("Received Bazel standard output EOF") + stdout.fileHandleForReading.readabilityHandler = nil + processDispatchGroup.leave() + + return + } + + processResultsQueue.async { + logger.trace("Received Bazel standard output: \(data)") + } + } + + processDispatchGroup.enter() + stderr.fileHandleForReading.readabilityHandler = { [processResultsQueue] handle in + let data = handle.availableData + guard !data.isEmpty else { + logger.trace("Received Bazel standard error EOF") + stderr.fileHandleForReading.readabilityHandler = nil + processDispatchGroup.leave() + return + } + + processResultsQueue.async { + logger.trace("Received Bazel standard error: \(data)") + } + } + + process.standardOutput = stdout + process.standardError = stderr + + processDispatchGroup.enter() + process.terminationHandler = { process in + logger.debug("xcode.sh exited with status code: \(process.terminationStatus)") + processDispatchGroup.leave() + } + + processDispatchGroup.notify(queue: processResultsQueue) { + logger.info("\(self.isCancelled ? "Cancelled Bazel" : "Bazel") build exited with status code: \(self.process.terminationStatus)") isTerminated = true } } func stop() { isCancelled = true + if process.isRunning { + // Sends SIGTERM to the Bazel client. It will cleanup and exit. + process.terminate() + } } } From 97b558b2b978a8868b7a4f1978f97ec9169e4bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Wed, 13 Oct 2021 18:37:28 -0500 Subject: [PATCH 22/30] changes --- .../Sources/BazelBuildProcess.swift | 1 - .../Build Operation/BuildOperationProgressUpdated.swift | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift b/Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift index 61a20aa..9b98c05 100644 --- a/Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift +++ b/Examples/BazelProgressXCBBuildService/Sources/BazelBuildProcess.swift @@ -159,7 +159,6 @@ final class BazelClient: BazelBuildProcess { processDispatchGroup.leave() } - processDispatchGroup.notify(queue: processResultsQueue) { logger.info("\(self.isCancelled ? "Cancelled Bazel" : "Bazel") build exited with status code: \(self.process.terminationStatus)") isTerminated = true diff --git a/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift b/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift index 166e30f..843f2d0 100644 --- a/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift +++ b/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift @@ -28,8 +28,8 @@ extension BuildOperationProgressUpdated: DecodableRPCPayload { public init(args: [MessagePackValue], indexPath: IndexPath) throws { guard args.count == 4 else { throw RPCPayloadDecodingError.invalidCount(args.count, indexPath: indexPath) } - self.statusMessage = try args.parseString(indexPath: indexPath + IndexPath(index: 1)) - self.completedTasks = try args.parseString(indexPath: indexPath + IndexPath(index: 0)) + self.statusMessage = try args.parseString(indexPath: indexPath + IndexPath(index: 0)) + self.completedTasks = try args.parseString(indexPath: indexPath + IndexPath(index: 1)) self.percentComplete = try args.parseDouble(indexPath: indexPath + IndexPath(index: 2)) self.showInLog = try args.parseBool(indexPath: indexPath + IndexPath(index: 3)) } @@ -40,8 +40,8 @@ extension BuildOperationProgressUpdated: DecodableRPCPayload { extension BuildOperationProgressUpdated: EncodableRPCPayload { public func encode() -> [MessagePackValue] { return [ - .string(completedTasks), .string(statusMessage), + .string(completedTasks), .double(percentComplete), .bool(showInLog), ] From 8f1279f7ec7050c448be385b15e8ffbea6091144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Wed, 13 Oct 2021 18:56:28 -0500 Subject: [PATCH 23/30] new progress message --- Examples/BazelProgressXCBBuildService/BUILD.bazel | 2 +- .../BazelProgressXCBBuildService/Sources/BazelBuild.swift | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Examples/BazelProgressXCBBuildService/BUILD.bazel b/Examples/BazelProgressXCBBuildService/BUILD.bazel index 74238cc..8aa193b 100644 --- a/Examples/BazelProgressXCBBuildService/BUILD.bazel +++ b/Examples/BazelProgressXCBBuildService/BUILD.bazel @@ -16,7 +16,7 @@ swift_library( "@com_github_apple_swift_nio//:NIO", "@com_github_target_xcbbuildserviceproxy//:XCBBuildServiceProxy", "@com_github_target_xcbbuildserviceproxy//:XCBProtocol", - "@com_github_target_xcbbuildserviceproxy//:XCBProtocol_12_0", + "@com_github_target_xcbbuildserviceproxy//:XCBProtocol_13_0", ], ) diff --git a/Examples/BazelProgressXCBBuildService/Sources/BazelBuild.swift b/Examples/BazelProgressXCBBuildService/Sources/BazelBuild.swift index 2a063b8..069148c 100644 --- a/Examples/BazelProgressXCBBuildService/Sources/BazelBuild.swift +++ b/Examples/BazelProgressXCBBuildService/Sources/BazelBuild.swift @@ -56,7 +56,7 @@ final class BazelBuild { let completedActionsRange = Range(match.range(at: 1), in: message), let totalActionsRange = Range(match.range(at: 3), in: message) { - progressMessage = String(message[finalMessageRange]) + progressMessage = String(message[finalMessageRange]).components(separatedBy: ";").first let completedActionsString = message[completedActionsRange] .replacingOccurrences(of: ",", with: "") @@ -87,7 +87,7 @@ final class BazelBuild { // Take the last message in the case of multiple lines, as well as the most recent `buildProgress` if let message = progressMessage { - buildContext.progressUpdate(message, completedTasks: "\(self.completedActions)/\(self.totalActions)", percentComplete: self.buildProgress) + buildContext.progressUpdate("\(message) \(self.completedActions)/\(self.totalActions)", percentComplete: self.buildProgress) } } ) @@ -100,11 +100,11 @@ final class BazelBuild { private extension BuildContext where ResponsePayload == BazelXCBBuildServiceResponsePayload { - func progressUpdate(_ message: String, completedTasks: String, percentComplete: Double, showInLog: Bool = false) { + func progressUpdate(_ message: String, percentComplete: Double, showInLog: Bool = false) { sendResponseMessage( BuildOperationProgressUpdated( + targetName: nil, statusMessage: message, - completedTasks: completedTasks, percentComplete: percentComplete, showInLog: showInLog ) From 85fc8a9f8d7cbf944317689e17351719ebc6c53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Wed, 13 Oct 2021 18:56:35 -0500 Subject: [PATCH 24/30] revert of stuff --- .../Sources/BazelBuild.swift | 70 ++++++---------- .../Sources/BazelBuildProcess.swift | 79 +++++++++---------- .../Sources/RequestHandler.swift | 69 ++++++---------- 3 files changed, 84 insertions(+), 134 deletions(-) diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift index 278be9e..ca8ac02 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift @@ -103,13 +103,9 @@ final class BazelBuild { default: self.buildProcess = BazelClient() - //RAPPI: Override of targets since we only have one - self.bazelTargets = targets.map { ($0, $0.name, "") } - self.nonBazelTargets = [] - //RAPPI: Kept original implementation -// (self.bazelTargets, self.nonBazelTargets) = targets.bazelTargets( -// for: buildRequest.parameters.configuration -// ) + (self.bazelTargets, self.nonBazelTargets) = targets.bazelTargets( + for: buildRequest.parameters.configuration + ) } } @@ -424,11 +420,10 @@ final class BazelBuild { let actualTargetPatterns = actualLabels.joined(separator: " ") buildContext.planningStarted() - buildContext.progressUpdate("Building with Bazel", completedTasks: "1/1", percentComplete: -1.0, showInLog: true) + buildContext.progressUpdate("Building with Bazel", percentComplete: -1.0, showInLog: true) if !bazelTargets.isEmpty { buildContext.progressUpdate( - "Preparing build for: \(actualTargetPatterns)", - completedTasks: "1/1", + "Preparing build for \(actualLabels.count == 1 ? "label" : "labels"): \(actualTargetPatterns)", percentComplete: -1.0, showInLog: true ) @@ -451,7 +446,6 @@ final class BazelBuild { if uniquedActions { buildContext.progressUpdate( "Actually building \(uniqueActualLabels.count == 1 ? "label" : "labels"): \(uniqueActualLabels.joined(separator: " "))", - completedTasks: "1/1", percentComplete: -1.0, showInLog: true ) @@ -478,26 +472,23 @@ final class BazelBuild { let sdkRoot = "\(platformDeveloperDir)/SDKs/\(parameters.activeRunDestination.sdkVariant)" //TODO: .directoryName let configuration = parameters.configuration - let commandLineString = "" - //RAPPI: No need to run bazel shell since we are calling it in Xcode + let commandLineString = startProcessHandler( + uniqueBazelTargets.map(\.xcodeLabel).joined(separator: " "), + workingDirectory, + installTarget.flatMap { + Self.generateEnvironment( + baseEnvironment: baseEnvironment, + buildRequest: buildRequest, + xcodeBuildVersion: xcodeBuildVersion, + developerDir: developerDir, + platformDir: platformDir, + platformDeveloperDir: platformDeveloperDir, + sdkRoot: sdkRoot, + target: $0 + ) + } ?? baseEnvironment + ) -// let commandLineString = startProcessHandler( -// uniqueBazelTargets.map(\.xcodeLabel).joined(separator: " "), -// workingDirectory, -// installTarget.flatMap { -// Self.generateEnvironment( -// baseEnvironment: baseEnvironment, -// buildRequest: buildRequest, -// xcodeBuildVersion: xcodeBuildVersion, -// developerDir: developerDir, -// platformDir: platformDir, -// platformDeveloperDir: platformDeveloperDir, -// sdkRoot: sdkRoot, -// target: $0 -// ) -// } ?? baseEnvironment -// ) - if let installTarget = installTarget { buildContext.targetStarted( id: 0, @@ -530,7 +521,6 @@ final class BazelBuild { if bazelTargets.count > 1 { buildContext.progressUpdate( "Determining unique targets", - completedTasks: "1/1", percentComplete: -1.0, showInLog: true ) @@ -601,18 +591,10 @@ final class BazelBuild { }, bepHandler: { [buildContext] event in var progressMessage: String? - event.progress.stdout.split(separator: "\n").forEach { message in - guard !message.isEmpty else { return } - - let message = String(message) - logger.info("message out: \(message)") - } - event.progress.stderr.split(separator: "\n").forEach { message in guard !message.isEmpty else { return } let message = String(message) - logger.info("message err: \(message)") if let match = Self.progressRegex.firstMatch( @@ -654,13 +636,9 @@ final class BazelBuild { self.buildProgress = 100 } - logger.info("Rappi - progressMessage: \(progressMessage) object: \(self)") - // Take the last message in the case of multiple lines, as well as the most recent `buildProgress` if let message = progressMessage { - logger.info("Progress: \(self.buildProgress)") - buildContext.progressUpdate(message, completedTasks: "\(self.completedActions)/\(self.totalActions)", percentComplete: self.buildProgress, showInLog: true) -// buildContext.progressUpdate("Some", completedTasks: "1/10", percentComplete: 10, showInLog: true) + buildContext.progressUpdate("\(self.completedActions)/\(self.totalActions)", percentComplete: self.buildProgress) } }, terminationHandler: { [buildContext, bazelTargets] exitCode, cancelled in @@ -709,11 +687,11 @@ private extension BuildContext where ResponsePayload == BazelXCBBuildServiceResp sendResponseMessage(BuildOperationReportPathMap()) } - func progressUpdate(_ message: String, completedTasks: String, percentComplete: Double, showInLog: Bool = false) { + func progressUpdate(_ message: String, percentComplete: Double, showInLog: Bool = false) { sendResponseMessage( BuildOperationProgressUpdated( + targetName: nil, statusMessage: message, - completedTasks: completedTasks, percentComplete: percentComplete, showInLog: showInLog ) diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift b/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift index 1cd41a7..c44b5ce 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuildProcess.swift @@ -43,11 +43,9 @@ final class BazelClient: BazelBuildProcess { private let bepPath: String init() { - //RAPPI: We use the same BEP path as XCBuildKit since it was first implemented in Rappi - self.bepPath = "/tmp/bep.bep" -// self.bepPath = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true) -// .appendingPathComponent(ProcessInfo().globallyUniqueString).path - print("BEP Path: \(self.bepPath)") + self.bepPath = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true) + .appendingPathComponent(ProcessInfo().globallyUniqueString).path + self.process = Process() // Automatically terminate process if our process exits @@ -202,46 +200,41 @@ final class BazelClient: BazelBuildProcess { startedHandler( { [uniqueTargetsProcess] targetPatterns, workingDirectory, environment, finishStartup in - //RAPPI: Our unique target is Bazel dummy target - finishStartup(.success(["Bazel"])) - //RAPPI: Commented for sync purposes -// uniqueTargetsProcess.start( -// targetPatterns: targetPatterns, -// workingDirectory: workingDirectory, -// environment: environment, -// errorOutputHandler: outputHandler, -// uniqueBuildLabelsHandler: finishStartup -// ) + uniqueTargetsProcess.start( + targetPatterns: targetPatterns, + workingDirectory: workingDirectory, + environment: environment, + errorOutputHandler: outputHandler, + uniqueBuildLabelsHandler: finishStartup + ) }, { [process, bepPath] finalTargetPatterns, workingDirectory, environment in - //RAPPI: We handle our own Bazel build process - return "" -// var environment = environment -// environment["NBS_BEP_PATH"] = bepPath -// -// process.launchPath = "/bin/bash" -// process.currentDirectoryPath = workingDirectory -// process.environment = environment -// process.arguments = [ -// "-c", -// "bazel/xcode.sh nbs \(finalTargetPatterns)", -// ] -// -// let command = "\(process.launchPath!) \(process.arguments!.joined(separator: " "))" -// logger.info("Starting Bazel with command: \(command)") -// -// process.launch() -// -// return """ -// cd \(process.currentDirectoryPath) -// \( -// (process.environment ?? [:]) -// .sorted { $0.key < $1.key } -// .map { "export \($0)=\($1.exportQuoted)" } -// .joined(separator: "\n") -// ) -// \(command) -// """ + var environment = environment + environment["NBS_BEP_PATH"] = bepPath + + process.launchPath = "/bin/bash" + process.currentDirectoryPath = workingDirectory + process.environment = environment + process.arguments = [ + "-c", + "bazel/xcode.sh nbs \(finalTargetPatterns)", + ] + + let command = "\(process.launchPath!) \(process.arguments!.joined(separator: " "))" + logger.info("Starting Bazel with command: \(command)") + + process.launch() + + return """ + cd \(process.currentDirectoryPath) + \( + (process.environment ?? [:]) + .sorted { $0.key < $1.key } + .map { "export \($0)=\($1.exportQuoted)" } + .joined(separator: "\n") + ) + \(command) + """ } ) } diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index 1dd187c..8f4f292 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -147,15 +147,13 @@ final class RequestHandler: HybridXCBBuildServiceRequestHandler { sessionBazelBuilds[session]?.cancel() sessionBazelBuilds[session] = nil - guard message.buildRequest.buildCommand.command == .build else { return } - handleBazelTargets(session: session) { baseEnvironment, bazelTargets, xcodeBuildVersion in logger.trace("Parsed targets for BazelXCBBuildService: \(bazelTargets.map { $1.name })") var desiredTargets: [BazelBuild.Target] = [] for target in message.buildRequest.configuredTargets { let guid = target.guid - + guard var bazelTarget = bazelTargets[guid] else { context.sendErrorResponse( "[\(session)] Parsed target not found for GUID “\(guid)”", @@ -163,40 +161,27 @@ final class RequestHandler: HybridXCBBuildServiceRequestHandler { ) return } - - //RAPPI: Commented for sync purposes + // TODO: Do this check after uniquing targets, to allow excluding of "Testing" modules as well -// guard !BazelBuild.shouldSkipTarget(bazelTarget, buildRequest: message.buildRequest) else { -// logger.info("Skipping target for Bazel build: \(bazelTarget.name)") -// continue -// } + guard !BazelBuild.shouldSkipTarget(bazelTarget, buildRequest: message.buildRequest) else { + logger.info("Skipping target for Bazel build: \(bazelTarget.name)") + continue + } - //RAPPI: Here we will filter Grability target - guard bazelTarget.name == "Grability" else { continue } - bazelTarget.parameters = target.parameters - + desiredTargets.append(bazelTarget) } - //RAPPI: At this point we will continue only if Bazel target is being compiled - guard !desiredTargets.isEmpty else { + guard BazelBuild.shouldBuild(targets: desiredTargets, buildRequest: message.buildRequest) else { + // There were no bazel based targets, so we will build normally context.forwardRequest() return } - //RAPPI: Commented original implementation for sync purposes -// guard BazelBuild.shouldBuild(targets: desiredTargets, buildRequest: message.buildRequest) else { -// // There were no bazel based targets, so we will build normally -// context.forwardRequest() -// return -// } - self.lastBazelBuildNumber -= 1 let buildNumber = self.lastBazelBuildNumber - logger.info("Rappi - message.responseChannel: \(message.responseChannel) build command: \(message.buildRequest.buildCommand)") - let buildContext = BuildContext( sendResponse: context.sendResponse, session: session, @@ -211,7 +196,7 @@ final class RequestHandler: HybridXCBBuildServiceRequestHandler { xcodeBuildVersion: xcodeBuildVersion, developerDir: baseEnvironment["DEVELOPER_DIR"]!, buildRequest: message.buildRequest, - targets: Array(bazelTargets.values) + targets: desiredTargets ) self.sessionBazelBuilds[session] = build @@ -305,26 +290,20 @@ extension RequestHandler { context: Context, workspacePIFFuture: EventLoopFuture ) -> EventLoopFuture { - //RAPPI: By default every project will be enabled, it will be filtered by the targets instead - let promise = context.eventLoop.makePromise(of: Bool.self) - promise.succeed(true) - return promise.futureResult - //RAPPI: Keeped original solution for merge/sync facilities - -// return workspacePIFFuture.flatMap { [fileIO] pif in -// let path = "\(pif.path)/xcshareddata/BazelXCBBuildServiceSettings.plist" -// return fileIO.openFile(path: path, eventLoop: context.eventLoop) -// .map { fileHandle, _ in -// // Close the file, we just wanted to ensure it exists for now -// // Later we might read the contents -// try? fileHandle.close() -// logger.debug("“\(path)” found. Building with Bazel.") -// return true -// }.recover { error in -// logger.debug("“\(path)” could not be opened (\(error)). Not building with Bazel.") -// return false -// } -// } + return workspacePIFFuture.flatMap { [fileIO] pif in + let path = "\(pif.path)/xcshareddata/BazelXCBBuildServiceSettings.plist" + return fileIO.openFile(path: path, eventLoop: context.eventLoop) + .map { fileHandle, _ in + // Close the file, we just wanted to ensure it exists for now + // Later we might read the contents + try? fileHandle.close() + logger.debug("“\(path)” found. Building with Bazel.") + return true + }.recover { error in + logger.debug("“\(path)” could not be opened (\(error)). Not building with Bazel.") + return false + } + } } /// - Returns: parsed projects or an error, if we should build with Bazel, or `nil` if we shouldn't. From 58869786bfc427251d7e3e81bb6622e5521520d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Wed, 13 Oct 2021 19:01:24 -0500 Subject: [PATCH 25/30] fixes compilation --- Examples/BazelXCBBuildService/BUILD.bazel | 2 +- Examples/BazelXCBBuildService/Sources/BazelBuild.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Examples/BazelXCBBuildService/BUILD.bazel b/Examples/BazelXCBBuildService/BUILD.bazel index 6114b37..47d80fb 100644 --- a/Examples/BazelXCBBuildService/BUILD.bazel +++ b/Examples/BazelXCBBuildService/BUILD.bazel @@ -16,7 +16,7 @@ swift_library( "@com_github_apple_swift_nio//:NIO", "@com_github_target_xcbbuildserviceproxy//:XCBBuildServiceProxy", "@com_github_target_xcbbuildserviceproxy//:XCBProtocol", - "@com_github_target_xcbbuildserviceproxy//:XCBProtocol_12_0", + "@com_github_target_xcbbuildserviceproxy//:XCBProtocol_13_0", ], ) diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift index ca8ac02..2fdee65 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift @@ -607,7 +607,7 @@ final class BazelBuild { let completedActionsRange = Range(match.range(at: 1), in: message), let totalActionsRange = Range(match.range(at: 3), in: message) { - progressMessage = String(message[finalMessageRange]) + progressMessage = String(message[finalMessageRange]).components(separatedBy: ";").first let completedActionsString = message[completedActionsRange] .replacingOccurrences(of: ",", with: "") @@ -638,7 +638,7 @@ final class BazelBuild { // Take the last message in the case of multiple lines, as well as the most recent `buildProgress` if let message = progressMessage { - buildContext.progressUpdate("\(self.completedActions)/\(self.totalActions)", percentComplete: self.buildProgress) + buildContext.progressUpdate("\(message) \(self.completedActions)/\(self.totalActions)", percentComplete: self.buildProgress) } }, terminationHandler: { [buildContext, bazelTargets] exitCode, cancelled in From 646a3f489c0c120c9ba5dc3b046f12862ad9fcfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Wed, 13 Oct 2021 19:13:10 -0500 Subject: [PATCH 26/30] updated versions in package --- Examples/BazelProgressXCBBuildService/Package.swift | 4 ++-- Examples/BazelXCBBuildService/Package.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Examples/BazelProgressXCBBuildService/Package.swift b/Examples/BazelProgressXCBBuildService/Package.swift index 74f9c9e..303d611 100644 --- a/Examples/BazelProgressXCBBuildService/Package.swift +++ b/Examples/BazelProgressXCBBuildService/Package.swift @@ -9,8 +9,8 @@ let package = Package( .executable(name: "BazelProgressXCBBuildService", targets: ["BazelProgressXCBBuildService"]), ], dependencies: [ - .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"), - .package(url: "https://github.com/apple/swift-nio.git", from: "2.17.0"), + .package(url: "https://github.com/apple/swift-log.git", from: "1.4.2"), + .package(url: "https://github.com/apple/swift-nio.git", from: "2.33.0"), .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.9.0"), // XCBBuildServiceProxy lives up two levels from here .package(path: "../../"), diff --git a/Examples/BazelXCBBuildService/Package.swift b/Examples/BazelXCBBuildService/Package.swift index ce6dab6..da1e583 100644 --- a/Examples/BazelXCBBuildService/Package.swift +++ b/Examples/BazelXCBBuildService/Package.swift @@ -13,8 +13,8 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"), - .package(url: "https://github.com/apple/swift-nio.git", from: "2.17.0"), + .package(url: "https://github.com/apple/swift-log.git", from: "1.4.2"), + .package(url: "https://github.com/apple/swift-nio.git", from: "2.33.0"), .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.9.0"), // XCBBuildServiceProxy lives up two levels from here .package(path: "../../"), From ce1f5b746775706f9d6c91aef9846aae368912e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Wed, 13 Oct 2021 19:19:57 -0500 Subject: [PATCH 27/30] setting up --- Examples/BazelXCBBuildService/BUILD.bazel | 2 +- Examples/BazelXCBBuildService/Package.swift | 2 +- .../Sources/BazelBuild.swift | 20 +++++++------------ .../Sources/RequestHandler.swift | 6 +++--- .../XCBProtocol_13_0/Build/SDKVariant.swift | 1 - 5 files changed, 12 insertions(+), 19 deletions(-) delete mode 120000 Sources/XCBProtocol_13_0/Build/SDKVariant.swift diff --git a/Examples/BazelXCBBuildService/BUILD.bazel b/Examples/BazelXCBBuildService/BUILD.bazel index 47d80fb..6114b37 100644 --- a/Examples/BazelXCBBuildService/BUILD.bazel +++ b/Examples/BazelXCBBuildService/BUILD.bazel @@ -16,7 +16,7 @@ swift_library( "@com_github_apple_swift_nio//:NIO", "@com_github_target_xcbbuildserviceproxy//:XCBBuildServiceProxy", "@com_github_target_xcbbuildserviceproxy//:XCBProtocol", - "@com_github_target_xcbbuildserviceproxy//:XCBProtocol_13_0", + "@com_github_target_xcbbuildserviceproxy//:XCBProtocol_12_0", ], ) diff --git a/Examples/BazelXCBBuildService/Package.swift b/Examples/BazelXCBBuildService/Package.swift index da1e583..e52c3e3 100644 --- a/Examples/BazelXCBBuildService/Package.swift +++ b/Examples/BazelXCBBuildService/Package.swift @@ -29,7 +29,7 @@ let package = Package( "SwiftProtobuf", "XCBBuildServiceProxy", "XCBProtocol", - "XCBProtocol_13_0", + "XCBProtocol_12_0", ], path: "Sources" ), diff --git a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift index 2fdee65..9253113 100644 --- a/Examples/BazelXCBBuildService/Sources/BazelBuild.swift +++ b/Examples/BazelXCBBuildService/Sources/BazelBuild.swift @@ -1,7 +1,6 @@ import Foundation import XCBBuildServiceProxy import XCBProtocol -@_exported import XCBProtocol_13_0 // swiftformat:disable braces @@ -50,8 +49,6 @@ final class BazelBuild { private var buildProgress: Double = -1.0 private var initialActionCount: Int = 0 - private var totalActions: Int = 0 - private var completedActions: Int = 0 private let bazelTargets: [(target: Target, label: String, xcodeLabel: String)] private let nonBazelTargets: [Target] @@ -92,7 +89,7 @@ final class BazelBuild { self.buildContext = buildContext - switch buildRequest.buildCommand.command { + switch buildRequest.buildCommand { case .cleanBuildFolder: self.buildProcess = CleanBuildFolderProcess( buildProductsPath: buildRequest.parameters.arenaInfo.buildProductsPath, @@ -117,7 +114,7 @@ final class BazelBuild { /// - Returns: `true` if the target shouldn't be build for the `buildRequest`. /// e.g. test targets are set in Xcode 11.3 for SwiftUI previews, even though we don't need to build them. static func shouldSkipTarget(_ target: Target, buildRequest: BuildRequest) -> Bool { - guard buildRequest.buildCommand.command == .preview else { return false } + guard buildRequest.buildCommand == .preview else { return false } return target.name.hasSuffix("Testing") || target.name == "TestingCore" @@ -149,7 +146,7 @@ final class BazelBuild { let developerDir = baseEnvironment["DEVELOPER_DIR"]! let platformDir = "\(developerDir)/Platforms/\(parameters.activeRunDestination.platform.directoryName)" let platformDeveloperDir = "\(platformDir)/Developer" - let sdkRoot = "\(platformDeveloperDir)/SDKs/\(parameters.activeRunDestination.sdkVariant)" //TODO: .directoryName + let sdkRoot = "\(platformDeveloperDir)/SDKs/\(parameters.activeRunDestination.sdkVariant.directoryName)" let environment = Self.generateEnvironment( baseEnvironment: baseEnvironment, @@ -469,7 +466,7 @@ final class BazelBuild { let parameters = installTarget?.parameters ?? buildRequest.parameters let platformDir = "\(developerDir)/Platforms/\(parameters.activeRunDestination.platform.directoryName)" let platformDeveloperDir = "\(platformDir)/Developer" - let sdkRoot = "\(platformDeveloperDir)/SDKs/\(parameters.activeRunDestination.sdkVariant)" //TODO: .directoryName + let sdkRoot = "\(platformDeveloperDir)/SDKs/\(parameters.activeRunDestination.sdkVariant.directoryName)" let configuration = parameters.configuration let commandLineString = startProcessHandler( @@ -607,7 +604,7 @@ final class BazelBuild { let completedActionsRange = Range(match.range(at: 1), in: message), let totalActionsRange = Range(match.range(at: 3), in: message) { - progressMessage = String(message[finalMessageRange]).components(separatedBy: ";").first + progressMessage = String(message[finalMessageRange]) let completedActionsString = message[completedActionsRange] .replacingOccurrences(of: ",", with: "") @@ -618,8 +615,6 @@ final class BazelBuild { let completedActions = Int(completedActionsString), let totalActions = Int(totalActionsString) { - self.totalActions = totalActions - self.completedActions = completedActions if self.initialActionCount == 0, completedActions > 0, completedActions != totalActions { self.initialActionCount = completedActions } @@ -638,7 +633,7 @@ final class BazelBuild { // Take the last message in the case of multiple lines, as well as the most recent `buildProgress` if let message = progressMessage { - buildContext.progressUpdate("\(message) \(self.completedActions)/\(self.totalActions)", percentComplete: self.buildProgress) + buildContext.progressUpdate(message, percentComplete: self.buildProgress) } }, terminationHandler: { [buildContext, bazelTargets] exitCode, cancelled in @@ -815,8 +810,7 @@ private extension BuildOperationProjectInfo { self.init( name: parsedProject.name, path: parsedProject.path, - isPackage: parsedProject.isPackage, - isNameUniqueInWorkspace: true + isPackage: parsedProject.isPackage ) } } diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index 8f4f292..40de7e2 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -4,9 +4,9 @@ import NIO import XCBBuildServiceProxy import XCBProtocol -@_exported import XCBProtocol_13_0 -typealias BazelXCBBuildServiceRequestPayload = XCBProtocol_13_0.RequestPayload -typealias BazelXCBBuildServiceResponsePayload = XCBProtocol_13_0.ResponsePayload +@_exported import XCBProtocol_12_0 +typealias BazelXCBBuildServiceRequestPayload = XCBProtocol_12_0.RequestPayload +typealias BazelXCBBuildServiceResponsePayload = XCBProtocol_12_0.ResponsePayload final class RequestHandler: HybridXCBBuildServiceRequestHandler { typealias Context = HybridXCBBuildServiceRequestHandlerContext diff --git a/Sources/XCBProtocol_13_0/Build/SDKVariant.swift b/Sources/XCBProtocol_13_0/Build/SDKVariant.swift deleted file mode 120000 index 903d1ec..0000000 --- a/Sources/XCBProtocol_13_0/Build/SDKVariant.swift +++ /dev/null @@ -1 +0,0 @@ -../../XCBProtocol_11_4/Build/SDKVariant.swift \ No newline at end of file From 4709c380fffb9f499040b73c3fd4359d8a784264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Wed, 13 Oct 2021 19:39:52 -0500 Subject: [PATCH 28/30] fix symlink --- .../BuildOperationProgressUpdated.swift | 50 +------------------ 1 file changed, 1 insertion(+), 49 deletions(-) mode change 100644 => 120000 Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift diff --git a/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift b/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift deleted file mode 100644 index 843f2d0..0000000 --- a/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift +++ /dev/null @@ -1,49 +0,0 @@ -import Foundation -import MessagePack -import XCBProtocol - -public struct BuildOperationProgressUpdated { - public let statusMessage: String - public let completedTasks: String // Should be in the format 1/10 - public let percentComplete: Double - public let showInLog: Bool - - public init(statusMessage: String, completedTasks: String, percentComplete: Double, showInLog: Bool) { - self.statusMessage = statusMessage - self.completedTasks = completedTasks - self.percentComplete = percentComplete - self.showInLog = showInLog - } -} - -// MARK: - ResponsePayloadConvertible - -extension BuildOperationProgressUpdated: ResponsePayloadConvertible { - public func toResponsePayload() -> ResponsePayload { .buildOperationProgressUpdated(self) } -} - -// MARK: - Decoding - -extension BuildOperationProgressUpdated: DecodableRPCPayload { - public init(args: [MessagePackValue], indexPath: IndexPath) throws { - guard args.count == 4 else { throw RPCPayloadDecodingError.invalidCount(args.count, indexPath: indexPath) } - - self.statusMessage = try args.parseString(indexPath: indexPath + IndexPath(index: 0)) - self.completedTasks = try args.parseString(indexPath: indexPath + IndexPath(index: 1)) - self.percentComplete = try args.parseDouble(indexPath: indexPath + IndexPath(index: 2)) - self.showInLog = try args.parseBool(indexPath: indexPath + IndexPath(index: 3)) - } -} - -// MARK: - Encoding - -extension BuildOperationProgressUpdated: EncodableRPCPayload { - public func encode() -> [MessagePackValue] { - return [ - .string(statusMessage), - .string(completedTasks), - .double(percentComplete), - .bool(showInLog), - ] - } -} diff --git a/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift b/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift new file mode 120000 index 0000000..ae579f2 --- /dev/null +++ b/Sources/XCBProtocol_13_0/Build Operation/BuildOperationProgressUpdated.swift @@ -0,0 +1 @@ +../../XCBProtocol_11_4/Build Operation/BuildOperationProgressUpdated.swift \ No newline at end of file From 30b3414799ac8cb5e0ddf47c65f37dacb00bfd48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Wed, 13 Oct 2021 20:12:51 -0500 Subject: [PATCH 29/30] version fix --- Examples/WORKSPACE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/WORKSPACE b/Examples/WORKSPACE index 0a296ab..9c79a55 100644 --- a/Examples/WORKSPACE +++ b/Examples/WORKSPACE @@ -13,7 +13,7 @@ http_archive( http_archive( name = "build_bazel_rules_apple", sha256 = "0052d452af7742c8f3a4e0929763388a66403de363775db7e90adecb2ba4944b", - url = "https://github.com/bazelbuild/rules_apple/releases/download/0.31.2/rules_apple.0.31.3.tar.gz", + url = "https://github.com/bazelbuild/rules_apple/releases/download/0.31.3/rules_apple.0.31.3.tar.gz", ) http_archive( From d8d66c80db5704e26475a719bd2ad30ba1790013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Zun=CC=83iga=20Lagunas?= Date: Thu, 14 Oct 2021 18:18:00 -0500 Subject: [PATCH 30/30] deleted code --- .bazelversion | 2 +- .gitignore | 1 - Examples/.bazelrc | 2 - .../proto/build_event_stream.pb.swift | 3675 ++++---- .../src/main/protobuf/command_line.pb.swift | 247 +- .../main/protobuf/failure_details.pb.swift | 7779 ++--------------- .../main/protobuf/invocation_policy.pb.swift | 708 +- .../src/main/protobuf/option_filters.pb.swift | 23 +- .../BazelXCBBuildService/Package.resolved | 8 +- Examples/BazelXCBBuildService/Package.swift | 4 +- .../Sources/RequestHandler.swift | 3 +- Examples/WORKSPACE | 12 +- Package.swift | 2 +- external/com_github_apple_swift_nio.BUILD | 35 - repositories.bzl | 6 +- 15 files changed, 2736 insertions(+), 9771 deletions(-) delete mode 100644 Examples/.bazelrc mode change 100644 => 100755 Examples/BazelXCBBuildService/BEP/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.pb.swift mode change 100644 => 100755 Examples/BazelXCBBuildService/BEP/src/main/protobuf/command_line.pb.swift mode change 100644 => 100755 Examples/BazelXCBBuildService/BEP/src/main/protobuf/failure_details.pb.swift mode change 100644 => 100755 Examples/BazelXCBBuildService/BEP/src/main/protobuf/invocation_policy.pb.swift mode change 100644 => 100755 Examples/BazelXCBBuildService/BEP/src/main/protobuf/option_filters.pb.swift diff --git a/.bazelversion b/.bazelversion index 6aba2b2..40c341b 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -4.2.0 +3.6.0 diff --git a/.gitignore b/.gitignore index 68902ab..03671ac 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ /bazel-* /Examples/bazel-* /.vscode -.build \ No newline at end of file diff --git a/Examples/.bazelrc b/Examples/.bazelrc deleted file mode 100644 index 6d8a102..0000000 --- a/Examples/.bazelrc +++ /dev/null @@ -1,2 +0,0 @@ -build --use_top_level_targets_for_symlinks -build --macos_cpus=arm64,x86_64 diff --git a/Examples/BazelXCBBuildService/BEP/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.pb.swift b/Examples/BazelXCBBuildService/BEP/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.pb.swift old mode 100644 new mode 100755 index 13b6e99..0ea8e35 --- a/Examples/BazelXCBBuildService/BEP/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.pb.swift +++ b/Examples/BazelXCBBuildService/BEP/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.pb.swift @@ -1,5 +1,4 @@ // DO NOT EDIT. -// swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto @@ -7,20 +6,6 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ -// Copyright 2016 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - import Foundation import SwiftProtobuf @@ -31,15 +16,13 @@ import src_main_protobuf_invocation_policy_proto // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API +// Please ensure that your are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } -/// Enumeration type characterizing the size of a test, as specified by the -/// test rule. public enum BuildEventStream_TestSize: SwiftProtobuf.Enum { public typealias RawValue = Int case unknown // = 0 @@ -160,219 +143,214 @@ extension BuildEventStream_TestStatus: CaseIterable { #endif // swift(>=4.2) -/// Identifier for a build event. It is deliberately structured to also provide -/// information about which build target etc the event is related to. -/// -/// Events are chained via the event id as follows: each event has an id and a -/// set of ids of children events such that apart from the initial event each -/// event has an id that is mentioned as child id in an earlier event and a build -/// invocation is complete if and only if all direct and indirect children of the -/// initial event have been posted. public struct BuildEventStream_BuildEventId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var id: BuildEventStream_BuildEventId.OneOf_ID? = nil + public var id: OneOf_ID? { + get {return _storage._id} + set {_uniqueStorage()._id = newValue} + } public var unknown: BuildEventStream_BuildEventId.UnknownBuildEventId { get { - if case .unknown(let v)? = id {return v} + if case .unknown(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.UnknownBuildEventId() } - set {id = .unknown(newValue)} + set {_uniqueStorage()._id = .unknown(newValue)} } public var progress: BuildEventStream_BuildEventId.ProgressId { get { - if case .progress(let v)? = id {return v} + if case .progress(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.ProgressId() } - set {id = .progress(newValue)} + set {_uniqueStorage()._id = .progress(newValue)} } public var started: BuildEventStream_BuildEventId.BuildStartedId { get { - if case .started(let v)? = id {return v} + if case .started(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.BuildStartedId() } - set {id = .started(newValue)} + set {_uniqueStorage()._id = .started(newValue)} } public var unstructuredCommandLine: BuildEventStream_BuildEventId.UnstructuredCommandLineId { get { - if case .unstructuredCommandLine(let v)? = id {return v} + if case .unstructuredCommandLine(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.UnstructuredCommandLineId() } - set {id = .unstructuredCommandLine(newValue)} + set {_uniqueStorage()._id = .unstructuredCommandLine(newValue)} } public var structuredCommandLine: BuildEventStream_BuildEventId.StructuredCommandLineId { get { - if case .structuredCommandLine(let v)? = id {return v} + if case .structuredCommandLine(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.StructuredCommandLineId() } - set {id = .structuredCommandLine(newValue)} + set {_uniqueStorage()._id = .structuredCommandLine(newValue)} } public var workspaceStatus: BuildEventStream_BuildEventId.WorkspaceStatusId { get { - if case .workspaceStatus(let v)? = id {return v} + if case .workspaceStatus(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.WorkspaceStatusId() } - set {id = .workspaceStatus(newValue)} + set {_uniqueStorage()._id = .workspaceStatus(newValue)} } public var optionsParsed: BuildEventStream_BuildEventId.OptionsParsedId { get { - if case .optionsParsed(let v)? = id {return v} + if case .optionsParsed(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.OptionsParsedId() } - set {id = .optionsParsed(newValue)} + set {_uniqueStorage()._id = .optionsParsed(newValue)} } public var fetch: BuildEventStream_BuildEventId.FetchId { get { - if case .fetch(let v)? = id {return v} + if case .fetch(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.FetchId() } - set {id = .fetch(newValue)} + set {_uniqueStorage()._id = .fetch(newValue)} } public var configuration: BuildEventStream_BuildEventId.ConfigurationId { get { - if case .configuration(let v)? = id {return v} + if case .configuration(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.ConfigurationId() } - set {id = .configuration(newValue)} + set {_uniqueStorage()._id = .configuration(newValue)} } public var targetConfigured: BuildEventStream_BuildEventId.TargetConfiguredId { get { - if case .targetConfigured(let v)? = id {return v} + if case .targetConfigured(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.TargetConfiguredId() } - set {id = .targetConfigured(newValue)} + set {_uniqueStorage()._id = .targetConfigured(newValue)} } public var pattern: BuildEventStream_BuildEventId.PatternExpandedId { get { - if case .pattern(let v)? = id {return v} + if case .pattern(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.PatternExpandedId() } - set {id = .pattern(newValue)} + set {_uniqueStorage()._id = .pattern(newValue)} } public var patternSkipped: BuildEventStream_BuildEventId.PatternExpandedId { get { - if case .patternSkipped(let v)? = id {return v} + if case .patternSkipped(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.PatternExpandedId() } - set {id = .patternSkipped(newValue)} + set {_uniqueStorage()._id = .patternSkipped(newValue)} } public var namedSet: BuildEventStream_BuildEventId.NamedSetOfFilesId { get { - if case .namedSet(let v)? = id {return v} + if case .namedSet(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.NamedSetOfFilesId() } - set {id = .namedSet(newValue)} + set {_uniqueStorage()._id = .namedSet(newValue)} } public var targetCompleted: BuildEventStream_BuildEventId.TargetCompletedId { get { - if case .targetCompleted(let v)? = id {return v} + if case .targetCompleted(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.TargetCompletedId() } - set {id = .targetCompleted(newValue)} + set {_uniqueStorage()._id = .targetCompleted(newValue)} } public var actionCompleted: BuildEventStream_BuildEventId.ActionCompletedId { get { - if case .actionCompleted(let v)? = id {return v} + if case .actionCompleted(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.ActionCompletedId() } - set {id = .actionCompleted(newValue)} + set {_uniqueStorage()._id = .actionCompleted(newValue)} } public var unconfiguredLabel: BuildEventStream_BuildEventId.UnconfiguredLabelId { get { - if case .unconfiguredLabel(let v)? = id {return v} + if case .unconfiguredLabel(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.UnconfiguredLabelId() } - set {id = .unconfiguredLabel(newValue)} + set {_uniqueStorage()._id = .unconfiguredLabel(newValue)} } public var configuredLabel: BuildEventStream_BuildEventId.ConfiguredLabelId { get { - if case .configuredLabel(let v)? = id {return v} + if case .configuredLabel(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.ConfiguredLabelId() } - set {id = .configuredLabel(newValue)} + set {_uniqueStorage()._id = .configuredLabel(newValue)} } public var testResult: BuildEventStream_BuildEventId.TestResultId { get { - if case .testResult(let v)? = id {return v} + if case .testResult(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.TestResultId() } - set {id = .testResult(newValue)} + set {_uniqueStorage()._id = .testResult(newValue)} } public var testSummary: BuildEventStream_BuildEventId.TestSummaryId { get { - if case .testSummary(let v)? = id {return v} + if case .testSummary(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.TestSummaryId() } - set {id = .testSummary(newValue)} + set {_uniqueStorage()._id = .testSummary(newValue)} } public var buildFinished: BuildEventStream_BuildEventId.BuildFinishedId { get { - if case .buildFinished(let v)? = id {return v} + if case .buildFinished(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.BuildFinishedId() } - set {id = .buildFinished(newValue)} + set {_uniqueStorage()._id = .buildFinished(newValue)} } public var buildToolLogs: BuildEventStream_BuildEventId.BuildToolLogsId { get { - if case .buildToolLogs(let v)? = id {return v} + if case .buildToolLogs(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.BuildToolLogsId() } - set {id = .buildToolLogs(newValue)} + set {_uniqueStorage()._id = .buildToolLogs(newValue)} } public var buildMetrics: BuildEventStream_BuildEventId.BuildMetricsId { get { - if case .buildMetrics(let v)? = id {return v} + if case .buildMetrics(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.BuildMetricsId() } - set {id = .buildMetrics(newValue)} + set {_uniqueStorage()._id = .buildMetrics(newValue)} } public var workspace: BuildEventStream_BuildEventId.WorkspaceConfigId { get { - if case .workspace(let v)? = id {return v} + if case .workspace(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.WorkspaceConfigId() } - set {id = .workspace(newValue)} + set {_uniqueStorage()._id = .workspace(newValue)} } public var buildMetadata: BuildEventStream_BuildEventId.BuildMetadataId { get { - if case .buildMetadata(let v)? = id {return v} + if case .buildMetadata(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.BuildMetadataId() } - set {id = .buildMetadata(newValue)} + set {_uniqueStorage()._id = .buildMetadata(newValue)} } public var convenienceSymlinksIdentified: BuildEventStream_BuildEventId.ConvenienceSymlinksIdentifiedId { get { - if case .convenienceSymlinksIdentified(let v)? = id {return v} + if case .convenienceSymlinksIdentified(let v)? = _storage._id {return v} return BuildEventStream_BuildEventId.ConvenienceSymlinksIdentifiedId() } - set {id = .convenienceSymlinksIdentified(newValue)} + set {_uniqueStorage()._id = .convenienceSymlinksIdentified(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -406,119 +384,38 @@ public struct BuildEventStream_BuildEventId { #if !swift(>=4.1) public static func ==(lhs: BuildEventStream_BuildEventId.OneOf_ID, rhs: BuildEventStream_BuildEventId.OneOf_ID) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.unknown, .unknown): return { - guard case .unknown(let l) = lhs, case .unknown(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.progress, .progress): return { - guard case .progress(let l) = lhs, case .progress(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.started, .started): return { - guard case .started(let l) = lhs, case .started(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.unstructuredCommandLine, .unstructuredCommandLine): return { - guard case .unstructuredCommandLine(let l) = lhs, case .unstructuredCommandLine(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.structuredCommandLine, .structuredCommandLine): return { - guard case .structuredCommandLine(let l) = lhs, case .structuredCommandLine(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.workspaceStatus, .workspaceStatus): return { - guard case .workspaceStatus(let l) = lhs, case .workspaceStatus(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.optionsParsed, .optionsParsed): return { - guard case .optionsParsed(let l) = lhs, case .optionsParsed(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.fetch, .fetch): return { - guard case .fetch(let l) = lhs, case .fetch(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.configuration, .configuration): return { - guard case .configuration(let l) = lhs, case .configuration(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.targetConfigured, .targetConfigured): return { - guard case .targetConfigured(let l) = lhs, case .targetConfigured(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.pattern, .pattern): return { - guard case .pattern(let l) = lhs, case .pattern(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.patternSkipped, .patternSkipped): return { - guard case .patternSkipped(let l) = lhs, case .patternSkipped(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.namedSet, .namedSet): return { - guard case .namedSet(let l) = lhs, case .namedSet(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.targetCompleted, .targetCompleted): return { - guard case .targetCompleted(let l) = lhs, case .targetCompleted(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.actionCompleted, .actionCompleted): return { - guard case .actionCompleted(let l) = lhs, case .actionCompleted(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.unconfiguredLabel, .unconfiguredLabel): return { - guard case .unconfiguredLabel(let l) = lhs, case .unconfiguredLabel(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.configuredLabel, .configuredLabel): return { - guard case .configuredLabel(let l) = lhs, case .configuredLabel(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.testResult, .testResult): return { - guard case .testResult(let l) = lhs, case .testResult(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.testSummary, .testSummary): return { - guard case .testSummary(let l) = lhs, case .testSummary(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.buildFinished, .buildFinished): return { - guard case .buildFinished(let l) = lhs, case .buildFinished(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.buildToolLogs, .buildToolLogs): return { - guard case .buildToolLogs(let l) = lhs, case .buildToolLogs(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.buildMetrics, .buildMetrics): return { - guard case .buildMetrics(let l) = lhs, case .buildMetrics(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.workspace, .workspace): return { - guard case .workspace(let l) = lhs, case .workspace(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.buildMetadata, .buildMetadata): return { - guard case .buildMetadata(let l) = lhs, case .buildMetadata(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.convenienceSymlinksIdentified, .convenienceSymlinksIdentified): return { - guard case .convenienceSymlinksIdentified(let l) = lhs, case .convenienceSymlinksIdentified(let r) = rhs else { preconditionFailure() } - return l == r - }() + case (.unknown(let l), .unknown(let r)): return l == r + case (.progress(let l), .progress(let r)): return l == r + case (.started(let l), .started(let r)): return l == r + case (.unstructuredCommandLine(let l), .unstructuredCommandLine(let r)): return l == r + case (.structuredCommandLine(let l), .structuredCommandLine(let r)): return l == r + case (.workspaceStatus(let l), .workspaceStatus(let r)): return l == r + case (.optionsParsed(let l), .optionsParsed(let r)): return l == r + case (.fetch(let l), .fetch(let r)): return l == r + case (.configuration(let l), .configuration(let r)): return l == r + case (.targetConfigured(let l), .targetConfigured(let r)): return l == r + case (.pattern(let l), .pattern(let r)): return l == r + case (.patternSkipped(let l), .patternSkipped(let r)): return l == r + case (.namedSet(let l), .namedSet(let r)): return l == r + case (.targetCompleted(let l), .targetCompleted(let r)): return l == r + case (.actionCompleted(let l), .actionCompleted(let r)): return l == r + case (.unconfiguredLabel(let l), .unconfiguredLabel(let r)): return l == r + case (.configuredLabel(let l), .configuredLabel(let r)): return l == r + case (.testResult(let l), .testResult(let r)): return l == r + case (.testSummary(let l), .testSummary(let r)): return l == r + case (.buildFinished(let l), .buildFinished(let r)): return l == r + case (.buildToolLogs(let l), .buildToolLogs(let r)): return l == r + case (.buildMetrics(let l), .buildMetrics(let r)): return l == r + case (.workspace(let l), .workspace(let r)): return l == r + case (.buildMetadata(let l), .buildMetadata(let r)): return l == r + case (.convenienceSymlinksIdentified(let l), .convenienceSymlinksIdentified(let r)): return l == r default: return false } } #endif } - /// Generic identifier for a build event. This is the default type of - /// BuildEventId, but should not be used outside testing; nevertheless, - /// tools should handle build events with this kind of id gracefully. public struct UnknownBuildEventId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -531,16 +428,11 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event reporting progress. Those events are also used to - /// chain in events that come early. public struct ProgressId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Unique identifier. No assumption should be made about how the ids are - /// assigned; the only meaningful operation on this field is test for - /// equality. public var opaqueCount: Int32 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -548,8 +440,6 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event indicating the beginning of a build; this will - /// normally be the first event. public struct BuildStartedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -560,8 +450,6 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier on an event indicating the original commandline received by - /// the bazel server. public struct UnstructuredCommandLineId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -572,16 +460,11 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier on an event describing the commandline received by Bazel. public struct StructuredCommandLineId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// A title for this command line value, as there may be multiple. - /// For example, a single invocation may wish to report both the literal and - /// canonical command lines, and this label would be used to differentiate - /// between both versions. public var commandLineLabel: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -589,7 +472,6 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event indicating the workspace status. public struct WorkspaceStatusId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -600,8 +482,6 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier on an event reporting on the options included in the command - /// line, both explicitly and implicitly. public struct OptionsParsedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -612,14 +492,11 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event reporting that an external resource was fetched - /// from. public struct FetchId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The external resource that was fetched from. public var url: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -627,12 +504,6 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event indicating that a target pattern has been expanded - /// further. - /// Messages of this shape are also used to describe parts of a pattern that - /// have been skipped for some reason, if the actual expansion was still - /// carried out (e.g., if keep_going is set). In this case, the - /// pattern_skipped choice in the id field is to be made. public struct PatternExpandedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -665,8 +536,6 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event indicating that a target has been expanded by - /// identifying for which configurations it should be build. public struct TargetConfiguredId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -674,8 +543,6 @@ public struct BuildEventStream_BuildEventId { public var label: String = String() - /// If not empty, the id refers to the expansion of the target for a given - /// aspect. public var aspect: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -683,15 +550,11 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event introducing a named set of files (usually artifacts) - /// to be referred to in later messages. public struct NamedSetOfFilesId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Identifier of the file set; this is an opaque string valid only for the - /// particular instance of the event stream. public var id: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -699,15 +562,11 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event introducing a configuration. public struct ConfigurationId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Identifier of the configuration; users of the protocol should not make - /// any assumptions about it having any structure, or equality of the - /// identifier between different streams. public var id: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -715,71 +574,68 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event indicating that a target was built completely; this - /// does not include running the test if the target is a test target. public struct TargetCompletedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var label: String = String() + public var label: String { + get {return _storage._label} + set {_uniqueStorage()._label = newValue} + } - /// The configuration for which the target was built. public var configuration: BuildEventStream_BuildEventId.ConfigurationId { - get {return _configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} - set {_configuration = newValue} + get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} + set {_uniqueStorage()._configuration = newValue} } /// Returns true if `configuration` has been explicitly set. - public var hasConfiguration: Bool {return self._configuration != nil} + public var hasConfiguration: Bool {return _storage._configuration != nil} /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - public mutating func clearConfiguration() {self._configuration = nil} + public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} - /// If not empty, the id refers to the completion of the target for a given - /// aspect. - public var aspect: String = String() + public var aspect: String { + get {return _storage._aspect} + set {_uniqueStorage()._aspect = newValue} + } public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil + fileprivate var _storage = _StorageClass.defaultInstance } - /// Identifier of an event reporting that an action was completed (not all - /// actions are reported, only the ones that can be considered important; - /// this includes all failed actions). public struct ActionCompletedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var primaryOutput: String = String() + public var primaryOutput: String { + get {return _storage._primaryOutput} + set {_uniqueStorage()._primaryOutput = newValue} + } - /// Optional, the label of the owner of the action, for reference. - public var label: String = String() + public var label: String { + get {return _storage._label} + set {_uniqueStorage()._label = newValue} + } - /// Optional, the id of the configuration of the action owner. public var configuration: BuildEventStream_BuildEventId.ConfigurationId { - get {return _configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} - set {_configuration = newValue} + get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} + set {_uniqueStorage()._configuration = newValue} } /// Returns true if `configuration` has been explicitly set. - public var hasConfiguration: Bool {return self._configuration != nil} + public var hasConfiguration: Bool {return _storage._configuration != nil} /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - public mutating func clearConfiguration() {self._configuration = nil} + public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil + fileprivate var _storage = _StorageClass.defaultInstance } - /// Identifier of an event reporting an event associated with an unconfigured - /// label. Usually, this indicates a failure due to a missing input file. In - /// any case, it will report some form of error (i.e., the payload will be an - /// Aborted event); there are no regular events using this identifier. The - /// purpose of those events is to serve as the root cause of a failed target. public struct UnconfiguredLabelId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -792,92 +648,99 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event reporting an event associated with a configured - /// label, usually a visibility error. In any case, an event with such an - /// id will always report some form of error (i.e., the payload will be an - /// Aborted event); there are no regular events using this identifier. public struct ConfiguredLabelId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var label: String = String() + public var label: String { + get {return _storage._label} + set {_uniqueStorage()._label = newValue} + } public var configuration: BuildEventStream_BuildEventId.ConfigurationId { - get {return _configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} - set {_configuration = newValue} + get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} + set {_uniqueStorage()._configuration = newValue} } /// Returns true if `configuration` has been explicitly set. - public var hasConfiguration: Bool {return self._configuration != nil} + public var hasConfiguration: Bool {return _storage._configuration != nil} /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - public mutating func clearConfiguration() {self._configuration = nil} + public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil + fileprivate var _storage = _StorageClass.defaultInstance } - /// Identifier of an event reporting on an individual test run. The label - /// identifies the test that is reported about, the remaining fields are - /// in such a way as to uniquely identify the action within a build. In fact, - /// attempts for the same test, run, shard triple are counted sequentially, - /// starting with 1. public struct TestResultId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var label: String = String() + public var label: String { + get {return _storage._label} + set {_uniqueStorage()._label = newValue} + } public var configuration: BuildEventStream_BuildEventId.ConfigurationId { - get {return _configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} - set {_configuration = newValue} + get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} + set {_uniqueStorage()._configuration = newValue} } /// Returns true if `configuration` has been explicitly set. - public var hasConfiguration: Bool {return self._configuration != nil} + public var hasConfiguration: Bool {return _storage._configuration != nil} /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - public mutating func clearConfiguration() {self._configuration = nil} + public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} - public var run: Int32 = 0 + public var run: Int32 { + get {return _storage._run} + set {_uniqueStorage()._run = newValue} + } - public var shard: Int32 = 0 + public var shard: Int32 { + get {return _storage._shard} + set {_uniqueStorage()._shard = newValue} + } - public var attempt: Int32 = 0 + public var attempt: Int32 { + get {return _storage._attempt} + set {_uniqueStorage()._attempt = newValue} + } public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil + fileprivate var _storage = _StorageClass.defaultInstance } - /// Identifier of an event reporting the summary of a test. public struct TestSummaryId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var label: String = String() + public var label: String { + get {return _storage._label} + set {_uniqueStorage()._label = newValue} + } public var configuration: BuildEventStream_BuildEventId.ConfigurationId { - get {return _configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} - set {_configuration = newValue} + get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} + set {_uniqueStorage()._configuration = newValue} } /// Returns true if `configuration` has been explicitly set. - public var hasConfiguration: Bool {return self._configuration != nil} + public var hasConfiguration: Bool {return _storage._configuration != nil} /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - public mutating func clearConfiguration() {self._configuration = nil} + public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil + fileprivate var _storage = _StorageClass.defaultInstance } - /// Identifier of the BuildFinished event, indicating the end of a build. public struct BuildFinishedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -888,8 +751,6 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event providing additional logs/statistics after - /// completion of the build. public struct BuildToolLogsId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -900,8 +761,6 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event providing build metrics after completion - /// of the build. public struct BuildMetricsId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -912,7 +771,6 @@ public struct BuildEventStream_BuildEventId { public init() {} } - /// Identifier of an event providing convenience symlinks information. public struct ConvenienceSymlinksIdentifiedId { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -924,22 +782,17 @@ public struct BuildEventStream_BuildEventId { } public init() {} + + fileprivate var _storage = _StorageClass.defaultInstance } -/// Payload of an event summarizing the progress of the build so far. Those -/// events are also used to be parents of events where the more logical parent -/// event cannot be posted yet as the needed information is not yet complete. public struct BuildEventStream_Progress { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The next chunk of stdout that bazel produced since the last progress event - /// or the beginning of the build. public var stdout: String = String() - /// The next chunk of stderr that bazel produced since the last progress event - /// or the beginning of the build. public var stderr: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -947,8 +800,6 @@ public struct BuildEventStream_Progress { public init() {} } -/// Payload of an event indicating that an expected event will not come, as -/// the build is aborted prematurely for some reason. public struct BuildEventStream_Aborted { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -956,8 +807,6 @@ public struct BuildEventStream_Aborted { public var reason: BuildEventStream_Aborted.AbortReason = .unknown - /// A human readable description with more details about there reason, where - /// available and useful. public var description_p: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -965,44 +814,16 @@ public struct BuildEventStream_Aborted { public enum AbortReason: SwiftProtobuf.Enum { public typealias RawValue = Int case unknown // = 0 - - /// The user requested the build to be aborted (e.g., by hitting Ctl-C). case userInterrupted // = 1 - - /// The user requested that no analysis be performed. case noAnalyze // = 8 - - /// The user requested that no build be carried out. case noBuild // = 9 - - /// The build or target was aborted as a timeout was exceeded. case timeOut // = 2 - - /// The build or target was aborted as some remote environment (e.g., for - /// remote execution of actions) was not available in the expected way. case remoteEnvironmentFailure // = 3 - - /// Failure due to reasons entirely internal to the build tool, i.e. an - /// unexpected crash due to programmer error. case `internal` // = 4 - - /// A Failure occurred in the loading phase of a target. case loadingFailure // = 5 - - /// A Failure occurred in the analysis phase of a target. case analysisFailure // = 6 - - /// Target build was skipped (e.g. due to incompatible CPU constraints). case skipped // = 7 - - /// Build incomplete due to an earlier build failure (e.g. --keep_going was - /// set to false causing the build be ended upon failure). case incomplete // = 10 - - /// The build tool ran out of memory and crashed. Not yet used. OOMs are - /// currently reported as INTERNAL. - /// TODO(b/170643206): Use this reason for OOMs after updating consumers. - case outOfMemory // = 11 case UNRECOGNIZED(Int) public init() { @@ -1022,7 +843,6 @@ public struct BuildEventStream_Aborted { case 8: self = .noAnalyze case 9: self = .noBuild case 10: self = .incomplete - case 11: self = .outOfMemory default: self = .UNRECOGNIZED(rawValue) } } @@ -1040,7 +860,6 @@ public struct BuildEventStream_Aborted { case .noAnalyze: return 8 case .noBuild: return 9 case .incomplete: return 10 - case .outOfMemory: return 11 case .UNRECOGNIZED(let i): return i } } @@ -1066,17 +885,11 @@ extension BuildEventStream_Aborted.AbortReason: CaseIterable { .analysisFailure, .skipped, .incomplete, - .outOfMemory, ] } #endif // swift(>=4.2) -/// Payload of an event indicating the beginning of a new build. Usually, events -/// of those type start a new build-event stream. The target pattern requested -/// to be build is contained in one of the announced child events; it is an -/// invariant that precisely one of the announced child events has a non-empty -/// target pattern. public struct BuildEventStream_BuildStarted { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1084,27 +897,18 @@ public struct BuildEventStream_BuildStarted { public var uuid: String = String() - /// Start of the build in ms since the epoch. - /// TODO(buchgr): Use google.protobuf.TimeStamp once bazel's protoc supports - /// it. public var startTimeMillis: Int64 = 0 - /// Version of the build tool that is running. public var buildToolVersion: String = String() - /// A human-readable description of all the non-default option settings public var optionsDescription: String = String() - /// The name of the command that the user invoked. public var command: String = String() - /// The working directory from which the build tool was invoked. public var workingDirectory: String = String() - /// The directory of the workspace. public var workspaceDirectory: String = String() - /// The process ID of the Bazel server. public var serverPid: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1112,14 +916,11 @@ public struct BuildEventStream_BuildStarted { public init() {} } -/// Configuration related to the blaze workspace and output tree. public struct BuildEventStream_WorkspaceConfig { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The root of the local blaze exec root. All output files live underneath - /// this at "blaze-out/". public var localExecRoot: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1127,12 +928,6 @@ public struct BuildEventStream_WorkspaceConfig { public init() {} } -/// Payload of an event reporting the command-line of the invocation as -/// originally received by the server. Note that this is not the command-line -/// given by the user, as the client adds information about the invocation, -/// like name and relevant entries of rc-files and client environment variables. -/// However, it does contain enough information to reproduce the build -/// invocation. public struct BuildEventStream_UnstructuredCommandLine { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1145,41 +940,52 @@ public struct BuildEventStream_UnstructuredCommandLine { public init() {} } -/// Payload of an event reporting on the parsed options, grouped in various ways. public struct BuildEventStream_OptionsParsed { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var startupOptions: [String] = [] + public var startupOptions: [String] { + get {return _storage._startupOptions} + set {_uniqueStorage()._startupOptions = newValue} + } - public var explicitStartupOptions: [String] = [] + public var explicitStartupOptions: [String] { + get {return _storage._explicitStartupOptions} + set {_uniqueStorage()._explicitStartupOptions = newValue} + } - public var cmdLine: [String] = [] + public var cmdLine: [String] { + get {return _storage._cmdLine} + set {_uniqueStorage()._cmdLine = newValue} + } - public var explicitCmdLine: [String] = [] + public var explicitCmdLine: [String] { + get {return _storage._explicitCmdLine} + set {_uniqueStorage()._explicitCmdLine = newValue} + } - public var invocationPolicy: Blaze_InvocationPolicy_InvocationPolicy { - get {return _invocationPolicy ?? Blaze_InvocationPolicy_InvocationPolicy()} - set {_invocationPolicy = newValue} + public var invocationPolicy: src_main_protobuf_invocation_policy_proto.Blaze_InvocationPolicy_InvocationPolicy { + get {return _storage._invocationPolicy ?? src_main_protobuf_invocation_policy_proto.Blaze_InvocationPolicy_InvocationPolicy()} + set {_uniqueStorage()._invocationPolicy = newValue} } /// Returns true if `invocationPolicy` has been explicitly set. - public var hasInvocationPolicy: Bool {return self._invocationPolicy != nil} + public var hasInvocationPolicy: Bool {return _storage._invocationPolicy != nil} /// Clears the value of `invocationPolicy`. Subsequent reads from it will return its default value. - public mutating func clearInvocationPolicy() {self._invocationPolicy = nil} + public mutating func clearInvocationPolicy() {_uniqueStorage()._invocationPolicy = nil} - public var toolTag: String = String() + public var toolTag: String { + get {return _storage._toolTag} + set {_uniqueStorage()._toolTag = newValue} + } public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _invocationPolicy: Blaze_InvocationPolicy_InvocationPolicy? = nil + fileprivate var _storage = _StorageClass.defaultInstance } -/// Payload of an event indicating that an external resource was fetched. This -/// event will only occur in streams where an actual fetch happened, not in ones -/// where a cached copy of the entity to be fetched was used. public struct BuildEventStream_Fetch { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1192,10 +998,6 @@ public struct BuildEventStream_Fetch { public init() {} } -/// Payload of an event reporting the workspace status. Key-value pairs can be -/// provided by specifying the workspace_status_command to an executable that -/// returns one key-value pair per line of output (key and value separated by a -/// space). public struct BuildEventStream_WorkspaceStatus { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1222,14 +1024,11 @@ public struct BuildEventStream_WorkspaceStatus { public init() {} } -/// Payload of an event reporting custom key-value metadata associated with the -/// build. public struct BuildEventStream_BuildMetadata { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Custom metadata for the build. public var metadata: Dictionary = [:] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1237,7 +1036,6 @@ public struct BuildEventStream_BuildMetadata { public init() {} } -/// Payload of an event reporting details of a given configuration. public struct BuildEventStream_Configuration { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1256,10 +1054,6 @@ public struct BuildEventStream_Configuration { public init() {} } -/// Payload of the event indicating the expansion of a target pattern. -/// The main information is in the chaining part: the id will contain the -/// target pattern that was expanded and the children id will contain the -/// target or target pattern it was expanded to. public struct BuildEventStream_PatternExpanded { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1270,24 +1064,15 @@ public struct BuildEventStream_PatternExpanded { public init() {} } -/// Payload of the event indicating that the configurations for a target have -/// been identified. As with pattern expansion the main information is in the -/// chaining part: the id will contain the target that was configured and the -/// children id will contain the configured targets it was configured to. public struct BuildEventStream_TargetConfigured { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The kind of target (e.g., e.g. "cc_library rule", "source file", - /// "generated file") where the completion is reported. public var targetKind: String = String() - /// The size of the test, if the target is a test target. Unset otherwise. public var testSize: BuildEventStream_TestSize = .unknown - /// List of all tags associated with this target (for all possible - /// configurations). public var tag: [String] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1300,20 +1085,12 @@ public struct BuildEventStream_File { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// A sequence of prefixes to apply to the file name to construct a full path. - /// In most but not all cases, there will be 3 entries: - /// 1. A root output directory, eg "bazel-out" - /// 2. A configuration mnemonic, eg "k8-fastbuild" - /// 3. An output category, eg "genfiles" public var pathPrefix: [String] = [] - /// identifier indicating the nature of the file (e.g., "stdout", "stderr") public var name: String = String() public var file: BuildEventStream_File.OneOf_File? = nil - /// A location where the contents of the file can be found. The string is - /// encoded according to RFC2396. public var uri: String { get { if case .uri(let v)? = file {return v} @@ -1322,11 +1099,10 @@ public struct BuildEventStream_File { set {file = .uri(newValue)} } - /// The contents of the file, if they are guaranteed to be short. public var contents: Data { get { if case .contents(let v)? = file {return v} - return Data() + return SwiftProtobuf.Internal.emptyData } set {file = .contents(newValue)} } @@ -1334,26 +1110,14 @@ public struct BuildEventStream_File { public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_File: Equatable { - /// A location where the contents of the file can be found. The string is - /// encoded according to RFC2396. case uri(String) - /// The contents of the file, if they are guaranteed to be short. case contents(Data) #if !swift(>=4.1) public static func ==(lhs: BuildEventStream_File.OneOf_File, rhs: BuildEventStream_File.OneOf_File) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.uri, .uri): return { - guard case .uri(let l) = lhs, case .uri(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.contents, .contents): return { - guard case .contents(let l) = lhs, case .contents(let r) = rhs else { preconditionFailure() } - return l == r - }() + case (.uri(let l), .uri(let r)): return l == r + case (.contents(let l), .contents(let r)): return l == r default: return false } } @@ -1363,18 +1127,13 @@ public struct BuildEventStream_File { public init() {} } -/// Payload of a message to describe a set of files, usually build artifacts, to -/// be referred to later by their name. In this way, files that occur identically -/// as outputs of several targets have to be named only once. public struct BuildEventStream_NamedSetOfFiles { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Files that belong to this named set of files. public var files: [BuildEventStream_File] = [] - /// Other named sets whose members also belong to this set. public var fileSets: [BuildEventStream_BuildEventId.NamedSetOfFilesId] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1382,10 +1141,6 @@ public struct BuildEventStream_NamedSetOfFiles { public init() {} } -/// Payload of the event indicating the completion of an action. The main purpose -/// of posting those events is to provide details on the root cause for a target -/// failing; however, consumers of the build-event protocol must not assume -/// that only failed actions are posted. public struct BuildEventStream_ActionExecuted { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1396,20 +1151,16 @@ public struct BuildEventStream_ActionExecuted { set {_uniqueStorage()._success = newValue} } - /// The mnemonic of the action that was executed public var type: String { get {return _storage._type} set {_uniqueStorage()._type = newValue} } - /// The exit code of the action, if it is available. public var exitCode: Int32 { get {return _storage._exitCode} set {_uniqueStorage()._exitCode = newValue} } - /// Location where to find the standard output of the action - /// (e.g., a file path). public var stdout: BuildEventStream_File { get {return _storage._stdout ?? BuildEventStream_File()} set {_uniqueStorage()._stdout = newValue} @@ -1419,8 +1170,6 @@ public struct BuildEventStream_ActionExecuted { /// Clears the value of `stdout`. Subsequent reads from it will return its default value. public mutating func clearStdout() {_uniqueStorage()._stdout = nil} - /// Location where to find the standard error of the action - /// (e.g., a file path). public var stderr: BuildEventStream_File { get {return _storage._stderr ?? BuildEventStream_File()} set {_uniqueStorage()._stderr = newValue} @@ -1430,13 +1179,11 @@ public struct BuildEventStream_ActionExecuted { /// Clears the value of `stderr`. Subsequent reads from it will return its default value. public mutating func clearStderr() {_uniqueStorage()._stderr = nil} - /// Deprecated. This field is now present on ActionCompletedId. public var label: String { get {return _storage._label} set {_uniqueStorage()._label = newValue} } - /// Deprecated. This field is now present on ActionCompletedId. public var configuration: BuildEventStream_BuildEventId.ConfigurationId { get {return _storage._configuration ?? BuildEventStream_BuildEventId.ConfigurationId()} set {_uniqueStorage()._configuration = newValue} @@ -1446,7 +1193,6 @@ public struct BuildEventStream_ActionExecuted { /// Clears the value of `configuration`. Subsequent reads from it will return its default value. public mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} - /// Primary output; only provided for successful actions. public var primaryOutput: BuildEventStream_File { get {return _storage._primaryOutput ?? BuildEventStream_File()} set {_uniqueStorage()._primaryOutput = newValue} @@ -1456,21 +1202,18 @@ public struct BuildEventStream_ActionExecuted { /// Clears the value of `primaryOutput`. Subsequent reads from it will return its default value. public mutating func clearPrimaryOutput() {_uniqueStorage()._primaryOutput = nil} - /// The command-line of the action, if the action is a command. public var commandLine: [String] { get {return _storage._commandLine} set {_uniqueStorage()._commandLine = newValue} } - /// List of paths to log files public var actionMetadataLogs: [BuildEventStream_File] { get {return _storage._actionMetadataLogs} set {_uniqueStorage()._actionMetadataLogs = newValue} } - /// Only populated if success = false, and sometimes not even then. - public var failureDetail: FailureDetails_FailureDetail { - get {return _storage._failureDetail ?? FailureDetails_FailureDetail()} + public var failureDetail: src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail { + get {return _storage._failureDetail ?? src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail()} set {_uniqueStorage()._failureDetail = newValue} } /// Returns true if `failureDetail` has been explicitly set. @@ -1485,16 +1228,13 @@ public struct BuildEventStream_ActionExecuted { fileprivate var _storage = _StorageClass.defaultInstance } -/// Collection of all output files belonging to that output group. public struct BuildEventStream_OutputGroup { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Name of the output group public var name: String = String() - /// List of file sets that belong to this output group as well. public var fileSets: [BuildEventStream_BuildEventId.NamedSetOfFilesId] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1502,148 +1242,164 @@ public struct BuildEventStream_OutputGroup { public init() {} } -/// Payload of the event indicating the completion of a target. The target is -/// specified in the id. If the target failed the root causes are provided as -/// children events. public struct BuildEventStream_TargetComplete { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var success: Bool = false + public var success: Bool { + get {return _storage._success} + set {_uniqueStorage()._success = newValue} + } - /// The kind of target (e.g., e.g. "cc_library rule", "source file", - /// "generated file") where the completion is reported. - /// Deprecated: use the target_kind field in TargetConfigured instead. - public var targetKind: String = String() + public var targetKind: String { + get {return _storage._targetKind} + set {_uniqueStorage()._targetKind = newValue} + } - /// The size of the test, if the target is a test target. Unset otherwise. - /// Deprecated: use the test_size field in TargetConfigured instead. - public var testSize: BuildEventStream_TestSize = .unknown + public var testSize: BuildEventStream_TestSize { + get {return _storage._testSize} + set {_uniqueStorage()._testSize = newValue} + } - /// The output files are arranged by their output group. If an output file - /// is part of multiple output groups, it appears once in each output - /// group. - public var outputGroup: [BuildEventStream_OutputGroup] = [] + public var outputGroup: [BuildEventStream_OutputGroup] { + get {return _storage._outputGroup} + set {_uniqueStorage()._outputGroup = newValue} + } - /// Temporarily, also report the important outputs directly. This is only to - /// allow existing clients help transition to the deduplicated representation; - /// new clients should not use it. - public var importantOutput: [BuildEventStream_File] = [] + public var importantOutput: [BuildEventStream_File] { + get {return _storage._importantOutput} + set {_uniqueStorage()._importantOutput = newValue} + } - /// Report output artifacts (referenced transitively via output_group) which - /// emit directories instead of singleton files. These directory_output entries - /// will never include a uri. - public var directoryOutput: [BuildEventStream_File] = [] + public var directoryOutput: [BuildEventStream_File] { + get {return _storage._directoryOutput} + set {_uniqueStorage()._directoryOutput = newValue} + } - /// List of tags associated with this configured target. - public var tag: [String] = [] + public var tag: [String] { + get {return _storage._tag} + set {_uniqueStorage()._tag = newValue} + } - /// The timeout specified for test actions under this configured target. - public var testTimeoutSeconds: Int64 = 0 + public var testTimeoutSeconds: Int64 { + get {return _storage._testTimeoutSeconds} + set {_uniqueStorage()._testTimeoutSeconds = newValue} + } - /// Failure information about the target, only populated if success is false, - /// and sometimes not even then. Equal to one of the ActionExecuted - /// failure_detail fields for one of the root cause ActionExecuted events. - public var failureDetail: FailureDetails_FailureDetail { - get {return _failureDetail ?? FailureDetails_FailureDetail()} - set {_failureDetail = newValue} + public var failureDetail: src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail { + get {return _storage._failureDetail ?? src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail()} + set {_uniqueStorage()._failureDetail = newValue} } /// Returns true if `failureDetail` has been explicitly set. - public var hasFailureDetail: Bool {return self._failureDetail != nil} + public var hasFailureDetail: Bool {return _storage._failureDetail != nil} /// Clears the value of `failureDetail`. Subsequent reads from it will return its default value. - public mutating func clearFailureDetail() {self._failureDetail = nil} + public mutating func clearFailureDetail() {_uniqueStorage()._failureDetail = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} - fileprivate var _failureDetail: FailureDetails_FailureDetail? = nil + fileprivate var _storage = _StorageClass.defaultInstance } -/// Payload on events reporting about individual test action. public struct BuildEventStream_TestResult { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The status of this test. - public var status: BuildEventStream_TestStatus = .noStatus + public var status: BuildEventStream_TestStatus { + get {return _storage._status} + set {_uniqueStorage()._status = newValue} + } - /// Additional details about the status of the test. This is intended for - /// user display and must not be parsed. - public var statusDetails: String = String() + public var statusDetails: String { + get {return _storage._statusDetails} + set {_uniqueStorage()._statusDetails = newValue} + } - /// True, if the reported attempt is taken from the tool's local cache. - public var cachedLocally: Bool = false + public var cachedLocally: Bool { + get {return _storage._cachedLocally} + set {_uniqueStorage()._cachedLocally = newValue} + } - /// Time in milliseconds since the epoch at which the test attempt was started. - /// Note: for cached test results, this is time can be before the start of the - /// build. - public var testAttemptStartMillisEpoch: Int64 = 0 + public var testAttemptStartMillisEpoch: Int64 { + get {return _storage._testAttemptStartMillisEpoch} + set {_uniqueStorage()._testAttemptStartMillisEpoch = newValue} + } - /// Time the test took to run. For locally cached results, this is the time - /// the cached invocation took when it was invoked. - public var testAttemptDurationMillis: Int64 = 0 + public var testAttemptDurationMillis: Int64 { + get {return _storage._testAttemptDurationMillis} + set {_uniqueStorage()._testAttemptDurationMillis = newValue} + } - /// Files (logs, test.xml, undeclared outputs, etc) generated by that test - /// action. - public var testActionOutput: [BuildEventStream_File] = [] + public var testActionOutput: [BuildEventStream_File] { + get {return _storage._testActionOutput} + set {_uniqueStorage()._testActionOutput = newValue} + } - /// Warnings generated by that test action. - public var warning: [String] = [] + public var warning: [String] { + get {return _storage._warning} + set {_uniqueStorage()._warning = newValue} + } public var executionInfo: BuildEventStream_TestResult.ExecutionInfo { - get {return _executionInfo ?? BuildEventStream_TestResult.ExecutionInfo()} - set {_executionInfo = newValue} + get {return _storage._executionInfo ?? BuildEventStream_TestResult.ExecutionInfo()} + set {_uniqueStorage()._executionInfo = newValue} } /// Returns true if `executionInfo` has been explicitly set. - public var hasExecutionInfo: Bool {return self._executionInfo != nil} + public var hasExecutionInfo: Bool {return _storage._executionInfo != nil} /// Clears the value of `executionInfo`. Subsequent reads from it will return its default value. - public mutating func clearExecutionInfo() {self._executionInfo = nil} + public mutating func clearExecutionInfo() {_uniqueStorage()._executionInfo = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() - /// Message providing optional meta data on the execution of the test action, - /// if available. public struct ExecutionInfo { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Deprecated, use TargetComplete.test_timeout_seconds instead. - public var timeoutSeconds: Int32 = 0 + public var timeoutSeconds: Int32 { + get {return _storage._timeoutSeconds} + set {_uniqueStorage()._timeoutSeconds = newValue} + } - /// Name of the strategy to execute this test action (e.g., "local", - /// "remote") - public var strategy: String = String() + public var strategy: String { + get {return _storage._strategy} + set {_uniqueStorage()._strategy = newValue} + } - /// True, if the reported attempt was a cache hit in a remote cache. - public var cachedRemotely: Bool = false + public var cachedRemotely: Bool { + get {return _storage._cachedRemotely} + set {_uniqueStorage()._cachedRemotely = newValue} + } - /// The exit code of the test action. - public var exitCode: Int32 = 0 + public var exitCode: Int32 { + get {return _storage._exitCode} + set {_uniqueStorage()._exitCode = newValue} + } - /// The hostname of the machine where the test action was executed (in case - /// of remote execution), if known. - public var hostname: String = String() + public var hostname: String { + get {return _storage._hostname} + set {_uniqueStorage()._hostname = newValue} + } public var timingBreakdown: BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown { - get {return _timingBreakdown ?? BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown()} - set {_timingBreakdown = newValue} + get {return _storage._timingBreakdown ?? BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown()} + set {_uniqueStorage()._timingBreakdown = newValue} } /// Returns true if `timingBreakdown` has been explicitly set. - public var hasTimingBreakdown: Bool {return self._timingBreakdown != nil} + public var hasTimingBreakdown: Bool {return _storage._timingBreakdown != nil} /// Clears the value of `timingBreakdown`. Subsequent reads from it will return its default value. - public mutating func clearTimingBreakdown() {self._timingBreakdown = nil} + public mutating func clearTimingBreakdown() {_uniqueStorage()._timingBreakdown = nil} - public var resourceUsage: [BuildEventStream_TestResult.ExecutionInfo.ResourceUsage] = [] + public var resourceUsage: [BuildEventStream_TestResult.ExecutionInfo.ResourceUsage] { + get {return _storage._resourceUsage} + set {_uniqueStorage()._resourceUsage = newValue} + } public var unknownFields = SwiftProtobuf.UnknownStorage() - /// Represents a hierarchical timing breakdown of an activity. - /// The top level time should be the total time of the activity. - /// Invariant: time_millis >= sum of time_millis of all direct children. public struct TimingBreakdown { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1676,49 +1432,33 @@ public struct BuildEventStream_TestResult { public init() {} - fileprivate var _timingBreakdown: BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown? = nil + fileprivate var _storage = _StorageClass.defaultInstance } public init() {} - fileprivate var _executionInfo: BuildEventStream_TestResult.ExecutionInfo? = nil + fileprivate var _storage = _StorageClass.defaultInstance } -/// Payload of the event summarizing a test. public struct BuildEventStream_TestSummary { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Wrapper around BlazeTestStatus to support importing that enum to proto3. - /// Overall status of test, accumulated over all runs, shards, and attempts. public var overallStatus: BuildEventStream_TestStatus = .noStatus - /// Total number of runs public var totalRunCount: Int32 = 0 - /// Number of runs. - public var runCount: Int32 = 0 - - /// Number of shards. - public var shardCount: Int32 = 0 - - /// Path to logs of passed runs. public var passed: [BuildEventStream_File] = [] - /// Path to logs of failed runs; public var failed: [BuildEventStream_File] = [] - /// Total number of cached test actions public var totalNumCached: Int32 = 0 - /// When the test first started running. public var firstStartTimeMillis: Int64 = 0 - /// When the last test action completed. public var lastStopTimeMillis: Int64 = 0 - /// The total runtime of the test. public var totalRunDurationMillis: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1726,57 +1466,48 @@ public struct BuildEventStream_TestSummary { public init() {} } -/// Event indicating the end of a build. public struct BuildEventStream_BuildFinished { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// If the build succeeded or failed. - public var overallSuccess: Bool = false + public var overallSuccess: Bool { + get {return _storage._overallSuccess} + set {_uniqueStorage()._overallSuccess = newValue} + } - /// The overall status of the build. A build was successful iff - /// ExitCode.code equals 0. public var exitCode: BuildEventStream_BuildFinished.ExitCode { - get {return _exitCode ?? BuildEventStream_BuildFinished.ExitCode()} - set {_exitCode = newValue} + get {return _storage._exitCode ?? BuildEventStream_BuildFinished.ExitCode()} + set {_uniqueStorage()._exitCode = newValue} } /// Returns true if `exitCode` has been explicitly set. - public var hasExitCode: Bool {return self._exitCode != nil} + public var hasExitCode: Bool {return _storage._exitCode != nil} /// Clears the value of `exitCode`. Subsequent reads from it will return its default value. - public mutating func clearExitCode() {self._exitCode = nil} + public mutating func clearExitCode() {_uniqueStorage()._exitCode = nil} - /// Time in milliseconds since the epoch. - /// TODO(buchgr): Use google.protobuf.Timestamp once bazel's protoc supports - /// it. - public var finishTimeMillis: Int64 = 0 + public var finishTimeMillis: Int64 { + get {return _storage._finishTimeMillis} + set {_uniqueStorage()._finishTimeMillis = newValue} + } public var anomalyReport: BuildEventStream_BuildFinished.AnomalyReport { - get {return _anomalyReport ?? BuildEventStream_BuildFinished.AnomalyReport()} - set {_anomalyReport = newValue} + get {return _storage._anomalyReport ?? BuildEventStream_BuildFinished.AnomalyReport()} + set {_uniqueStorage()._anomalyReport = newValue} } /// Returns true if `anomalyReport` has been explicitly set. - public var hasAnomalyReport: Bool {return self._anomalyReport != nil} + public var hasAnomalyReport: Bool {return _storage._anomalyReport != nil} /// Clears the value of `anomalyReport`. Subsequent reads from it will return its default value. - public mutating func clearAnomalyReport() {self._anomalyReport = nil} + public mutating func clearAnomalyReport() {_uniqueStorage()._anomalyReport = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() - /// Exit code of a build. The possible values correspond to the predefined - /// codes in bazel's lib.ExitCode class, as well as any custom exit code a - /// module might define. The predefined exit codes are subject to change (but - /// rarely do) and are not part of the public API. - /// - /// A build was successful iff ExitCode.code equals 0. public struct ExitCode { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The name of the exit code. public var name: String = String() - /// The exit code. public var code: Int32 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1784,16 +1515,11 @@ public struct BuildEventStream_BuildFinished { public init() {} } - /// Things that happened during the build that could be of interest. public struct AnomalyReport { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Was the build suspended at any time during the build. - /// Examples of suspensions are SIGSTOP, or the hardware being put to sleep. - /// If was_suspended is true, then most of the timings for this build are - /// suspect. public var wasSuspended: Bool = false public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1803,8 +1529,7 @@ public struct BuildEventStream_BuildFinished { public init() {} - fileprivate var _exitCode: BuildEventStream_BuildFinished.ExitCode? = nil - fileprivate var _anomalyReport: BuildEventStream_BuildFinished.AnomalyReport? = nil + fileprivate var _storage = _StorageClass.defaultInstance } public struct BuildEventStream_BuildMetrics { @@ -1813,49 +1538,49 @@ public struct BuildEventStream_BuildMetrics { // methods supported on all messages. public var actionSummary: BuildEventStream_BuildMetrics.ActionSummary { - get {return _actionSummary ?? BuildEventStream_BuildMetrics.ActionSummary()} - set {_actionSummary = newValue} + get {return _storage._actionSummary ?? BuildEventStream_BuildMetrics.ActionSummary()} + set {_uniqueStorage()._actionSummary = newValue} } /// Returns true if `actionSummary` has been explicitly set. - public var hasActionSummary: Bool {return self._actionSummary != nil} + public var hasActionSummary: Bool {return _storage._actionSummary != nil} /// Clears the value of `actionSummary`. Subsequent reads from it will return its default value. - public mutating func clearActionSummary() {self._actionSummary = nil} + public mutating func clearActionSummary() {_uniqueStorage()._actionSummary = nil} public var memoryMetrics: BuildEventStream_BuildMetrics.MemoryMetrics { - get {return _memoryMetrics ?? BuildEventStream_BuildMetrics.MemoryMetrics()} - set {_memoryMetrics = newValue} + get {return _storage._memoryMetrics ?? BuildEventStream_BuildMetrics.MemoryMetrics()} + set {_uniqueStorage()._memoryMetrics = newValue} } /// Returns true if `memoryMetrics` has been explicitly set. - public var hasMemoryMetrics: Bool {return self._memoryMetrics != nil} + public var hasMemoryMetrics: Bool {return _storage._memoryMetrics != nil} /// Clears the value of `memoryMetrics`. Subsequent reads from it will return its default value. - public mutating func clearMemoryMetrics() {self._memoryMetrics = nil} + public mutating func clearMemoryMetrics() {_uniqueStorage()._memoryMetrics = nil} public var targetMetrics: BuildEventStream_BuildMetrics.TargetMetrics { - get {return _targetMetrics ?? BuildEventStream_BuildMetrics.TargetMetrics()} - set {_targetMetrics = newValue} + get {return _storage._targetMetrics ?? BuildEventStream_BuildMetrics.TargetMetrics()} + set {_uniqueStorage()._targetMetrics = newValue} } /// Returns true if `targetMetrics` has been explicitly set. - public var hasTargetMetrics: Bool {return self._targetMetrics != nil} + public var hasTargetMetrics: Bool {return _storage._targetMetrics != nil} /// Clears the value of `targetMetrics`. Subsequent reads from it will return its default value. - public mutating func clearTargetMetrics() {self._targetMetrics = nil} + public mutating func clearTargetMetrics() {_uniqueStorage()._targetMetrics = nil} public var packageMetrics: BuildEventStream_BuildMetrics.PackageMetrics { - get {return _packageMetrics ?? BuildEventStream_BuildMetrics.PackageMetrics()} - set {_packageMetrics = newValue} + get {return _storage._packageMetrics ?? BuildEventStream_BuildMetrics.PackageMetrics()} + set {_uniqueStorage()._packageMetrics = newValue} } /// Returns true if `packageMetrics` has been explicitly set. - public var hasPackageMetrics: Bool {return self._packageMetrics != nil} + public var hasPackageMetrics: Bool {return _storage._packageMetrics != nil} /// Clears the value of `packageMetrics`. Subsequent reads from it will return its default value. - public mutating func clearPackageMetrics() {self._packageMetrics = nil} + public mutating func clearPackageMetrics() {_uniqueStorage()._packageMetrics = nil} public var timingMetrics: BuildEventStream_BuildMetrics.TimingMetrics { - get {return _timingMetrics ?? BuildEventStream_BuildMetrics.TimingMetrics()} - set {_timingMetrics = newValue} + get {return _storage._timingMetrics ?? BuildEventStream_BuildMetrics.TimingMetrics()} + set {_uniqueStorage()._timingMetrics = newValue} } /// Returns true if `timingMetrics` has been explicitly set. - public var hasTimingMetrics: Bool {return self._timingMetrics != nil} + public var hasTimingMetrics: Bool {return _storage._timingMetrics != nil} /// Clears the value of `timingMetrics`. Subsequent reads from it will return its default value. - public mutating func clearTimingMetrics() {self._timingMetrics = nil} + public mutating func clearTimingMetrics() {_uniqueStorage()._timingMetrics = nil} public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1864,14 +1589,8 @@ public struct BuildEventStream_BuildMetrics { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The total number of actions created and registered during the build. - /// This includes unused actions that were constructed but - /// not executed during this build. public var actionsCreated: Int64 = 0 - /// The total number of actions executed during the build. - /// This includes any remote cache hits, but excludes - /// local action cache hits. public var actionsExecuted: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1884,13 +1603,8 @@ public struct BuildEventStream_BuildMetrics { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Size of the JVM heap post build in bytes. This is only collected if - /// --bep_publish_used_heap_size_post_build is set, - /// since it forces a full GC. public var usedHeapSizePostBuild: Int64 = 0 - /// Size of the peak JVM heap size in bytes post GC. Note that this reports 0 - /// if there was no major GC during the build. public var peakPostGcHeapSize: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1903,12 +1617,8 @@ public struct BuildEventStream_BuildMetrics { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Number of targets loaded during this build. public var targetsLoaded: Int64 = 0 - /// Number of targets configured during this build. This can - /// be greater than targets_loaded if the same target is configured - /// multiple times. public var targetsConfigured: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1921,7 +1631,6 @@ public struct BuildEventStream_BuildMetrics { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Number of BUILD files (aka packages) loaded during this build. public var packagesLoaded: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1934,10 +1643,8 @@ public struct BuildEventStream_BuildMetrics { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The CPU time in milliseconds consumed during this build. public var cpuTimeInMs: Int64 = 0 - /// The elapsed wall time in milliseconds during this build. public var wallTimeInMs: Int64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1947,14 +1654,9 @@ public struct BuildEventStream_BuildMetrics { public init() {} - fileprivate var _actionSummary: BuildEventStream_BuildMetrics.ActionSummary? = nil - fileprivate var _memoryMetrics: BuildEventStream_BuildMetrics.MemoryMetrics? = nil - fileprivate var _targetMetrics: BuildEventStream_BuildMetrics.TargetMetrics? = nil - fileprivate var _packageMetrics: BuildEventStream_BuildMetrics.PackageMetrics? = nil - fileprivate var _timingMetrics: BuildEventStream_BuildMetrics.TimingMetrics? = nil + fileprivate var _storage = _StorageClass.defaultInstance } -/// Event providing additional statistics/logs after completion of the build. public struct BuildEventStream_BuildToolLogs { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1967,12 +1669,6 @@ public struct BuildEventStream_BuildToolLogs { public init() {} } -/// Event describing all convenience symlinks (i.e., workspace symlinks) to be -/// created or deleted once the execution phase has begun. Note that this event -/// does not say anything about whether or not the build tool actually executed -/// these filesystem operations; it only says what logical operations should be -/// performed. This event is emitted exactly once per build; if no symlinks are -/// to be modified, the event is still emitted with empty contents. public struct BuildEventStream_ConvenienceSymlinksIdentified { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1985,27 +1681,15 @@ public struct BuildEventStream_ConvenienceSymlinksIdentified { public init() {} } -/// The message that contains what type of action to perform on a given path and -/// target of a symlink. public struct BuildEventStream_ConvenienceSymlink { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The path of the symlink to be created or deleted, absolute or relative to - /// the workspace, creating any directories necessary. If a symlink already - /// exists at that location, then it should be replaced by a symlink pointing - /// to the new target. public var path: String = String() - /// The operation we are performing on the symlink. public var action: BuildEventStream_ConvenienceSymlink.Action = .unknown - /// If action is CREATE, this is the target path that the symlink should point - /// to. If the path points underneath the output base, it is relative to the - /// output base; otherwise it is absolute. - /// - /// If action is DELETE, this field is not set. public var target: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -2013,12 +1697,7 @@ public struct BuildEventStream_ConvenienceSymlink { public enum Action: SwiftProtobuf.Enum { public typealias RawValue = Int case unknown // = 0 - - /// Indicates a symlink should be created, or overwritten if it already - /// exists. case create // = 1 - - /// Indicates a symlink should be deleted if it already exists. case delete // = 2 case UNRECOGNIZED(Int) @@ -2062,11 +1741,6 @@ extension BuildEventStream_ConvenienceSymlink.Action: CaseIterable { #endif // swift(>=4.2) -/// Message describing a build event. Events will have an identifier that -/// is unique within a given build invocation; they also announce follow-up -/// events as children. More details, which are specific to the kind of event -/// that is observed, is provided in the payload. More options for the payload -/// might be added in the future. public struct BuildEventStream_BuildEvent { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -2128,10 +1802,10 @@ public struct BuildEventStream_BuildEvent { set {_uniqueStorage()._payload = .unstructuredCommandLine(newValue)} } - public var structuredCommandLine: CommandLine_CommandLine { + public var structuredCommandLine: src_main_protobuf_command_line_proto.CommandLine_CommandLine { get { if case .structuredCommandLine(let v)? = _storage._payload {return v} - return CommandLine_CommandLine() + return src_main_protobuf_command_line_proto.CommandLine_CommandLine() } set {_uniqueStorage()._payload = .structuredCommandLine(newValue)} } @@ -2279,7 +1953,7 @@ public struct BuildEventStream_BuildEvent { case aborted(BuildEventStream_Aborted) case started(BuildEventStream_BuildStarted) case unstructuredCommandLine(BuildEventStream_UnstructuredCommandLine) - case structuredCommandLine(CommandLine_CommandLine) + case structuredCommandLine(src_main_protobuf_command_line_proto.CommandLine_CommandLine) case optionsParsed(BuildEventStream_OptionsParsed) case workspaceStatus(BuildEventStream_WorkspaceStatus) case fetch(BuildEventStream_Fetch) @@ -2300,98 +1974,29 @@ public struct BuildEventStream_BuildEvent { #if !swift(>=4.1) public static func ==(lhs: BuildEventStream_BuildEvent.OneOf_Payload, rhs: BuildEventStream_BuildEvent.OneOf_Payload) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.progress, .progress): return { - guard case .progress(let l) = lhs, case .progress(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.aborted, .aborted): return { - guard case .aborted(let l) = lhs, case .aborted(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.started, .started): return { - guard case .started(let l) = lhs, case .started(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.unstructuredCommandLine, .unstructuredCommandLine): return { - guard case .unstructuredCommandLine(let l) = lhs, case .unstructuredCommandLine(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.structuredCommandLine, .structuredCommandLine): return { - guard case .structuredCommandLine(let l) = lhs, case .structuredCommandLine(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.optionsParsed, .optionsParsed): return { - guard case .optionsParsed(let l) = lhs, case .optionsParsed(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.workspaceStatus, .workspaceStatus): return { - guard case .workspaceStatus(let l) = lhs, case .workspaceStatus(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.fetch, .fetch): return { - guard case .fetch(let l) = lhs, case .fetch(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.configuration, .configuration): return { - guard case .configuration(let l) = lhs, case .configuration(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.expanded, .expanded): return { - guard case .expanded(let l) = lhs, case .expanded(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.configured, .configured): return { - guard case .configured(let l) = lhs, case .configured(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.action, .action): return { - guard case .action(let l) = lhs, case .action(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.namedSetOfFiles, .namedSetOfFiles): return { - guard case .namedSetOfFiles(let l) = lhs, case .namedSetOfFiles(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.completed, .completed): return { - guard case .completed(let l) = lhs, case .completed(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.testResult, .testResult): return { - guard case .testResult(let l) = lhs, case .testResult(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.testSummary, .testSummary): return { - guard case .testSummary(let l) = lhs, case .testSummary(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.finished, .finished): return { - guard case .finished(let l) = lhs, case .finished(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.buildToolLogs, .buildToolLogs): return { - guard case .buildToolLogs(let l) = lhs, case .buildToolLogs(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.buildMetrics, .buildMetrics): return { - guard case .buildMetrics(let l) = lhs, case .buildMetrics(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.workspaceInfo, .workspaceInfo): return { - guard case .workspaceInfo(let l) = lhs, case .workspaceInfo(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.buildMetadata, .buildMetadata): return { - guard case .buildMetadata(let l) = lhs, case .buildMetadata(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.convenienceSymlinksIdentified, .convenienceSymlinksIdentified): return { - guard case .convenienceSymlinksIdentified(let l) = lhs, case .convenienceSymlinksIdentified(let r) = rhs else { preconditionFailure() } - return l == r - }() + case (.progress(let l), .progress(let r)): return l == r + case (.aborted(let l), .aborted(let r)): return l == r + case (.started(let l), .started(let r)): return l == r + case (.unstructuredCommandLine(let l), .unstructuredCommandLine(let r)): return l == r + case (.structuredCommandLine(let l), .structuredCommandLine(let r)): return l == r + case (.optionsParsed(let l), .optionsParsed(let r)): return l == r + case (.workspaceStatus(let l), .workspaceStatus(let r)): return l == r + case (.fetch(let l), .fetch(let r)): return l == r + case (.configuration(let l), .configuration(let r)): return l == r + case (.expanded(let l), .expanded(let r)): return l == r + case (.configured(let l), .configured(let r)): return l == r + case (.action(let l), .action(let r)): return l == r + case (.namedSetOfFiles(let l), .namedSetOfFiles(let r)): return l == r + case (.completed(let l), .completed(let r)): return l == r + case (.testResult(let l), .testResult(let r)): return l == r + case (.testSummary(let l), .testSummary(let r)): return l == r + case (.finished(let l), .finished(let r)): return l == r + case (.buildToolLogs(let l), .buildToolLogs(let r)): return l == r + case (.buildMetrics(let l), .buildMetrics(let r)): return l == r + case (.workspaceInfo(let l), .workspaceInfo(let r)): return l == r + case (.buildMetadata(let l), .buildMetadata(let r)): return l == r + case (.convenienceSymlinksIdentified(let l), .convenienceSymlinksIdentified(let r)): return l == r default: return false } } @@ -2461,505 +2066,349 @@ extension BuildEventStream_BuildEventId: SwiftProtobuf.Message, SwiftProtobuf._M 25: .standard(proto: "convenience_symlinks_identified"), ] - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: BuildEventStream_BuildEventId.UnknownBuildEventId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .unknown(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .unknown(v) - } - }() - case 2: try { - var v: BuildEventStream_BuildEventId.ProgressId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .progress(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .progress(v) - } - }() - case 3: try { - var v: BuildEventStream_BuildEventId.BuildStartedId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .started(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .started(v) - } - }() - case 4: try { - var v: BuildEventStream_BuildEventId.PatternExpandedId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .pattern(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .pattern(v) - } - }() - case 5: try { - var v: BuildEventStream_BuildEventId.TargetCompletedId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .targetCompleted(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .targetCompleted(v) - } - }() - case 6: try { - var v: BuildEventStream_BuildEventId.ActionCompletedId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .actionCompleted(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .actionCompleted(v) - } - }() - case 7: try { - var v: BuildEventStream_BuildEventId.TestSummaryId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .testSummary(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .testSummary(v) - } - }() - case 8: try { - var v: BuildEventStream_BuildEventId.TestResultId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .testResult(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .testResult(v) - } - }() - case 9: try { - var v: BuildEventStream_BuildEventId.BuildFinishedId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .buildFinished(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .buildFinished(v) - } - }() - case 10: try { - var v: BuildEventStream_BuildEventId.PatternExpandedId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .patternSkipped(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .patternSkipped(v) - } - }() - case 11: try { - var v: BuildEventStream_BuildEventId.UnstructuredCommandLineId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .unstructuredCommandLine(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .unstructuredCommandLine(v) - } - }() - case 12: try { - var v: BuildEventStream_BuildEventId.OptionsParsedId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .optionsParsed(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .optionsParsed(v) - } - }() - case 13: try { - var v: BuildEventStream_BuildEventId.NamedSetOfFilesId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .namedSet(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .namedSet(v) - } - }() - case 14: try { - var v: BuildEventStream_BuildEventId.WorkspaceStatusId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .workspaceStatus(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .workspaceStatus(v) - } - }() - case 15: try { - var v: BuildEventStream_BuildEventId.ConfigurationId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .configuration(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .configuration(v) - } - }() - case 16: try { - var v: BuildEventStream_BuildEventId.TargetConfiguredId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .targetConfigured(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .targetConfigured(v) - } - }() - case 17: try { - var v: BuildEventStream_BuildEventId.FetchId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .fetch(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .fetch(v) - } - }() - case 18: try { - var v: BuildEventStream_BuildEventId.StructuredCommandLineId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .structuredCommandLine(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .structuredCommandLine(v) - } - }() - case 19: try { - var v: BuildEventStream_BuildEventId.UnconfiguredLabelId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .unconfiguredLabel(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .unconfiguredLabel(v) - } - }() - case 20: try { - var v: BuildEventStream_BuildEventId.BuildToolLogsId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .buildToolLogs(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .buildToolLogs(v) - } - }() - case 21: try { - var v: BuildEventStream_BuildEventId.ConfiguredLabelId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .configuredLabel(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .configuredLabel(v) - } - }() - case 22: try { - var v: BuildEventStream_BuildEventId.BuildMetricsId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .buildMetrics(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .buildMetrics(v) - } - }() - case 23: try { - var v: BuildEventStream_BuildEventId.WorkspaceConfigId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .workspace(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .workspace(v) - } - }() - case 24: try { - var v: BuildEventStream_BuildEventId.BuildMetadataId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .buildMetadata(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .buildMetadata(v) - } - }() - case 25: try { - var v: BuildEventStream_BuildEventId.ConvenienceSymlinksIdentifiedId? - var hadOneofValue = false - if let current = self.id { - hadOneofValue = true - if case .convenienceSymlinksIdentified(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.id = .convenienceSymlinksIdentified(v) - } - }() - default: break - } - } - } + fileprivate class _StorageClass { + var _id: BuildEventStream_BuildEventId.OneOf_ID? - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.id { - case .unknown?: try { - guard case .unknown(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .progress?: try { - guard case .progress(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .started?: try { - guard case .started(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .pattern?: try { - guard case .pattern(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case .targetCompleted?: try { - guard case .targetCompleted(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - }() - case .actionCompleted?: try { - guard case .actionCompleted(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - }() - case .testSummary?: try { - guard case .testSummary(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - }() - case .testResult?: try { - guard case .testResult(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - }() - case .buildFinished?: try { - guard case .buildFinished(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - }() - case .patternSkipped?: try { - guard case .patternSkipped(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - }() - case .unstructuredCommandLine?: try { - guard case .unstructuredCommandLine(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - }() - case .optionsParsed?: try { - guard case .optionsParsed(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - }() - case .namedSet?: try { - guard case .namedSet(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 13) - }() - case .workspaceStatus?: try { - guard case .workspaceStatus(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 14) - }() - case .configuration?: try { - guard case .configuration(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - }() - case .targetConfigured?: try { - guard case .targetConfigured(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 16) - }() - case .fetch?: try { - guard case .fetch(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 17) - }() - case .structuredCommandLine?: try { - guard case .structuredCommandLine(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 18) - }() - case .unconfiguredLabel?: try { - guard case .unconfiguredLabel(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 19) - }() - case .buildToolLogs?: try { - guard case .buildToolLogs(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 20) - }() - case .configuredLabel?: try { - guard case .configuredLabel(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 21) - }() - case .buildMetrics?: try { - guard case .buildMetrics(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 22) - }() - case .workspace?: try { - guard case .workspace(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 23) - }() - case .buildMetadata?: try { - guard case .buildMetadata(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 24) - }() - case .convenienceSymlinksIdentified?: try { - guard case .convenienceSymlinksIdentified(let v)? = self.id else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 25) - }() - case nil: break + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _id = source._id } - try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: BuildEventStream_BuildEventId, rhs: BuildEventStream_BuildEventId) -> Bool { - if lhs.id != rhs.id {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage } -} - -extension BuildEventStream_BuildEventId.UnknownBuildEventId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = BuildEventStream_BuildEventId.protoMessageName + ".UnknownBuildEventId" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "details"), - ] public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.details) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: + var v: BuildEventStream_BuildEventId.UnknownBuildEventId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .unknown(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .unknown(v)} + case 2: + var v: BuildEventStream_BuildEventId.ProgressId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .progress(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .progress(v)} + case 3: + var v: BuildEventStream_BuildEventId.BuildStartedId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .started(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .started(v)} + case 4: + var v: BuildEventStream_BuildEventId.PatternExpandedId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .pattern(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .pattern(v)} + case 5: + var v: BuildEventStream_BuildEventId.TargetCompletedId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .targetCompleted(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .targetCompleted(v)} + case 6: + var v: BuildEventStream_BuildEventId.ActionCompletedId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .actionCompleted(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .actionCompleted(v)} + case 7: + var v: BuildEventStream_BuildEventId.TestSummaryId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .testSummary(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .testSummary(v)} + case 8: + var v: BuildEventStream_BuildEventId.TestResultId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .testResult(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .testResult(v)} + case 9: + var v: BuildEventStream_BuildEventId.BuildFinishedId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .buildFinished(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .buildFinished(v)} + case 10: + var v: BuildEventStream_BuildEventId.PatternExpandedId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .patternSkipped(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .patternSkipped(v)} + case 11: + var v: BuildEventStream_BuildEventId.UnstructuredCommandLineId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .unstructuredCommandLine(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .unstructuredCommandLine(v)} + case 12: + var v: BuildEventStream_BuildEventId.OptionsParsedId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .optionsParsed(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .optionsParsed(v)} + case 13: + var v: BuildEventStream_BuildEventId.NamedSetOfFilesId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .namedSet(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .namedSet(v)} + case 14: + var v: BuildEventStream_BuildEventId.WorkspaceStatusId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .workspaceStatus(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .workspaceStatus(v)} + case 15: + var v: BuildEventStream_BuildEventId.ConfigurationId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .configuration(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .configuration(v)} + case 16: + var v: BuildEventStream_BuildEventId.TargetConfiguredId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .targetConfigured(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .targetConfigured(v)} + case 17: + var v: BuildEventStream_BuildEventId.FetchId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .fetch(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .fetch(v)} + case 18: + var v: BuildEventStream_BuildEventId.StructuredCommandLineId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .structuredCommandLine(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .structuredCommandLine(v)} + case 19: + var v: BuildEventStream_BuildEventId.UnconfiguredLabelId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .unconfiguredLabel(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .unconfiguredLabel(v)} + case 20: + var v: BuildEventStream_BuildEventId.BuildToolLogsId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .buildToolLogs(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .buildToolLogs(v)} + case 21: + var v: BuildEventStream_BuildEventId.ConfiguredLabelId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .configuredLabel(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .configuredLabel(v)} + case 22: + var v: BuildEventStream_BuildEventId.BuildMetricsId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .buildMetrics(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .buildMetrics(v)} + case 23: + var v: BuildEventStream_BuildEventId.WorkspaceConfigId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .workspace(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .workspace(v)} + case 24: + var v: BuildEventStream_BuildEventId.BuildMetadataId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .buildMetadata(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .buildMetadata(v)} + case 25: + var v: BuildEventStream_BuildEventId.ConvenienceSymlinksIdentifiedId? + if let current = _storage._id { + try decoder.handleConflictingOneOf() + if case .convenienceSymlinksIdentified(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._id = .convenienceSymlinksIdentified(v)} + default: break + } } } } public func traverse(visitor: inout V) throws { - if !self.details.isEmpty { - try visitor.visitSingularStringField(value: self.details, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: BuildEventStream_BuildEventId.UnknownBuildEventId, rhs: BuildEventStream_BuildEventId.UnknownBuildEventId) -> Bool { - if lhs.details != rhs.details {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension BuildEventStream_BuildEventId.ProgressId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = BuildEventStream_BuildEventId.protoMessageName + ".ProgressId" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "opaque_count"), + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + switch _storage._id { + case .unknown(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + case .progress(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + case .started(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + case .pattern(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + case .targetCompleted(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + case .actionCompleted(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + case .testSummary(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + case .testResult(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + case .buildFinished(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + case .patternSkipped(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + case .unstructuredCommandLine(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + case .optionsParsed(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + case .namedSet(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 13) + case .workspaceStatus(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 14) + case .configuration(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + case .targetConfigured(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 16) + case .fetch(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 17) + case .structuredCommandLine(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 18) + case .unconfiguredLabel(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 19) + case .buildToolLogs(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 20) + case .configuredLabel(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 21) + case .buildMetrics(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 22) + case .workspace(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 23) + case .buildMetadata(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 24) + case .convenienceSymlinksIdentified(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 25) + case nil: break + } + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: BuildEventStream_BuildEventId, rhs: BuildEventStream_BuildEventId) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._id != rhs_storage._id {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension BuildEventStream_BuildEventId.UnknownBuildEventId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = BuildEventStream_BuildEventId.protoMessageName + ".UnknownBuildEventId" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "details"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularInt32Field(value: &self.opaqueCount) }() + case 1: try decoder.decodeSingularStringField(value: &self.details) + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.details.isEmpty { + try visitor.visitSingularStringField(value: self.details, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: BuildEventStream_BuildEventId.UnknownBuildEventId, rhs: BuildEventStream_BuildEventId.UnknownBuildEventId) -> Bool { + if lhs.details != rhs.details {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension BuildEventStream_BuildEventId.ProgressId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = BuildEventStream_BuildEventId.protoMessageName + ".ProgressId" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "opaque_count"), + ] + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularInt32Field(value: &self.opaqueCount) default: break } } @@ -3025,11 +2474,8 @@ extension BuildEventStream_BuildEventId.StructuredCommandLineId: SwiftProtobuf.M public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.commandLineLabel) }() + case 1: try decoder.decodeSingularStringField(value: &self.commandLineLabel) default: break } } @@ -3095,11 +2541,8 @@ extension BuildEventStream_BuildEventId.FetchId: SwiftProtobuf.Message, SwiftPro public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.url) }() + case 1: try decoder.decodeSingularStringField(value: &self.url) default: break } } @@ -3127,11 +2570,8 @@ extension BuildEventStream_BuildEventId.PatternExpandedId: SwiftProtobuf.Message public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.pattern) }() + case 1: try decoder.decodeRepeatedStringField(value: &self.pattern) default: break } } @@ -3198,12 +2638,9 @@ extension BuildEventStream_BuildEventId.TargetConfiguredId: SwiftProtobuf.Messag public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.aspect) }() + case 1: try decoder.decodeSingularStringField(value: &self.label) + case 2: try decoder.decodeSingularStringField(value: &self.aspect) default: break } } @@ -3235,11 +2672,8 @@ extension BuildEventStream_BuildEventId.NamedSetOfFilesId: SwiftProtobuf.Message public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.id) }() + case 1: try decoder.decodeSingularStringField(value: &self.id) default: break } } @@ -3267,11 +2701,8 @@ extension BuildEventStream_BuildEventId.ConfigurationId: SwiftProtobuf.Message, public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.id) }() + case 1: try decoder.decodeSingularStringField(value: &self.id) default: break } } @@ -3299,41 +2730,70 @@ extension BuildEventStream_BuildEventId.TargetCompletedId: SwiftProtobuf.Message 2: .same(proto: "aspect"), ] + fileprivate class _StorageClass { + var _label: String = String() + var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil + var _aspect: String = String() + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _label = source._label + _configuration = source._configuration + _aspect = source._aspect + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.aspect) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._configuration) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularStringField(value: &_storage._label) + case 2: try decoder.decodeSingularStringField(value: &_storage._aspect) + case 3: try decoder.decodeSingularMessageField(value: &_storage._configuration) + default: break + } } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.label.isEmpty { - try visitor.visitSingularStringField(value: self.label, fieldNumber: 1) - } - if !self.aspect.isEmpty { - try visitor.visitSingularStringField(value: self.aspect, fieldNumber: 2) + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._label.isEmpty { + try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 1) + } + if !_storage._aspect.isEmpty { + try visitor.visitSingularStringField(value: _storage._aspect, fieldNumber: 2) + } + if let v = _storage._configuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } } - try { if let v = self._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildEventId.TargetCompletedId, rhs: BuildEventStream_BuildEventId.TargetCompletedId) -> Bool { - if lhs.label != rhs.label {return false} - if lhs._configuration != rhs._configuration {return false} - if lhs.aspect != rhs.aspect {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._label != rhs_storage._label {return false} + if _storage._configuration != rhs_storage._configuration {return false} + if _storage._aspect != rhs_storage._aspect {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3347,41 +2807,70 @@ extension BuildEventStream_BuildEventId.ActionCompletedId: SwiftProtobuf.Message 3: .same(proto: "configuration"), ] + fileprivate class _StorageClass { + var _primaryOutput: String = String() + var _label: String = String() + var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _primaryOutput = source._primaryOutput + _label = source._label + _configuration = source._configuration + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.primaryOutput) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.label) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._configuration) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularStringField(value: &_storage._primaryOutput) + case 2: try decoder.decodeSingularStringField(value: &_storage._label) + case 3: try decoder.decodeSingularMessageField(value: &_storage._configuration) + default: break + } } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.primaryOutput.isEmpty { - try visitor.visitSingularStringField(value: self.primaryOutput, fieldNumber: 1) - } - if !self.label.isEmpty { - try visitor.visitSingularStringField(value: self.label, fieldNumber: 2) + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._primaryOutput.isEmpty { + try visitor.visitSingularStringField(value: _storage._primaryOutput, fieldNumber: 1) + } + if !_storage._label.isEmpty { + try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 2) + } + if let v = _storage._configuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } } - try { if let v = self._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildEventId.ActionCompletedId, rhs: BuildEventStream_BuildEventId.ActionCompletedId) -> Bool { - if lhs.primaryOutput != rhs.primaryOutput {return false} - if lhs.label != rhs.label {return false} - if lhs._configuration != rhs._configuration {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._primaryOutput != rhs_storage._primaryOutput {return false} + if _storage._label != rhs_storage._label {return false} + if _storage._configuration != rhs_storage._configuration {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3395,11 +2884,8 @@ extension BuildEventStream_BuildEventId.UnconfiguredLabelId: SwiftProtobuf.Messa public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() + case 1: try decoder.decodeSingularStringField(value: &self.label) default: break } } @@ -3426,36 +2912,63 @@ extension BuildEventStream_BuildEventId.ConfiguredLabelId: SwiftProtobuf.Message 2: .same(proto: "configuration"), ] + fileprivate class _StorageClass { + var _label: String = String() + var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _label = source._label + _configuration = source._configuration + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._configuration) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularStringField(value: &_storage._label) + case 2: try decoder.decodeSingularMessageField(value: &_storage._configuration) + default: break + } } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.label.isEmpty { - try visitor.visitSingularStringField(value: self.label, fieldNumber: 1) + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._label.isEmpty { + try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 1) + } + if let v = _storage._configuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } } - try { if let v = self._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildEventId.ConfiguredLabelId, rhs: BuildEventStream_BuildEventId.ConfiguredLabelId) -> Bool { - if lhs.label != rhs.label {return false} - if lhs._configuration != rhs._configuration {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._label != rhs_storage._label {return false} + if _storage._configuration != rhs_storage._configuration {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3471,51 +2984,84 @@ extension BuildEventStream_BuildEventId.TestResultId: SwiftProtobuf.Message, Swi 4: .same(proto: "attempt"), ] + fileprivate class _StorageClass { + var _label: String = String() + var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil + var _run: Int32 = 0 + var _shard: Int32 = 0 + var _attempt: Int32 = 0 + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _label = source._label + _configuration = source._configuration + _run = source._run + _shard = source._shard + _attempt = source._attempt + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &self.run) }() - case 3: try { try decoder.decodeSingularInt32Field(value: &self.shard) }() - case 4: try { try decoder.decodeSingularInt32Field(value: &self.attempt) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._configuration) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularStringField(value: &_storage._label) + case 2: try decoder.decodeSingularInt32Field(value: &_storage._run) + case 3: try decoder.decodeSingularInt32Field(value: &_storage._shard) + case 4: try decoder.decodeSingularInt32Field(value: &_storage._attempt) + case 5: try decoder.decodeSingularMessageField(value: &_storage._configuration) + default: break + } } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.label.isEmpty { - try visitor.visitSingularStringField(value: self.label, fieldNumber: 1) - } - if self.run != 0 { - try visitor.visitSingularInt32Field(value: self.run, fieldNumber: 2) - } - if self.shard != 0 { - try visitor.visitSingularInt32Field(value: self.shard, fieldNumber: 3) - } - if self.attempt != 0 { - try visitor.visitSingularInt32Field(value: self.attempt, fieldNumber: 4) + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._label.isEmpty { + try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 1) + } + if _storage._run != 0 { + try visitor.visitSingularInt32Field(value: _storage._run, fieldNumber: 2) + } + if _storage._shard != 0 { + try visitor.visitSingularInt32Field(value: _storage._shard, fieldNumber: 3) + } + if _storage._attempt != 0 { + try visitor.visitSingularInt32Field(value: _storage._attempt, fieldNumber: 4) + } + if let v = _storage._configuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } } - try { if let v = self._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildEventId.TestResultId, rhs: BuildEventStream_BuildEventId.TestResultId) -> Bool { - if lhs.label != rhs.label {return false} - if lhs._configuration != rhs._configuration {return false} - if lhs.run != rhs.run {return false} - if lhs.shard != rhs.shard {return false} - if lhs.attempt != rhs.attempt {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._label != rhs_storage._label {return false} + if _storage._configuration != rhs_storage._configuration {return false} + if _storage._run != rhs_storage._run {return false} + if _storage._shard != rhs_storage._shard {return false} + if _storage._attempt != rhs_storage._attempt {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3528,36 +3074,63 @@ extension BuildEventStream_BuildEventId.TestSummaryId: SwiftProtobuf.Message, Sw 2: .same(proto: "configuration"), ] + fileprivate class _StorageClass { + var _label: String = String() + var _configuration: BuildEventStream_BuildEventId.ConfigurationId? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _label = source._label + _configuration = source._configuration + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.label) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._configuration) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularStringField(value: &_storage._label) + case 2: try decoder.decodeSingularMessageField(value: &_storage._configuration) + default: break + } } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.label.isEmpty { - try visitor.visitSingularStringField(value: self.label, fieldNumber: 1) + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._label.isEmpty { + try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 1) + } + if let v = _storage._configuration { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } } - try { if let v = self._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildEventId.TestSummaryId, rhs: BuildEventStream_BuildEventId.TestSummaryId) -> Bool { - if lhs.label != rhs.label {return false} - if lhs._configuration != rhs._configuration {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._label != rhs_storage._label {return false} + if _storage._configuration != rhs_storage._configuration {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3648,12 +3221,9 @@ extension BuildEventStream_Progress: SwiftProtobuf.Message, SwiftProtobuf._Messa public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.stdout) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.stderr) }() + case 1: try decoder.decodeSingularStringField(value: &self.stdout) + case 2: try decoder.decodeSingularStringField(value: &self.stderr) default: break } } @@ -3686,12 +3256,9 @@ extension BuildEventStream_Aborted: SwiftProtobuf.Message, SwiftProtobuf._Messag public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.reason) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.description_p) }() + case 1: try decoder.decodeSingularEnumField(value: &self.reason) + case 2: try decoder.decodeSingularStringField(value: &self.description_p) default: break } } @@ -3728,7 +3295,6 @@ extension BuildEventStream_Aborted.AbortReason: SwiftProtobuf._ProtoNameProvidin 8: .same(proto: "NO_ANALYZE"), 9: .same(proto: "NO_BUILD"), 10: .same(proto: "INCOMPLETE"), - 11: .same(proto: "OUT_OF_MEMORY"), ] } @@ -3747,18 +3313,15 @@ extension BuildEventStream_BuildStarted: SwiftProtobuf.Message, SwiftProtobuf._M public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.uuid) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.startTimeMillis) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.buildToolVersion) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.optionsDescription) }() - case 5: try { try decoder.decodeSingularStringField(value: &self.command) }() - case 6: try { try decoder.decodeSingularStringField(value: &self.workingDirectory) }() - case 7: try { try decoder.decodeSingularStringField(value: &self.workspaceDirectory) }() - case 8: try { try decoder.decodeSingularInt64Field(value: &self.serverPid) }() + case 1: try decoder.decodeSingularStringField(value: &self.uuid) + case 2: try decoder.decodeSingularInt64Field(value: &self.startTimeMillis) + case 3: try decoder.decodeSingularStringField(value: &self.buildToolVersion) + case 4: try decoder.decodeSingularStringField(value: &self.optionsDescription) + case 5: try decoder.decodeSingularStringField(value: &self.command) + case 6: try decoder.decodeSingularStringField(value: &self.workingDirectory) + case 7: try decoder.decodeSingularStringField(value: &self.workspaceDirectory) + case 8: try decoder.decodeSingularInt64Field(value: &self.serverPid) default: break } } @@ -3814,11 +3377,8 @@ extension BuildEventStream_WorkspaceConfig: SwiftProtobuf.Message, SwiftProtobuf public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.localExecRoot) }() + case 1: try decoder.decodeSingularStringField(value: &self.localExecRoot) default: break } } @@ -3846,11 +3406,8 @@ extension BuildEventStream_UnstructuredCommandLine: SwiftProtobuf.Message, Swift public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.args) }() + case 1: try decoder.decodeRepeatedStringField(value: &self.args) default: break } } @@ -3881,56 +3438,91 @@ extension BuildEventStream_OptionsParsed: SwiftProtobuf.Message, SwiftProtobuf._ 6: .standard(proto: "tool_tag"), ] + fileprivate class _StorageClass { + var _startupOptions: [String] = [] + var _explicitStartupOptions: [String] = [] + var _cmdLine: [String] = [] + var _explicitCmdLine: [String] = [] + var _invocationPolicy: src_main_protobuf_invocation_policy_proto.Blaze_InvocationPolicy_InvocationPolicy? = nil + var _toolTag: String = String() + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _startupOptions = source._startupOptions + _explicitStartupOptions = source._explicitStartupOptions + _cmdLine = source._cmdLine + _explicitCmdLine = source._explicitCmdLine + _invocationPolicy = source._invocationPolicy + _toolTag = source._toolTag + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.startupOptions) }() - case 2: try { try decoder.decodeRepeatedStringField(value: &self.explicitStartupOptions) }() - case 3: try { try decoder.decodeRepeatedStringField(value: &self.cmdLine) }() - case 4: try { try decoder.decodeRepeatedStringField(value: &self.explicitCmdLine) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._invocationPolicy) }() - case 6: try { try decoder.decodeSingularStringField(value: &self.toolTag) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeRepeatedStringField(value: &_storage._startupOptions) + case 2: try decoder.decodeRepeatedStringField(value: &_storage._explicitStartupOptions) + case 3: try decoder.decodeRepeatedStringField(value: &_storage._cmdLine) + case 4: try decoder.decodeRepeatedStringField(value: &_storage._explicitCmdLine) + case 5: try decoder.decodeSingularMessageField(value: &_storage._invocationPolicy) + case 6: try decoder.decodeSingularStringField(value: &_storage._toolTag) + default: break + } } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.startupOptions.isEmpty { - try visitor.visitRepeatedStringField(value: self.startupOptions, fieldNumber: 1) - } - if !self.explicitStartupOptions.isEmpty { - try visitor.visitRepeatedStringField(value: self.explicitStartupOptions, fieldNumber: 2) - } - if !self.cmdLine.isEmpty { - try visitor.visitRepeatedStringField(value: self.cmdLine, fieldNumber: 3) - } - if !self.explicitCmdLine.isEmpty { - try visitor.visitRepeatedStringField(value: self.explicitCmdLine, fieldNumber: 4) - } - try { if let v = self._invocationPolicy { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - if !self.toolTag.isEmpty { - try visitor.visitSingularStringField(value: self.toolTag, fieldNumber: 6) + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._startupOptions.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._startupOptions, fieldNumber: 1) + } + if !_storage._explicitStartupOptions.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._explicitStartupOptions, fieldNumber: 2) + } + if !_storage._cmdLine.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._cmdLine, fieldNumber: 3) + } + if !_storage._explicitCmdLine.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._explicitCmdLine, fieldNumber: 4) + } + if let v = _storage._invocationPolicy { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } + if !_storage._toolTag.isEmpty { + try visitor.visitSingularStringField(value: _storage._toolTag, fieldNumber: 6) + } } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_OptionsParsed, rhs: BuildEventStream_OptionsParsed) -> Bool { - if lhs.startupOptions != rhs.startupOptions {return false} - if lhs.explicitStartupOptions != rhs.explicitStartupOptions {return false} - if lhs.cmdLine != rhs.cmdLine {return false} - if lhs.explicitCmdLine != rhs.explicitCmdLine {return false} - if lhs._invocationPolicy != rhs._invocationPolicy {return false} - if lhs.toolTag != rhs.toolTag {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._startupOptions != rhs_storage._startupOptions {return false} + if _storage._explicitStartupOptions != rhs_storage._explicitStartupOptions {return false} + if _storage._cmdLine != rhs_storage._cmdLine {return false} + if _storage._explicitCmdLine != rhs_storage._explicitCmdLine {return false} + if _storage._invocationPolicy != rhs_storage._invocationPolicy {return false} + if _storage._toolTag != rhs_storage._toolTag {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3944,11 +3536,8 @@ extension BuildEventStream_Fetch: SwiftProtobuf.Message, SwiftProtobuf._MessageI public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.success) }() + case 1: try decoder.decodeSingularBoolField(value: &self.success) default: break } } @@ -3976,11 +3565,8 @@ extension BuildEventStream_WorkspaceStatus: SwiftProtobuf.Message, SwiftProtobuf public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.item) }() + case 1: try decoder.decodeRepeatedMessageField(value: &self.item) default: break } } @@ -4009,12 +3595,9 @@ extension BuildEventStream_WorkspaceStatus.Item: SwiftProtobuf.Message, SwiftPro public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.key) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.value) }() + case 1: try decoder.decodeSingularStringField(value: &self.key) + case 2: try decoder.decodeSingularStringField(value: &self.value) default: break } } @@ -4046,11 +3629,8 @@ extension BuildEventStream_BuildMetadata: SwiftProtobuf.Message, SwiftProtobuf._ public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.metadata) }() + case 1: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.metadata) default: break } } @@ -4081,14 +3661,11 @@ extension BuildEventStream_Configuration: SwiftProtobuf.Message, SwiftProtobuf._ public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.mnemonic) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.platformName) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.cpu) }() - case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.makeVariable) }() + case 1: try decoder.decodeSingularStringField(value: &self.mnemonic) + case 2: try decoder.decodeSingularStringField(value: &self.platformName) + case 3: try decoder.decodeSingularStringField(value: &self.cpu) + case 4: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.makeVariable) default: break } } @@ -4149,13 +3726,10 @@ extension BuildEventStream_TargetConfigured: SwiftProtobuf.Message, SwiftProtobu public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.targetKind) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.testSize) }() - case 3: try { try decoder.decodeRepeatedStringField(value: &self.tag) }() + case 1: try decoder.decodeSingularStringField(value: &self.targetKind) + case 2: try decoder.decodeSingularEnumField(value: &self.testSize) + case 3: try decoder.decodeRepeatedStringField(value: &self.tag) default: break } } @@ -4194,50 +3768,33 @@ extension BuildEventStream_File: SwiftProtobuf.Message, SwiftProtobuf._MessageIm public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { + case 1: try decoder.decodeSingularStringField(value: &self.name) + case 2: + if self.file != nil {try decoder.handleConflictingOneOf()} var v: String? try decoder.decodeSingularStringField(value: &v) - if let v = v { - if self.file != nil {try decoder.handleConflictingOneOf()} - self.file = .uri(v) - } - }() - case 3: try { + if let v = v {self.file = .uri(v)} + case 3: + if self.file != nil {try decoder.handleConflictingOneOf()} var v: Data? try decoder.decodeSingularBytesField(value: &v) - if let v = v { - if self.file != nil {try decoder.handleConflictingOneOf()} - self.file = .contents(v) - } - }() - case 4: try { try decoder.decodeRepeatedStringField(value: &self.pathPrefix) }() + if let v = v {self.file = .contents(v)} + case 4: try decoder.decodeRepeatedStringField(value: &self.pathPrefix) default: break } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 if !self.name.isEmpty { try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) } switch self.file { - case .uri?: try { - guard case .uri(let v)? = self.file else { preconditionFailure() } + case .uri(let v)?: try visitor.visitSingularStringField(value: v, fieldNumber: 2) - }() - case .contents?: try { - guard case .contents(let v)? = self.file else { preconditionFailure() } + case .contents(let v)?: try visitor.visitSingularBytesField(value: v, fieldNumber: 3) - }() case nil: break } if !self.pathPrefix.isEmpty { @@ -4264,12 +3821,9 @@ extension BuildEventStream_NamedSetOfFiles: SwiftProtobuf.Message, SwiftProtobuf public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.files) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.fileSets) }() + case 1: try decoder.decodeRepeatedMessageField(value: &self.files) + case 2: try decoder.decodeRepeatedMessageField(value: &self.fileSets) default: break } } @@ -4320,7 +3874,7 @@ extension BuildEventStream_ActionExecuted: SwiftProtobuf.Message, SwiftProtobuf. var _primaryOutput: BuildEventStream_File? = nil var _commandLine: [String] = [] var _actionMetadataLogs: [BuildEventStream_File] = [] - var _failureDetail: FailureDetails_FailureDetail? = nil + var _failureDetail: src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail? = nil static let defaultInstance = _StorageClass() @@ -4352,21 +3906,18 @@ extension BuildEventStream_ActionExecuted: SwiftProtobuf.Message, SwiftProtobuf. _ = _uniqueStorage() try withExtendedLifetime(_storage) { (_storage: _StorageClass) in while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &_storage._success) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &_storage._exitCode) }() - case 3: try { try decoder.decodeSingularMessageField(value: &_storage._stdout) }() - case 4: try { try decoder.decodeSingularMessageField(value: &_storage._stderr) }() - case 5: try { try decoder.decodeSingularStringField(value: &_storage._label) }() - case 6: try { try decoder.decodeSingularMessageField(value: &_storage._primaryOutput) }() - case 7: try { try decoder.decodeSingularMessageField(value: &_storage._configuration) }() - case 8: try { try decoder.decodeSingularStringField(value: &_storage._type) }() - case 9: try { try decoder.decodeRepeatedStringField(value: &_storage._commandLine) }() - case 10: try { try decoder.decodeRepeatedMessageField(value: &_storage._actionMetadataLogs) }() - case 11: try { try decoder.decodeSingularMessageField(value: &_storage._failureDetail) }() + case 1: try decoder.decodeSingularBoolField(value: &_storage._success) + case 2: try decoder.decodeSingularInt32Field(value: &_storage._exitCode) + case 3: try decoder.decodeSingularMessageField(value: &_storage._stdout) + case 4: try decoder.decodeSingularMessageField(value: &_storage._stderr) + case 5: try decoder.decodeSingularStringField(value: &_storage._label) + case 6: try decoder.decodeSingularMessageField(value: &_storage._primaryOutput) + case 7: try decoder.decodeSingularMessageField(value: &_storage._configuration) + case 8: try decoder.decodeSingularStringField(value: &_storage._type) + case 9: try decoder.decodeRepeatedStringField(value: &_storage._commandLine) + case 10: try decoder.decodeRepeatedMessageField(value: &_storage._actionMetadataLogs) + case 11: try decoder.decodeSingularMessageField(value: &_storage._failureDetail) default: break } } @@ -4375,31 +3926,27 @@ extension BuildEventStream_ActionExecuted: SwiftProtobuf.Message, SwiftProtobuf. public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 if _storage._success != false { try visitor.visitSingularBoolField(value: _storage._success, fieldNumber: 1) } if _storage._exitCode != 0 { try visitor.visitSingularInt32Field(value: _storage._exitCode, fieldNumber: 2) } - try { if let v = _storage._stdout { + if let v = _storage._stdout { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = _storage._stderr { + } + if let v = _storage._stderr { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() + } if !_storage._label.isEmpty { try visitor.visitSingularStringField(value: _storage._label, fieldNumber: 5) } - try { if let v = _storage._primaryOutput { + if let v = _storage._primaryOutput { try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - try { if let v = _storage._configuration { + } + if let v = _storage._configuration { try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() + } if !_storage._type.isEmpty { try visitor.visitSingularStringField(value: _storage._type, fieldNumber: 8) } @@ -4409,9 +3956,9 @@ extension BuildEventStream_ActionExecuted: SwiftProtobuf.Message, SwiftProtobuf. if !_storage._actionMetadataLogs.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._actionMetadataLogs, fieldNumber: 10) } - try { if let v = _storage._failureDetail { + if let v = _storage._failureDetail { try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() + } } try unknownFields.traverse(visitor: &visitor) } @@ -4450,12 +3997,9 @@ extension BuildEventStream_OutputGroup: SwiftProtobuf.Message, SwiftProtobuf._Me public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.fileSets) }() + case 1: try decoder.decodeSingularStringField(value: &self.name) + case 3: try decoder.decodeRepeatedMessageField(value: &self.fileSets) default: break } } @@ -4493,71 +4037,112 @@ extension BuildEventStream_TargetComplete: SwiftProtobuf.Message, SwiftProtobuf. 9: .standard(proto: "failure_detail"), ] + fileprivate class _StorageClass { + var _success: Bool = false + var _targetKind: String = String() + var _testSize: BuildEventStream_TestSize = .unknown + var _outputGroup: [BuildEventStream_OutputGroup] = [] + var _importantOutput: [BuildEventStream_File] = [] + var _directoryOutput: [BuildEventStream_File] = [] + var _tag: [String] = [] + var _testTimeoutSeconds: Int64 = 0 + var _failureDetail: src_main_protobuf_failure_details_proto.FailureDetails_FailureDetail? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _success = source._success + _targetKind = source._targetKind + _testSize = source._testSize + _outputGroup = source._outputGroup + _importantOutput = source._importantOutput + _directoryOutput = source._directoryOutput + _tag = source._tag + _testTimeoutSeconds = source._testTimeoutSeconds + _failureDetail = source._failureDetail + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.success) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.outputGroup) }() - case 3: try { try decoder.decodeRepeatedStringField(value: &self.tag) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.importantOutput) }() - case 5: try { try decoder.decodeSingularStringField(value: &self.targetKind) }() - case 6: try { try decoder.decodeSingularEnumField(value: &self.testSize) }() - case 7: try { try decoder.decodeSingularInt64Field(value: &self.testTimeoutSeconds) }() - case 8: try { try decoder.decodeRepeatedMessageField(value: &self.directoryOutput) }() - case 9: try { try decoder.decodeSingularMessageField(value: &self._failureDetail) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularBoolField(value: &_storage._success) + case 2: try decoder.decodeRepeatedMessageField(value: &_storage._outputGroup) + case 3: try decoder.decodeRepeatedStringField(value: &_storage._tag) + case 4: try decoder.decodeRepeatedMessageField(value: &_storage._importantOutput) + case 5: try decoder.decodeSingularStringField(value: &_storage._targetKind) + case 6: try decoder.decodeSingularEnumField(value: &_storage._testSize) + case 7: try decoder.decodeSingularInt64Field(value: &_storage._testTimeoutSeconds) + case 8: try decoder.decodeRepeatedMessageField(value: &_storage._directoryOutput) + case 9: try decoder.decodeSingularMessageField(value: &_storage._failureDetail) + default: break + } } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.success != false { - try visitor.visitSingularBoolField(value: self.success, fieldNumber: 1) - } - if !self.outputGroup.isEmpty { - try visitor.visitRepeatedMessageField(value: self.outputGroup, fieldNumber: 2) - } - if !self.tag.isEmpty { - try visitor.visitRepeatedStringField(value: self.tag, fieldNumber: 3) - } - if !self.importantOutput.isEmpty { - try visitor.visitRepeatedMessageField(value: self.importantOutput, fieldNumber: 4) - } - if !self.targetKind.isEmpty { - try visitor.visitSingularStringField(value: self.targetKind, fieldNumber: 5) - } - if self.testSize != .unknown { - try visitor.visitSingularEnumField(value: self.testSize, fieldNumber: 6) - } - if self.testTimeoutSeconds != 0 { - try visitor.visitSingularInt64Field(value: self.testTimeoutSeconds, fieldNumber: 7) - } - if !self.directoryOutput.isEmpty { - try visitor.visitRepeatedMessageField(value: self.directoryOutput, fieldNumber: 8) + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if _storage._success != false { + try visitor.visitSingularBoolField(value: _storage._success, fieldNumber: 1) + } + if !_storage._outputGroup.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._outputGroup, fieldNumber: 2) + } + if !_storage._tag.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._tag, fieldNumber: 3) + } + if !_storage._importantOutput.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._importantOutput, fieldNumber: 4) + } + if !_storage._targetKind.isEmpty { + try visitor.visitSingularStringField(value: _storage._targetKind, fieldNumber: 5) + } + if _storage._testSize != .unknown { + try visitor.visitSingularEnumField(value: _storage._testSize, fieldNumber: 6) + } + if _storage._testTimeoutSeconds != 0 { + try visitor.visitSingularInt64Field(value: _storage._testTimeoutSeconds, fieldNumber: 7) + } + if !_storage._directoryOutput.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._directoryOutput, fieldNumber: 8) + } + if let v = _storage._failureDetail { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } } - try { if let v = self._failureDetail { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_TargetComplete, rhs: BuildEventStream_TargetComplete) -> Bool { - if lhs.success != rhs.success {return false} - if lhs.targetKind != rhs.targetKind {return false} - if lhs.testSize != rhs.testSize {return false} - if lhs.outputGroup != rhs.outputGroup {return false} - if lhs.importantOutput != rhs.importantOutput {return false} - if lhs.directoryOutput != rhs.directoryOutput {return false} - if lhs.tag != rhs.tag {return false} - if lhs.testTimeoutSeconds != rhs.testTimeoutSeconds {return false} - if lhs._failureDetail != rhs._failureDetail {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._success != rhs_storage._success {return false} + if _storage._targetKind != rhs_storage._targetKind {return false} + if _storage._testSize != rhs_storage._testSize {return false} + if _storage._outputGroup != rhs_storage._outputGroup {return false} + if _storage._importantOutput != rhs_storage._importantOutput {return false} + if _storage._directoryOutput != rhs_storage._directoryOutput {return false} + if _storage._tag != rhs_storage._tag {return false} + if _storage._testTimeoutSeconds != rhs_storage._testTimeoutSeconds {return false} + if _storage._failureDetail != rhs_storage._failureDetail {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -4576,66 +4161,105 @@ extension BuildEventStream_TestResult: SwiftProtobuf.Message, SwiftProtobuf._Mes 8: .standard(proto: "execution_info"), ] + fileprivate class _StorageClass { + var _status: BuildEventStream_TestStatus = .noStatus + var _statusDetails: String = String() + var _cachedLocally: Bool = false + var _testAttemptStartMillisEpoch: Int64 = 0 + var _testAttemptDurationMillis: Int64 = 0 + var _testActionOutput: [BuildEventStream_File] = [] + var _warning: [String] = [] + var _executionInfo: BuildEventStream_TestResult.ExecutionInfo? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _status = source._status + _statusDetails = source._statusDetails + _cachedLocally = source._cachedLocally + _testAttemptStartMillisEpoch = source._testAttemptStartMillisEpoch + _testAttemptDurationMillis = source._testAttemptDurationMillis + _testActionOutput = source._testActionOutput + _warning = source._warning + _executionInfo = source._executionInfo + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.testActionOutput) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.testAttemptDurationMillis) }() - case 4: try { try decoder.decodeSingularBoolField(value: &self.cachedLocally) }() - case 5: try { try decoder.decodeSingularEnumField(value: &self.status) }() - case 6: try { try decoder.decodeSingularInt64Field(value: &self.testAttemptStartMillisEpoch) }() - case 7: try { try decoder.decodeRepeatedStringField(value: &self.warning) }() - case 8: try { try decoder.decodeSingularMessageField(value: &self._executionInfo) }() - case 9: try { try decoder.decodeSingularStringField(value: &self.statusDetails) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 2: try decoder.decodeRepeatedMessageField(value: &_storage._testActionOutput) + case 3: try decoder.decodeSingularInt64Field(value: &_storage._testAttemptDurationMillis) + case 4: try decoder.decodeSingularBoolField(value: &_storage._cachedLocally) + case 5: try decoder.decodeSingularEnumField(value: &_storage._status) + case 6: try decoder.decodeSingularInt64Field(value: &_storage._testAttemptStartMillisEpoch) + case 7: try decoder.decodeRepeatedStringField(value: &_storage._warning) + case 8: try decoder.decodeSingularMessageField(value: &_storage._executionInfo) + case 9: try decoder.decodeSingularStringField(value: &_storage._statusDetails) + default: break + } } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.testActionOutput.isEmpty { - try visitor.visitRepeatedMessageField(value: self.testActionOutput, fieldNumber: 2) - } - if self.testAttemptDurationMillis != 0 { - try visitor.visitSingularInt64Field(value: self.testAttemptDurationMillis, fieldNumber: 3) - } - if self.cachedLocally != false { - try visitor.visitSingularBoolField(value: self.cachedLocally, fieldNumber: 4) - } - if self.status != .noStatus { - try visitor.visitSingularEnumField(value: self.status, fieldNumber: 5) - } - if self.testAttemptStartMillisEpoch != 0 { - try visitor.visitSingularInt64Field(value: self.testAttemptStartMillisEpoch, fieldNumber: 6) - } - if !self.warning.isEmpty { - try visitor.visitRepeatedStringField(value: self.warning, fieldNumber: 7) - } - try { if let v = self._executionInfo { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - if !self.statusDetails.isEmpty { - try visitor.visitSingularStringField(value: self.statusDetails, fieldNumber: 9) + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._testActionOutput.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._testActionOutput, fieldNumber: 2) + } + if _storage._testAttemptDurationMillis != 0 { + try visitor.visitSingularInt64Field(value: _storage._testAttemptDurationMillis, fieldNumber: 3) + } + if _storage._cachedLocally != false { + try visitor.visitSingularBoolField(value: _storage._cachedLocally, fieldNumber: 4) + } + if _storage._status != .noStatus { + try visitor.visitSingularEnumField(value: _storage._status, fieldNumber: 5) + } + if _storage._testAttemptStartMillisEpoch != 0 { + try visitor.visitSingularInt64Field(value: _storage._testAttemptStartMillisEpoch, fieldNumber: 6) + } + if !_storage._warning.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._warning, fieldNumber: 7) + } + if let v = _storage._executionInfo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } + if !_storage._statusDetails.isEmpty { + try visitor.visitSingularStringField(value: _storage._statusDetails, fieldNumber: 9) + } } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_TestResult, rhs: BuildEventStream_TestResult) -> Bool { - if lhs.status != rhs.status {return false} - if lhs.statusDetails != rhs.statusDetails {return false} - if lhs.cachedLocally != rhs.cachedLocally {return false} - if lhs.testAttemptStartMillisEpoch != rhs.testAttemptStartMillisEpoch {return false} - if lhs.testAttemptDurationMillis != rhs.testAttemptDurationMillis {return false} - if lhs.testActionOutput != rhs.testActionOutput {return false} - if lhs.warning != rhs.warning {return false} - if lhs._executionInfo != rhs._executionInfo {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._status != rhs_storage._status {return false} + if _storage._statusDetails != rhs_storage._statusDetails {return false} + if _storage._cachedLocally != rhs_storage._cachedLocally {return false} + if _storage._testAttemptStartMillisEpoch != rhs_storage._testAttemptStartMillisEpoch {return false} + if _storage._testAttemptDurationMillis != rhs_storage._testAttemptDurationMillis {return false} + if _storage._testActionOutput != rhs_storage._testActionOutput {return false} + if _storage._warning != rhs_storage._warning {return false} + if _storage._executionInfo != rhs_storage._executionInfo {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -4653,61 +4277,98 @@ extension BuildEventStream_TestResult.ExecutionInfo: SwiftProtobuf.Message, Swif 5: .standard(proto: "resource_usage"), ] + fileprivate class _StorageClass { + var _timeoutSeconds: Int32 = 0 + var _strategy: String = String() + var _cachedRemotely: Bool = false + var _exitCode: Int32 = 0 + var _hostname: String = String() + var _timingBreakdown: BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown? = nil + var _resourceUsage: [BuildEventStream_TestResult.ExecutionInfo.ResourceUsage] = [] + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _timeoutSeconds = source._timeoutSeconds + _strategy = source._strategy + _cachedRemotely = source._cachedRemotely + _exitCode = source._exitCode + _hostname = source._hostname + _timingBreakdown = source._timingBreakdown + _resourceUsage = source._resourceUsage + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt32Field(value: &self.timeoutSeconds) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.strategy) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.hostname) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._timingBreakdown) }() - case 5: try { try decoder.decodeRepeatedMessageField(value: &self.resourceUsage) }() - case 6: try { try decoder.decodeSingularBoolField(value: &self.cachedRemotely) }() - case 7: try { try decoder.decodeSingularInt32Field(value: &self.exitCode) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularInt32Field(value: &_storage._timeoutSeconds) + case 2: try decoder.decodeSingularStringField(value: &_storage._strategy) + case 3: try decoder.decodeSingularStringField(value: &_storage._hostname) + case 4: try decoder.decodeSingularMessageField(value: &_storage._timingBreakdown) + case 5: try decoder.decodeRepeatedMessageField(value: &_storage._resourceUsage) + case 6: try decoder.decodeSingularBoolField(value: &_storage._cachedRemotely) + case 7: try decoder.decodeSingularInt32Field(value: &_storage._exitCode) + default: break + } } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.timeoutSeconds != 0 { - try visitor.visitSingularInt32Field(value: self.timeoutSeconds, fieldNumber: 1) - } - if !self.strategy.isEmpty { - try visitor.visitSingularStringField(value: self.strategy, fieldNumber: 2) - } - if !self.hostname.isEmpty { - try visitor.visitSingularStringField(value: self.hostname, fieldNumber: 3) - } - try { if let v = self._timingBreakdown { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - if !self.resourceUsage.isEmpty { - try visitor.visitRepeatedMessageField(value: self.resourceUsage, fieldNumber: 5) - } - if self.cachedRemotely != false { - try visitor.visitSingularBoolField(value: self.cachedRemotely, fieldNumber: 6) - } - if self.exitCode != 0 { - try visitor.visitSingularInt32Field(value: self.exitCode, fieldNumber: 7) + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if _storage._timeoutSeconds != 0 { + try visitor.visitSingularInt32Field(value: _storage._timeoutSeconds, fieldNumber: 1) + } + if !_storage._strategy.isEmpty { + try visitor.visitSingularStringField(value: _storage._strategy, fieldNumber: 2) + } + if !_storage._hostname.isEmpty { + try visitor.visitSingularStringField(value: _storage._hostname, fieldNumber: 3) + } + if let v = _storage._timingBreakdown { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } + if !_storage._resourceUsage.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._resourceUsage, fieldNumber: 5) + } + if _storage._cachedRemotely != false { + try visitor.visitSingularBoolField(value: _storage._cachedRemotely, fieldNumber: 6) + } + if _storage._exitCode != 0 { + try visitor.visitSingularInt32Field(value: _storage._exitCode, fieldNumber: 7) + } } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_TestResult.ExecutionInfo, rhs: BuildEventStream_TestResult.ExecutionInfo) -> Bool { - if lhs.timeoutSeconds != rhs.timeoutSeconds {return false} - if lhs.strategy != rhs.strategy {return false} - if lhs.cachedRemotely != rhs.cachedRemotely {return false} - if lhs.exitCode != rhs.exitCode {return false} - if lhs.hostname != rhs.hostname {return false} - if lhs._timingBreakdown != rhs._timingBreakdown {return false} - if lhs.resourceUsage != rhs.resourceUsage {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._timeoutSeconds != rhs_storage._timeoutSeconds {return false} + if _storage._strategy != rhs_storage._strategy {return false} + if _storage._cachedRemotely != rhs_storage._cachedRemotely {return false} + if _storage._exitCode != rhs_storage._exitCode {return false} + if _storage._hostname != rhs_storage._hostname {return false} + if _storage._timingBreakdown != rhs_storage._timingBreakdown {return false} + if _storage._resourceUsage != rhs_storage._resourceUsage {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -4723,13 +4384,10 @@ extension BuildEventStream_TestResult.ExecutionInfo.TimingBreakdown: SwiftProtob public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.child) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 3: try { try decoder.decodeSingularInt64Field(value: &self.timeMillis) }() + case 1: try decoder.decodeRepeatedMessageField(value: &self.child) + case 2: try decoder.decodeSingularStringField(value: &self.name) + case 3: try decoder.decodeSingularInt64Field(value: &self.timeMillis) default: break } } @@ -4766,12 +4424,9 @@ extension BuildEventStream_TestResult.ExecutionInfo.ResourceUsage: SwiftProtobuf public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.value) }() + case 1: try decoder.decodeSingularStringField(value: &self.name) + case 2: try decoder.decodeSingularInt64Field(value: &self.value) default: break } } @@ -4800,8 +4455,6 @@ extension BuildEventStream_TestSummary: SwiftProtobuf.Message, SwiftProtobuf._Me public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 5: .standard(proto: "overall_status"), 1: .standard(proto: "total_run_count"), - 10: .standard(proto: "run_count"), - 11: .standard(proto: "shard_count"), 3: .same(proto: "passed"), 4: .same(proto: "failed"), 6: .standard(proto: "total_num_cached"), @@ -4812,20 +4465,15 @@ extension BuildEventStream_TestSummary: SwiftProtobuf.Message, SwiftProtobuf._Me public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularInt32Field(value: &self.totalRunCount) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.passed) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.failed) }() - case 5: try { try decoder.decodeSingularEnumField(value: &self.overallStatus) }() - case 6: try { try decoder.decodeSingularInt32Field(value: &self.totalNumCached) }() - case 7: try { try decoder.decodeSingularInt64Field(value: &self.firstStartTimeMillis) }() - case 8: try { try decoder.decodeSingularInt64Field(value: &self.lastStopTimeMillis) }() - case 9: try { try decoder.decodeSingularInt64Field(value: &self.totalRunDurationMillis) }() - case 10: try { try decoder.decodeSingularInt32Field(value: &self.runCount) }() - case 11: try { try decoder.decodeSingularInt32Field(value: &self.shardCount) }() + case 1: try decoder.decodeSingularInt32Field(value: &self.totalRunCount) + case 3: try decoder.decodeRepeatedMessageField(value: &self.passed) + case 4: try decoder.decodeRepeatedMessageField(value: &self.failed) + case 5: try decoder.decodeSingularEnumField(value: &self.overallStatus) + case 6: try decoder.decodeSingularInt32Field(value: &self.totalNumCached) + case 7: try decoder.decodeSingularInt64Field(value: &self.firstStartTimeMillis) + case 8: try decoder.decodeSingularInt64Field(value: &self.lastStopTimeMillis) + case 9: try decoder.decodeSingularInt64Field(value: &self.totalRunDurationMillis) default: break } } @@ -4856,20 +4504,12 @@ extension BuildEventStream_TestSummary: SwiftProtobuf.Message, SwiftProtobuf._Me if self.totalRunDurationMillis != 0 { try visitor.visitSingularInt64Field(value: self.totalRunDurationMillis, fieldNumber: 9) } - if self.runCount != 0 { - try visitor.visitSingularInt32Field(value: self.runCount, fieldNumber: 10) - } - if self.shardCount != 0 { - try visitor.visitSingularInt32Field(value: self.shardCount, fieldNumber: 11) - } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_TestSummary, rhs: BuildEventStream_TestSummary) -> Bool { if lhs.overallStatus != rhs.overallStatus {return false} if lhs.totalRunCount != rhs.totalRunCount {return false} - if lhs.runCount != rhs.runCount {return false} - if lhs.shardCount != rhs.shardCount {return false} if lhs.passed != rhs.passed {return false} if lhs.failed != rhs.failed {return false} if lhs.totalNumCached != rhs.totalNumCached {return false} @@ -4890,46 +4530,77 @@ extension BuildEventStream_BuildFinished: SwiftProtobuf.Message, SwiftProtobuf._ 4: .standard(proto: "anomaly_report"), ] + fileprivate class _StorageClass { + var _overallSuccess: Bool = false + var _exitCode: BuildEventStream_BuildFinished.ExitCode? = nil + var _finishTimeMillis: Int64 = 0 + var _anomalyReport: BuildEventStream_BuildFinished.AnomalyReport? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _overallSuccess = source._overallSuccess + _exitCode = source._exitCode + _finishTimeMillis = source._finishTimeMillis + _anomalyReport = source._anomalyReport + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.overallSuccess) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.finishTimeMillis) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._exitCode) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._anomalyReport) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularBoolField(value: &_storage._overallSuccess) + case 2: try decoder.decodeSingularInt64Field(value: &_storage._finishTimeMillis) + case 3: try decoder.decodeSingularMessageField(value: &_storage._exitCode) + case 4: try decoder.decodeSingularMessageField(value: &_storage._anomalyReport) + default: break + } } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.overallSuccess != false { - try visitor.visitSingularBoolField(value: self.overallSuccess, fieldNumber: 1) - } - if self.finishTimeMillis != 0 { - try visitor.visitSingularInt64Field(value: self.finishTimeMillis, fieldNumber: 2) - } - try { if let v = self._exitCode { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._anomalyReport { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if _storage._overallSuccess != false { + try visitor.visitSingularBoolField(value: _storage._overallSuccess, fieldNumber: 1) + } + if _storage._finishTimeMillis != 0 { + try visitor.visitSingularInt64Field(value: _storage._finishTimeMillis, fieldNumber: 2) + } + if let v = _storage._exitCode { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } + if let v = _storage._anomalyReport { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } + } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildFinished, rhs: BuildEventStream_BuildFinished) -> Bool { - if lhs.overallSuccess != rhs.overallSuccess {return false} - if lhs._exitCode != rhs._exitCode {return false} - if lhs.finishTimeMillis != rhs.finishTimeMillis {return false} - if lhs._anomalyReport != rhs._anomalyReport {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._overallSuccess != rhs_storage._overallSuccess {return false} + if _storage._exitCode != rhs_storage._exitCode {return false} + if _storage._finishTimeMillis != rhs_storage._finishTimeMillis {return false} + if _storage._anomalyReport != rhs_storage._anomalyReport {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -4944,12 +4615,9 @@ extension BuildEventStream_BuildFinished.ExitCode: SwiftProtobuf.Message, SwiftP public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &self.code) }() + case 1: try decoder.decodeSingularStringField(value: &self.name) + case 2: try decoder.decodeSingularInt32Field(value: &self.code) default: break } } @@ -4981,11 +4649,8 @@ extension BuildEventStream_BuildFinished.AnomalyReport: SwiftProtobuf.Message, S public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.wasSuspended) }() + case 1: try decoder.decodeSingularBoolField(value: &self.wasSuspended) default: break } } @@ -5015,51 +4680,84 @@ extension BuildEventStream_BuildMetrics: SwiftProtobuf.Message, SwiftProtobuf._M 5: .standard(proto: "timing_metrics"), ] + fileprivate class _StorageClass { + var _actionSummary: BuildEventStream_BuildMetrics.ActionSummary? = nil + var _memoryMetrics: BuildEventStream_BuildMetrics.MemoryMetrics? = nil + var _targetMetrics: BuildEventStream_BuildMetrics.TargetMetrics? = nil + var _packageMetrics: BuildEventStream_BuildMetrics.PackageMetrics? = nil + var _timingMetrics: BuildEventStream_BuildMetrics.TimingMetrics? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _actionSummary = source._actionSummary + _memoryMetrics = source._memoryMetrics + _targetMetrics = source._targetMetrics + _packageMetrics = source._packageMetrics + _timingMetrics = source._timingMetrics + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._actionSummary) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._memoryMetrics) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._targetMetrics) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._packageMetrics) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._timingMetrics) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularMessageField(value: &_storage._actionSummary) + case 2: try decoder.decodeSingularMessageField(value: &_storage._memoryMetrics) + case 3: try decoder.decodeSingularMessageField(value: &_storage._targetMetrics) + case 4: try decoder.decodeSingularMessageField(value: &_storage._packageMetrics) + case 5: try decoder.decodeSingularMessageField(value: &_storage._timingMetrics) + default: break + } } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._actionSummary { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._memoryMetrics { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._targetMetrics { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._packageMetrics { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._timingMetrics { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if let v = _storage._actionSummary { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } + if let v = _storage._memoryMetrics { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } + if let v = _storage._targetMetrics { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } + if let v = _storage._packageMetrics { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } + if let v = _storage._timingMetrics { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } + } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: BuildEventStream_BuildMetrics, rhs: BuildEventStream_BuildMetrics) -> Bool { - if lhs._actionSummary != rhs._actionSummary {return false} - if lhs._memoryMetrics != rhs._memoryMetrics {return false} - if lhs._targetMetrics != rhs._targetMetrics {return false} - if lhs._packageMetrics != rhs._packageMetrics {return false} - if lhs._timingMetrics != rhs._timingMetrics {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._actionSummary != rhs_storage._actionSummary {return false} + if _storage._memoryMetrics != rhs_storage._memoryMetrics {return false} + if _storage._targetMetrics != rhs_storage._targetMetrics {return false} + if _storage._packageMetrics != rhs_storage._packageMetrics {return false} + if _storage._timingMetrics != rhs_storage._timingMetrics {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -5074,12 +4772,9 @@ extension BuildEventStream_BuildMetrics.ActionSummary: SwiftProtobuf.Message, Sw public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.actionsCreated) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.actionsExecuted) }() + case 1: try decoder.decodeSingularInt64Field(value: &self.actionsCreated) + case 2: try decoder.decodeSingularInt64Field(value: &self.actionsExecuted) default: break } } @@ -5112,12 +4807,9 @@ extension BuildEventStream_BuildMetrics.MemoryMetrics: SwiftProtobuf.Message, Sw public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.usedHeapSizePostBuild) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.peakPostGcHeapSize) }() + case 1: try decoder.decodeSingularInt64Field(value: &self.usedHeapSizePostBuild) + case 2: try decoder.decodeSingularInt64Field(value: &self.peakPostGcHeapSize) default: break } } @@ -5150,12 +4842,9 @@ extension BuildEventStream_BuildMetrics.TargetMetrics: SwiftProtobuf.Message, Sw public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.targetsLoaded) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.targetsConfigured) }() + case 1: try decoder.decodeSingularInt64Field(value: &self.targetsLoaded) + case 2: try decoder.decodeSingularInt64Field(value: &self.targetsConfigured) default: break } } @@ -5187,11 +4876,8 @@ extension BuildEventStream_BuildMetrics.PackageMetrics: SwiftProtobuf.Message, S public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.packagesLoaded) }() + case 1: try decoder.decodeSingularInt64Field(value: &self.packagesLoaded) default: break } } @@ -5220,12 +4906,9 @@ extension BuildEventStream_BuildMetrics.TimingMetrics: SwiftProtobuf.Message, Sw public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularInt64Field(value: &self.cpuTimeInMs) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.wallTimeInMs) }() + case 1: try decoder.decodeSingularInt64Field(value: &self.cpuTimeInMs) + case 2: try decoder.decodeSingularInt64Field(value: &self.wallTimeInMs) default: break } } @@ -5257,11 +4940,8 @@ extension BuildEventStream_BuildToolLogs: SwiftProtobuf.Message, SwiftProtobuf._ public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.log) }() + case 1: try decoder.decodeRepeatedMessageField(value: &self.log) default: break } } @@ -5289,11 +4969,8 @@ extension BuildEventStream_ConvenienceSymlinksIdentified: SwiftProtobuf.Message, public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.convenienceSymlinks) }() + case 1: try decoder.decodeRepeatedMessageField(value: &self.convenienceSymlinks) default: break } } @@ -5323,13 +5000,10 @@ extension BuildEventStream_ConvenienceSymlink: SwiftProtobuf.Message, SwiftProto public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.path) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.action) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.target) }() + case 1: try decoder.decodeSingularStringField(value: &self.path) + case 2: try decoder.decodeSingularEnumField(value: &self.action) + case 3: try decoder.decodeSingularStringField(value: &self.target) default: break } } @@ -5424,299 +5098,186 @@ extension BuildEventStream_BuildEvent: SwiftProtobuf.Message, SwiftProtobuf._Mes _ = _uniqueStorage() try withExtendedLifetime(_storage) { (_storage: _StorageClass) in while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._id) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &_storage._children) }() - case 3: try { + case 1: try decoder.decodeSingularMessageField(value: &_storage._id) + case 2: try decoder.decodeRepeatedMessageField(value: &_storage._children) + case 3: var v: BuildEventStream_Progress? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .progress(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .progress(v) - } - }() - case 4: try { + if let v = v {_storage._payload = .progress(v)} + case 4: var v: BuildEventStream_Aborted? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .aborted(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .aborted(v) - } - }() - case 5: try { + if let v = v {_storage._payload = .aborted(v)} + case 5: var v: BuildEventStream_BuildStarted? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .started(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .started(v) - } - }() - case 6: try { + if let v = v {_storage._payload = .started(v)} + case 6: var v: BuildEventStream_PatternExpanded? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .expanded(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .expanded(v) - } - }() - case 7: try { + if let v = v {_storage._payload = .expanded(v)} + case 7: var v: BuildEventStream_ActionExecuted? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .action(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .action(v) - } - }() - case 8: try { + if let v = v {_storage._payload = .action(v)} + case 8: var v: BuildEventStream_TargetComplete? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .completed(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .completed(v) - } - }() - case 9: try { + if let v = v {_storage._payload = .completed(v)} + case 9: var v: BuildEventStream_TestSummary? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .testSummary(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .testSummary(v) - } - }() - case 10: try { + if let v = v {_storage._payload = .testSummary(v)} + case 10: var v: BuildEventStream_TestResult? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .testResult(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .testResult(v) - } - }() - case 12: try { + if let v = v {_storage._payload = .testResult(v)} + case 12: var v: BuildEventStream_UnstructuredCommandLine? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .unstructuredCommandLine(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .unstructuredCommandLine(v) - } - }() - case 13: try { + if let v = v {_storage._payload = .unstructuredCommandLine(v)} + case 13: var v: BuildEventStream_OptionsParsed? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .optionsParsed(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .optionsParsed(v) - } - }() - case 14: try { + if let v = v {_storage._payload = .optionsParsed(v)} + case 14: var v: BuildEventStream_BuildFinished? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .finished(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .finished(v) - } - }() - case 15: try { + if let v = v {_storage._payload = .finished(v)} + case 15: var v: BuildEventStream_NamedSetOfFiles? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .namedSetOfFiles(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .namedSetOfFiles(v) - } - }() - case 16: try { + if let v = v {_storage._payload = .namedSetOfFiles(v)} + case 16: var v: BuildEventStream_WorkspaceStatus? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .workspaceStatus(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .workspaceStatus(v) - } - }() - case 17: try { + if let v = v {_storage._payload = .workspaceStatus(v)} + case 17: var v: BuildEventStream_Configuration? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .configuration(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .configuration(v) - } - }() - case 18: try { + if let v = v {_storage._payload = .configuration(v)} + case 18: var v: BuildEventStream_TargetConfigured? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .configured(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .configured(v) - } - }() - case 20: try { try decoder.decodeSingularBoolField(value: &_storage._lastMessage) }() - case 21: try { + if let v = v {_storage._payload = .configured(v)} + case 20: try decoder.decodeSingularBoolField(value: &_storage._lastMessage) + case 21: var v: BuildEventStream_Fetch? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .fetch(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .fetch(v) - } - }() - case 22: try { - var v: CommandLine_CommandLine? - var hadOneofValue = false + if let v = v {_storage._payload = .fetch(v)} + case 22: + var v: src_main_protobuf_command_line_proto.CommandLine_CommandLine? if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .structuredCommandLine(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .structuredCommandLine(v) - } - }() - case 23: try { + if let v = v {_storage._payload = .structuredCommandLine(v)} + case 23: var v: BuildEventStream_BuildToolLogs? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .buildToolLogs(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .buildToolLogs(v) - } - }() - case 24: try { + if let v = v {_storage._payload = .buildToolLogs(v)} + case 24: var v: BuildEventStream_BuildMetrics? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .buildMetrics(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .buildMetrics(v) - } - }() - case 25: try { + if let v = v {_storage._payload = .buildMetrics(v)} + case 25: var v: BuildEventStream_WorkspaceConfig? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .workspaceInfo(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .workspaceInfo(v) - } - }() - case 26: try { + if let v = v {_storage._payload = .workspaceInfo(v)} + case 26: var v: BuildEventStream_BuildMetadata? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .buildMetadata(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .buildMetadata(v) - } - }() - case 27: try { + if let v = v {_storage._payload = .buildMetadata(v)} + case 27: var v: BuildEventStream_ConvenienceSymlinksIdentified? - var hadOneofValue = false if let current = _storage._payload { - hadOneofValue = true + try decoder.handleConflictingOneOf() if case .convenienceSymlinksIdentified(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._payload = .convenienceSymlinksIdentified(v) - } - }() + if let v = v {_storage._payload = .convenienceSymlinksIdentified(v)} default: break } } @@ -5725,111 +5286,65 @@ extension BuildEventStream_BuildEvent: SwiftProtobuf.Message, SwiftProtobuf._Mes public func traverse(visitor: inout V) throws { try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._id { + if let v = _storage._id { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() + } if !_storage._children.isEmpty { try visitor.visitRepeatedMessageField(value: _storage._children, fieldNumber: 2) } switch _storage._payload { - case .progress?: try { - guard case .progress(let v)? = _storage._payload else { preconditionFailure() } + case .progress(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .aborted?: try { - guard case .aborted(let v)? = _storage._payload else { preconditionFailure() } + case .aborted(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case .started?: try { - guard case .started(let v)? = _storage._payload else { preconditionFailure() } + case .started(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - }() - case .expanded?: try { - guard case .expanded(let v)? = _storage._payload else { preconditionFailure() } + case .expanded(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - }() - case .action?: try { - guard case .action(let v)? = _storage._payload else { preconditionFailure() } + case .action(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - }() - case .completed?: try { - guard case .completed(let v)? = _storage._payload else { preconditionFailure() } + case .completed(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - }() - case .testSummary?: try { - guard case .testSummary(let v)? = _storage._payload else { preconditionFailure() } + case .testSummary(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - }() - case .testResult?: try { - guard case .testResult(let v)? = _storage._payload else { preconditionFailure() } + case .testResult(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - }() - case .unstructuredCommandLine?: try { - guard case .unstructuredCommandLine(let v)? = _storage._payload else { preconditionFailure() } + case .unstructuredCommandLine(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - }() - case .optionsParsed?: try { - guard case .optionsParsed(let v)? = _storage._payload else { preconditionFailure() } + case .optionsParsed(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 13) - }() - case .finished?: try { - guard case .finished(let v)? = _storage._payload else { preconditionFailure() } + case .finished(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 14) - }() - case .namedSetOfFiles?: try { - guard case .namedSetOfFiles(let v)? = _storage._payload else { preconditionFailure() } + case .namedSetOfFiles(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - }() - case .workspaceStatus?: try { - guard case .workspaceStatus(let v)? = _storage._payload else { preconditionFailure() } + case .workspaceStatus(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 16) - }() - case .configuration?: try { - guard case .configuration(let v)? = _storage._payload else { preconditionFailure() } + case .configuration(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 17) - }() - case .configured?: try { - guard case .configured(let v)? = _storage._payload else { preconditionFailure() } + case .configured(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 18) - }() + case nil: break default: break } if _storage._lastMessage != false { try visitor.visitSingularBoolField(value: _storage._lastMessage, fieldNumber: 20) } switch _storage._payload { - case .fetch?: try { - guard case .fetch(let v)? = _storage._payload else { preconditionFailure() } + case .fetch(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 21) - }() - case .structuredCommandLine?: try { - guard case .structuredCommandLine(let v)? = _storage._payload else { preconditionFailure() } + case .structuredCommandLine(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 22) - }() - case .buildToolLogs?: try { - guard case .buildToolLogs(let v)? = _storage._payload else { preconditionFailure() } + case .buildToolLogs(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 23) - }() - case .buildMetrics?: try { - guard case .buildMetrics(let v)? = _storage._payload else { preconditionFailure() } + case .buildMetrics(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 24) - }() - case .workspaceInfo?: try { - guard case .workspaceInfo(let v)? = _storage._payload else { preconditionFailure() } + case .workspaceInfo(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 25) - }() - case .buildMetadata?: try { - guard case .buildMetadata(let v)? = _storage._payload else { preconditionFailure() } + case .buildMetadata(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 26) - }() - case .convenienceSymlinksIdentified?: try { - guard case .convenienceSymlinksIdentified(let v)? = _storage._payload else { preconditionFailure() } + case .convenienceSymlinksIdentified(let v)?: try visitor.visitSingularMessageField(value: v, fieldNumber: 27) - }() + case nil: break default: break } } diff --git a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/command_line.pb.swift b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/command_line.pb.swift old mode 100644 new mode 100755 index bd87ccd..63be14c --- a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/command_line.pb.swift +++ b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/command_line.pb.swift @@ -1,5 +1,4 @@ // DO NOT EDIT. -// swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: src/main/protobuf/command_line.proto @@ -7,20 +6,6 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ -// Copyright 2017 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - import Foundation import SwiftProtobuf @@ -29,31 +14,20 @@ import src_main_protobuf_option_filters_proto // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API +// Please ensure that your are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } -/// Representation of a Bazel command line. public struct CommandLine_CommandLine { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// A title for this command line value, to differentiate it from others. - /// In particular, a single invocation may wish to report both the literal and - /// canonical command lines, and this label would be used to differentiate - /// between both versions. This is a string for flexibility. public var commandLineLabel: String = String() - /// A Bazel command line is made of distinct parts. For example, - /// `bazel --nomaster_bazelrc test --nocache_test_results //foo:aTest` - /// has the executable "bazel", a startup flag, a command "test", a command - /// flag, and a test target. There could be many more flags and targets, or - /// none (`bazel info` for example), but the basic structure is there. The - /// command line should be broken down into these logical sections here. public var sections: [CommandLine_CommandLineSection] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -61,59 +35,48 @@ public struct CommandLine_CommandLine { public init() {} } -/// A section of the Bazel command line. public struct CommandLine_CommandLineSection { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The name of this section, such as "startup_option" or "command". - public var sectionLabel: String = String() + public var sectionLabel: String { + get {return _storage._sectionLabel} + set {_uniqueStorage()._sectionLabel = newValue} + } - public var sectionType: CommandLine_CommandLineSection.OneOf_SectionType? = nil + public var sectionType: OneOf_SectionType? { + get {return _storage._sectionType} + set {_uniqueStorage()._sectionType = newValue} + } - /// Sections with non-options, such as the list of targets or the command, - /// should use simple string chunks. public var chunkList: CommandLine_ChunkList { get { - if case .chunkList(let v)? = sectionType {return v} + if case .chunkList(let v)? = _storage._sectionType {return v} return CommandLine_ChunkList() } - set {sectionType = .chunkList(newValue)} + set {_uniqueStorage()._sectionType = .chunkList(newValue)} } - /// Startup and command options are lists of options and belong here. public var optionList: CommandLine_OptionList { get { - if case .optionList(let v)? = sectionType {return v} + if case .optionList(let v)? = _storage._sectionType {return v} return CommandLine_OptionList() } - set {sectionType = .optionList(newValue)} + set {_uniqueStorage()._sectionType = .optionList(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_SectionType: Equatable { - /// Sections with non-options, such as the list of targets or the command, - /// should use simple string chunks. case chunkList(CommandLine_ChunkList) - /// Startup and command options are lists of options and belong here. case optionList(CommandLine_OptionList) #if !swift(>=4.1) public static func ==(lhs: CommandLine_CommandLineSection.OneOf_SectionType, rhs: CommandLine_CommandLineSection.OneOf_SectionType) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.chunkList, .chunkList): return { - guard case .chunkList(let l) = lhs, case .chunkList(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.optionList, .optionList): return { - guard case .optionList(let l) = lhs, case .optionList(let r) = rhs else { preconditionFailure() } - return l == r - }() + case (.chunkList(let l), .chunkList(let r)): return l == r + case (.optionList(let l), .optionList(let r)): return l == r default: return false } } @@ -121,9 +84,10 @@ public struct CommandLine_CommandLineSection { } public init() {} + + fileprivate var _storage = _StorageClass.defaultInstance } -/// Wrapper to allow a list of strings in the "oneof" section_type. public struct CommandLine_ChunkList { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -136,7 +100,6 @@ public struct CommandLine_ChunkList { public init() {} } -/// Wrapper to allow a list of options in the "oneof" section_type. public struct CommandLine_OptionList { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -149,47 +112,20 @@ public struct CommandLine_OptionList { public init() {} } -/// A single command line option. -/// -/// This represents the option itself, but does not take into account the type of -/// option or how the parser interpreted it. If this option is part of a command -/// line that represents the actual input that Bazel received, it would, for -/// example, include expansion flags as they are. However, if this option -/// represents the canonical form of the command line, with the values as Bazel -/// understands them, then the expansion flag, which has no value, would not -/// appear, and the flags it expands to would. public struct CommandLine_Option { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// How the option looks with the option and its value combined. Depending on - /// the purpose of this command line report, this could be the canonical - /// form, or the way that the flag was set. - /// - /// Some examples: this might be `--foo=bar` form, or `--foo bar` with a space; - /// for boolean flags, `--nobaz` is accepted on top of `--baz=false` and other - /// negating values, or for a positive value, the unqualified `--baz` form - /// is also accepted. This could also be a short `-b`, if the flag has an - /// abbreviated form. public var combinedForm: String = String() - /// The canonical name of the option, without the preceding dashes. public var optionName: String = String() - /// The value of the flag, or unset for flags that do not take values. - /// Especially for boolean flags, this should be in canonical form, the - /// combined_form field above gives room for showing the flag as it was set - /// if that is preferred. public var optionValue: String = String() - /// This flag's tagged effects. See OptionEffectTag's java documentation for - /// details. - public var effectTags: [Options_OptionEffectTag] = [] + public var effectTags: [src_main_protobuf_option_filters_proto.Options_OptionEffectTag] = [] - /// Metadata about the flag. See OptionMetadataTag's java documentation for - /// details. - public var metadataTags: [Options_OptionMetadataTag] = [] + public var metadataTags: [src_main_protobuf_option_filters_proto.Options_OptionMetadataTag] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -209,12 +145,9 @@ extension CommandLine_CommandLine: SwiftProtobuf.Message, SwiftProtobuf._Message public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.commandLineLabel) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.sections) }() + case 1: try decoder.decodeSingularStringField(value: &self.commandLineLabel) + case 2: try decoder.decodeRepeatedMessageField(value: &self.sections) default: break } } @@ -246,69 +179,82 @@ extension CommandLine_CommandLineSection: SwiftProtobuf.Message, SwiftProtobuf._ 3: .standard(proto: "option_list"), ] + fileprivate class _StorageClass { + var _sectionLabel: String = String() + var _sectionType: CommandLine_CommandLineSection.OneOf_SectionType? + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _sectionLabel = source._sectionLabel + _sectionType = source._sectionType + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.sectionLabel) }() - case 2: try { - var v: CommandLine_ChunkList? - var hadOneofValue = false - if let current = self.sectionType { - hadOneofValue = true - if case .chunkList(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.sectionType = .chunkList(v) - } - }() - case 3: try { - var v: CommandLine_OptionList? - var hadOneofValue = false - if let current = self.sectionType { - hadOneofValue = true - if case .optionList(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.sectionType = .optionList(v) + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularStringField(value: &_storage._sectionLabel) + case 2: + var v: CommandLine_ChunkList? + if let current = _storage._sectionType { + try decoder.handleConflictingOneOf() + if case .chunkList(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._sectionType = .chunkList(v)} + case 3: + var v: CommandLine_OptionList? + if let current = _storage._sectionType { + try decoder.handleConflictingOneOf() + if case .optionList(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._sectionType = .optionList(v)} + default: break } - }() - default: break } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.sectionLabel.isEmpty { - try visitor.visitSingularStringField(value: self.sectionLabel, fieldNumber: 1) - } - switch self.sectionType { - case .chunkList?: try { - guard case .chunkList(let v)? = self.sectionType else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .optionList?: try { - guard case .optionList(let v)? = self.sectionType else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._sectionLabel.isEmpty { + try visitor.visitSingularStringField(value: _storage._sectionLabel, fieldNumber: 1) + } + switch _storage._sectionType { + case .chunkList(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + case .optionList(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + case nil: break + } } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: CommandLine_CommandLineSection, rhs: CommandLine_CommandLineSection) -> Bool { - if lhs.sectionLabel != rhs.sectionLabel {return false} - if lhs.sectionType != rhs.sectionType {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._sectionLabel != rhs_storage._sectionLabel {return false} + if _storage._sectionType != rhs_storage._sectionType {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -322,11 +268,8 @@ extension CommandLine_ChunkList: SwiftProtobuf.Message, SwiftProtobuf._MessageIm public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.chunk) }() + case 1: try decoder.decodeRepeatedStringField(value: &self.chunk) default: break } } @@ -354,11 +297,8 @@ extension CommandLine_OptionList: SwiftProtobuf.Message, SwiftProtobuf._MessageI public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.option) }() + case 1: try decoder.decodeRepeatedMessageField(value: &self.option) default: break } } @@ -390,15 +330,12 @@ extension CommandLine_Option: SwiftProtobuf.Message, SwiftProtobuf._MessageImple public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.combinedForm) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.optionName) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.optionValue) }() - case 4: try { try decoder.decodeRepeatedEnumField(value: &self.effectTags) }() - case 5: try { try decoder.decodeRepeatedEnumField(value: &self.metadataTags) }() + case 1: try decoder.decodeSingularStringField(value: &self.combinedForm) + case 2: try decoder.decodeSingularStringField(value: &self.optionName) + case 3: try decoder.decodeSingularStringField(value: &self.optionValue) + case 4: try decoder.decodeRepeatedEnumField(value: &self.effectTags) + case 5: try decoder.decodeRepeatedEnumField(value: &self.metadataTags) default: break } } diff --git a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/failure_details.pb.swift b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/failure_details.pb.swift old mode 100644 new mode 100755 index 2d0543c..02c9fb4 --- a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/failure_details.pb.swift +++ b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/failure_details.pb.swift @@ -1,5 +1,4 @@ // DO NOT EDIT. -// swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: src/main/protobuf/failure_details.proto @@ -7,32 +6,13 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ -// Copyright 2020 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file's messages describe any failure(s) that occurred during Bazel's -// handling of a request. The intent is to provide more detail to a Bazel client -// than is conveyed with an exit code, to help those clients decide how to -// respond to, or classify, a failure. - import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API +// Please ensure that your are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} @@ -51,524 +31,203 @@ public struct FailureDetails_FailureDetailMetadata { public init() {} } -/// The FailureDetail message type is designed such that consumers can extract a -/// basic classification of a FailureDetail message even if the consumer was -/// built with a stale definition. This forward compatibility is implemented via -/// conventions on FailureDetail and its submessage types, as follows. -/// -/// *** FailureDetail field numbers -/// -/// Field numbers 1 through 100 (inclusive) are reserved for generally applicable -/// values. Any number of these fields may be set on a FailureDetail message. -/// -/// Field numbers 101 through 10,000 (inclusive) are reserved for use inside the -/// "oneof" structure. Only one of these values should be set on a FailureDetail -/// message. -/// -/// Additional fields numbers are unlikely to be needed, but, for extreme future- -/// proofing purposes, field numbers 10,001 through 1,000,000 (inclusive; -/// excluding protobuf's reserved range 19000 through 19999) are reserved for -/// additional generally applicable values. -/// -/// *** FailureDetail's "oneof" submessages -/// -/// Each field in the "oneof" structure is a submessage corresponding to a -/// category of failure. -/// -/// In each of these submessage types, field number 1 is an enum whose values -/// correspond to a subcategory of the failure. Generally, the enum's constant -/// which maps to 0 should be interpreted as "unspecified", though this is not -/// required. -/// -/// *** Recommended forward compatibility strategy -/// -/// The recommended forward compatibility strategy is to reduce a FailureDetail -/// message to a pair of integers. -/// -/// The first integer corresponds to the field number of the submessage set -/// inside FailureDetail's "oneof", which corresponds with the failure's -/// category. -/// -/// The second integer corresponds to the value of the enum at field number 1 -/// within that submessage, which corresponds with the failure's subcategory. -/// -/// WARNING: This functionality is experimental and should not be relied on at -/// this time. -/// TODO(mschaller): remove experimental warning public struct FailureDetails_FailureDetail { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// A short human-readable message describing the failure, for debugging. - /// - /// This value is *not* intended to be used algorithmically. - public var message: String = String() + public var message: String { + get {return _storage._message} + set {_uniqueStorage()._message = newValue} + } - public var category: FailureDetails_FailureDetail.OneOf_Category? = nil + public var category: OneOf_Category? { + get {return _storage._category} + set {_uniqueStorage()._category = newValue} + } public var interrupted: FailureDetails_Interrupted { get { - if case .interrupted(let v)? = category {return v} + if case .interrupted(let v)? = _storage._category {return v} return FailureDetails_Interrupted() } - set {category = .interrupted(newValue)} + set {_uniqueStorage()._category = .interrupted(newValue)} } public var externalRepository: FailureDetails_ExternalRepository { get { - if case .externalRepository(let v)? = category {return v} + if case .externalRepository(let v)? = _storage._category {return v} return FailureDetails_ExternalRepository() } - set {category = .externalRepository(newValue)} + set {_uniqueStorage()._category = .externalRepository(newValue)} } public var buildProgress: FailureDetails_BuildProgress { get { - if case .buildProgress(let v)? = category {return v} + if case .buildProgress(let v)? = _storage._category {return v} return FailureDetails_BuildProgress() } - set {category = .buildProgress(newValue)} + set {_uniqueStorage()._category = .buildProgress(newValue)} } public var remoteOptions: FailureDetails_RemoteOptions { get { - if case .remoteOptions(let v)? = category {return v} + if case .remoteOptions(let v)? = _storage._category {return v} return FailureDetails_RemoteOptions() } - set {category = .remoteOptions(newValue)} + set {_uniqueStorage()._category = .remoteOptions(newValue)} } public var clientEnvironment: FailureDetails_ClientEnvironment { get { - if case .clientEnvironment(let v)? = category {return v} + if case .clientEnvironment(let v)? = _storage._category {return v} return FailureDetails_ClientEnvironment() } - set {category = .clientEnvironment(newValue)} + set {_uniqueStorage()._category = .clientEnvironment(newValue)} } public var crash: FailureDetails_Crash { get { - if case .crash(let v)? = category {return v} + if case .crash(let v)? = _storage._category {return v} return FailureDetails_Crash() } - set {category = .crash(newValue)} + set {_uniqueStorage()._category = .crash(newValue)} } public var symlinkForest: FailureDetails_SymlinkForest { get { - if case .symlinkForest(let v)? = category {return v} + if case .symlinkForest(let v)? = _storage._category {return v} return FailureDetails_SymlinkForest() } - set {category = .symlinkForest(newValue)} + set {_uniqueStorage()._category = .symlinkForest(newValue)} } public var packageOptions: FailureDetails_PackageOptions { get { - if case .packageOptions(let v)? = category {return v} + if case .packageOptions(let v)? = _storage._category {return v} return FailureDetails_PackageOptions() } - set {category = .packageOptions(newValue)} + set {_uniqueStorage()._category = .packageOptions(newValue)} } public var remoteExecution: FailureDetails_RemoteExecution { get { - if case .remoteExecution(let v)? = category {return v} + if case .remoteExecution(let v)? = _storage._category {return v} return FailureDetails_RemoteExecution() } - set {category = .remoteExecution(newValue)} + set {_uniqueStorage()._category = .remoteExecution(newValue)} } public var execution: FailureDetails_Execution { get { - if case .execution(let v)? = category {return v} + if case .execution(let v)? = _storage._category {return v} return FailureDetails_Execution() } - set {category = .execution(newValue)} + set {_uniqueStorage()._category = .execution(newValue)} } public var workspaces: FailureDetails_Workspaces { get { - if case .workspaces(let v)? = category {return v} + if case .workspaces(let v)? = _storage._category {return v} return FailureDetails_Workspaces() } - set {category = .workspaces(newValue)} + set {_uniqueStorage()._category = .workspaces(newValue)} } public var crashOptions: FailureDetails_CrashOptions { get { - if case .crashOptions(let v)? = category {return v} + if case .crashOptions(let v)? = _storage._category {return v} return FailureDetails_CrashOptions() } - set {category = .crashOptions(newValue)} + set {_uniqueStorage()._category = .crashOptions(newValue)} } public var filesystem: FailureDetails_Filesystem { get { - if case .filesystem(let v)? = category {return v} + if case .filesystem(let v)? = _storage._category {return v} return FailureDetails_Filesystem() } - set {category = .filesystem(newValue)} + set {_uniqueStorage()._category = .filesystem(newValue)} } public var executionOptions: FailureDetails_ExecutionOptions { get { - if case .executionOptions(let v)? = category {return v} + if case .executionOptions(let v)? = _storage._category {return v} return FailureDetails_ExecutionOptions() } - set {category = .executionOptions(newValue)} + set {_uniqueStorage()._category = .executionOptions(newValue)} } public var command: FailureDetails_Command { get { - if case .command(let v)? = category {return v} + if case .command(let v)? = _storage._category {return v} return FailureDetails_Command() } - set {category = .command(newValue)} + set {_uniqueStorage()._category = .command(newValue)} } public var spawn: FailureDetails_Spawn { get { - if case .spawn(let v)? = category {return v} + if case .spawn(let v)? = _storage._category {return v} return FailureDetails_Spawn() } - set {category = .spawn(newValue)} + set {_uniqueStorage()._category = .spawn(newValue)} } public var grpcServer: FailureDetails_GrpcServer { get { - if case .grpcServer(let v)? = category {return v} + if case .grpcServer(let v)? = _storage._category {return v} return FailureDetails_GrpcServer() } - set {category = .grpcServer(newValue)} + set {_uniqueStorage()._category = .grpcServer(newValue)} } public var canonicalizeFlags: FailureDetails_CanonicalizeFlags { get { - if case .canonicalizeFlags(let v)? = category {return v} + if case .canonicalizeFlags(let v)? = _storage._category {return v} return FailureDetails_CanonicalizeFlags() } - set {category = .canonicalizeFlags(newValue)} + set {_uniqueStorage()._category = .canonicalizeFlags(newValue)} } public var buildConfiguration: FailureDetails_BuildConfiguration { get { - if case .buildConfiguration(let v)? = category {return v} + if case .buildConfiguration(let v)? = _storage._category {return v} return FailureDetails_BuildConfiguration() } - set {category = .buildConfiguration(newValue)} + set {_uniqueStorage()._category = .buildConfiguration(newValue)} } public var infoCommand: FailureDetails_InfoCommand { get { - if case .infoCommand(let v)? = category {return v} + if case .infoCommand(let v)? = _storage._category {return v} return FailureDetails_InfoCommand() } - set {category = .infoCommand(newValue)} + set {_uniqueStorage()._category = .infoCommand(newValue)} } public var memoryOptions: FailureDetails_MemoryOptions { get { - if case .memoryOptions(let v)? = category {return v} + if case .memoryOptions(let v)? = _storage._category {return v} return FailureDetails_MemoryOptions() } - set {category = .memoryOptions(newValue)} + set {_uniqueStorage()._category = .memoryOptions(newValue)} } public var query: FailureDetails_Query { get { - if case .query(let v)? = category {return v} + if case .query(let v)? = _storage._category {return v} return FailureDetails_Query() } - set {category = .query(newValue)} + set {_uniqueStorage()._category = .query(newValue)} } public var localExecution: FailureDetails_LocalExecution { get { - if case .localExecution(let v)? = category {return v} + if case .localExecution(let v)? = _storage._category {return v} return FailureDetails_LocalExecution() } - set {category = .localExecution(newValue)} - } - - public var actionCache: FailureDetails_ActionCache { - get { - if case .actionCache(let v)? = category {return v} - return FailureDetails_ActionCache() - } - set {category = .actionCache(newValue)} - } - - public var fetchCommand: FailureDetails_FetchCommand { - get { - if case .fetchCommand(let v)? = category {return v} - return FailureDetails_FetchCommand() - } - set {category = .fetchCommand(newValue)} - } - - public var syncCommand: FailureDetails_SyncCommand { - get { - if case .syncCommand(let v)? = category {return v} - return FailureDetails_SyncCommand() - } - set {category = .syncCommand(newValue)} - } - - public var sandbox: FailureDetails_Sandbox { - get { - if case .sandbox(let v)? = category {return v} - return FailureDetails_Sandbox() - } - set {category = .sandbox(newValue)} - } - - public var includeScanning: FailureDetails_IncludeScanning { - get { - if case .includeScanning(let v)? = category {return v} - return FailureDetails_IncludeScanning() - } - set {category = .includeScanning(newValue)} - } - - public var testCommand: FailureDetails_TestCommand { - get { - if case .testCommand(let v)? = category {return v} - return FailureDetails_TestCommand() - } - set {category = .testCommand(newValue)} - } - - public var actionQuery: FailureDetails_ActionQuery { - get { - if case .actionQuery(let v)? = category {return v} - return FailureDetails_ActionQuery() - } - set {category = .actionQuery(newValue)} - } - - public var targetPatterns: FailureDetails_TargetPatterns { - get { - if case .targetPatterns(let v)? = category {return v} - return FailureDetails_TargetPatterns() - } - set {category = .targetPatterns(newValue)} - } - - public var cleanCommand: FailureDetails_CleanCommand { - get { - if case .cleanCommand(let v)? = category {return v} - return FailureDetails_CleanCommand() - } - set {category = .cleanCommand(newValue)} - } - - public var configCommand: FailureDetails_ConfigCommand { - get { - if case .configCommand(let v)? = category {return v} - return FailureDetails_ConfigCommand() - } - set {category = .configCommand(newValue)} - } - - public var configurableQuery: FailureDetails_ConfigurableQuery { - get { - if case .configurableQuery(let v)? = category {return v} - return FailureDetails_ConfigurableQuery() - } - set {category = .configurableQuery(newValue)} - } - - public var dumpCommand: FailureDetails_DumpCommand { - get { - if case .dumpCommand(let v)? = category {return v} - return FailureDetails_DumpCommand() - } - set {category = .dumpCommand(newValue)} - } - - public var helpCommand: FailureDetails_HelpCommand { - get { - if case .helpCommand(let v)? = category {return v} - return FailureDetails_HelpCommand() - } - set {category = .helpCommand(newValue)} - } - - public var mobileInstall: FailureDetails_MobileInstall { - get { - if case .mobileInstall(let v)? = category {return v} - return FailureDetails_MobileInstall() - } - set {category = .mobileInstall(newValue)} - } - - public var profileCommand: FailureDetails_ProfileCommand { - get { - if case .profileCommand(let v)? = category {return v} - return FailureDetails_ProfileCommand() - } - set {category = .profileCommand(newValue)} - } - - public var runCommand: FailureDetails_RunCommand { - get { - if case .runCommand(let v)? = category {return v} - return FailureDetails_RunCommand() - } - set {category = .runCommand(newValue)} - } - - public var versionCommand: FailureDetails_VersionCommand { - get { - if case .versionCommand(let v)? = category {return v} - return FailureDetails_VersionCommand() - } - set {category = .versionCommand(newValue)} - } - - public var printActionCommand: FailureDetails_PrintActionCommand { - get { - if case .printActionCommand(let v)? = category {return v} - return FailureDetails_PrintActionCommand() - } - set {category = .printActionCommand(newValue)} - } - - public var workspaceStatus: FailureDetails_WorkspaceStatus { - get { - if case .workspaceStatus(let v)? = category {return v} - return FailureDetails_WorkspaceStatus() - } - set {category = .workspaceStatus(newValue)} - } - - public var javaCompile: FailureDetails_JavaCompile { - get { - if case .javaCompile(let v)? = category {return v} - return FailureDetails_JavaCompile() - } - set {category = .javaCompile(newValue)} - } - - public var actionRewinding: FailureDetails_ActionRewinding { - get { - if case .actionRewinding(let v)? = category {return v} - return FailureDetails_ActionRewinding() - } - set {category = .actionRewinding(newValue)} - } - - public var cppCompile: FailureDetails_CppCompile { - get { - if case .cppCompile(let v)? = category {return v} - return FailureDetails_CppCompile() - } - set {category = .cppCompile(newValue)} - } - - public var starlarkAction: FailureDetails_StarlarkAction { - get { - if case .starlarkAction(let v)? = category {return v} - return FailureDetails_StarlarkAction() - } - set {category = .starlarkAction(newValue)} - } - - public var ninjaAction: FailureDetails_NinjaAction { - get { - if case .ninjaAction(let v)? = category {return v} - return FailureDetails_NinjaAction() - } - set {category = .ninjaAction(newValue)} - } - - public var dynamicExecution: FailureDetails_DynamicExecution { - get { - if case .dynamicExecution(let v)? = category {return v} - return FailureDetails_DynamicExecution() - } - set {category = .dynamicExecution(newValue)} - } - - public var failAction: FailureDetails_FailAction { - get { - if case .failAction(let v)? = category {return v} - return FailureDetails_FailAction() - } - set {category = .failAction(newValue)} - } - - public var symlinkAction: FailureDetails_SymlinkAction { - get { - if case .symlinkAction(let v)? = category {return v} - return FailureDetails_SymlinkAction() - } - set {category = .symlinkAction(newValue)} - } - - public var cppLink: FailureDetails_CppLink { - get { - if case .cppLink(let v)? = category {return v} - return FailureDetails_CppLink() - } - set {category = .cppLink(newValue)} - } - - public var ltoAction: FailureDetails_LtoAction { - get { - if case .ltoAction(let v)? = category {return v} - return FailureDetails_LtoAction() - } - set {category = .ltoAction(newValue)} - } - - public var testAction: FailureDetails_TestAction { - get { - if case .testAction(let v)? = category {return v} - return FailureDetails_TestAction() - } - set {category = .testAction(newValue)} - } - - public var worker: FailureDetails_Worker { - get { - if case .worker(let v)? = category {return v} - return FailureDetails_Worker() - } - set {category = .worker(newValue)} - } - - public var analysis: FailureDetails_Analysis { - get { - if case .analysis(let v)? = category {return v} - return FailureDetails_Analysis() - } - set {category = .analysis(newValue)} - } - - public var packageLoading: FailureDetails_PackageLoading { - get { - if case .packageLoading(let v)? = category {return v} - return FailureDetails_PackageLoading() - } - set {category = .packageLoading(newValue)} - } - - public var toolchain: FailureDetails_Toolchain { - get { - if case .toolchain(let v)? = category {return v} - return FailureDetails_Toolchain() - } - set {category = .toolchain(newValue)} - } - - public var starlarkLoading: FailureDetails_StarlarkLoading { - get { - if case .starlarkLoading(let v)? = category {return v} - return FailureDetails_StarlarkLoading() - } - set {category = .starlarkLoading(newValue)} + set {_uniqueStorage()._category = .localExecution(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -597,280 +256,33 @@ public struct FailureDetails_FailureDetail { case memoryOptions(FailureDetails_MemoryOptions) case query(FailureDetails_Query) case localExecution(FailureDetails_LocalExecution) - case actionCache(FailureDetails_ActionCache) - case fetchCommand(FailureDetails_FetchCommand) - case syncCommand(FailureDetails_SyncCommand) - case sandbox(FailureDetails_Sandbox) - case includeScanning(FailureDetails_IncludeScanning) - case testCommand(FailureDetails_TestCommand) - case actionQuery(FailureDetails_ActionQuery) - case targetPatterns(FailureDetails_TargetPatterns) - case cleanCommand(FailureDetails_CleanCommand) - case configCommand(FailureDetails_ConfigCommand) - case configurableQuery(FailureDetails_ConfigurableQuery) - case dumpCommand(FailureDetails_DumpCommand) - case helpCommand(FailureDetails_HelpCommand) - case mobileInstall(FailureDetails_MobileInstall) - case profileCommand(FailureDetails_ProfileCommand) - case runCommand(FailureDetails_RunCommand) - case versionCommand(FailureDetails_VersionCommand) - case printActionCommand(FailureDetails_PrintActionCommand) - case workspaceStatus(FailureDetails_WorkspaceStatus) - case javaCompile(FailureDetails_JavaCompile) - case actionRewinding(FailureDetails_ActionRewinding) - case cppCompile(FailureDetails_CppCompile) - case starlarkAction(FailureDetails_StarlarkAction) - case ninjaAction(FailureDetails_NinjaAction) - case dynamicExecution(FailureDetails_DynamicExecution) - case failAction(FailureDetails_FailAction) - case symlinkAction(FailureDetails_SymlinkAction) - case cppLink(FailureDetails_CppLink) - case ltoAction(FailureDetails_LtoAction) - case testAction(FailureDetails_TestAction) - case worker(FailureDetails_Worker) - case analysis(FailureDetails_Analysis) - case packageLoading(FailureDetails_PackageLoading) - case toolchain(FailureDetails_Toolchain) - case starlarkLoading(FailureDetails_StarlarkLoading) #if !swift(>=4.1) public static func ==(lhs: FailureDetails_FailureDetail.OneOf_Category, rhs: FailureDetails_FailureDetail.OneOf_Category) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.interrupted, .interrupted): return { - guard case .interrupted(let l) = lhs, case .interrupted(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.externalRepository, .externalRepository): return { - guard case .externalRepository(let l) = lhs, case .externalRepository(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.buildProgress, .buildProgress): return { - guard case .buildProgress(let l) = lhs, case .buildProgress(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.remoteOptions, .remoteOptions): return { - guard case .remoteOptions(let l) = lhs, case .remoteOptions(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.clientEnvironment, .clientEnvironment): return { - guard case .clientEnvironment(let l) = lhs, case .clientEnvironment(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.crash, .crash): return { - guard case .crash(let l) = lhs, case .crash(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.symlinkForest, .symlinkForest): return { - guard case .symlinkForest(let l) = lhs, case .symlinkForest(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.packageOptions, .packageOptions): return { - guard case .packageOptions(let l) = lhs, case .packageOptions(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.remoteExecution, .remoteExecution): return { - guard case .remoteExecution(let l) = lhs, case .remoteExecution(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.execution, .execution): return { - guard case .execution(let l) = lhs, case .execution(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.workspaces, .workspaces): return { - guard case .workspaces(let l) = lhs, case .workspaces(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.crashOptions, .crashOptions): return { - guard case .crashOptions(let l) = lhs, case .crashOptions(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.filesystem, .filesystem): return { - guard case .filesystem(let l) = lhs, case .filesystem(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.executionOptions, .executionOptions): return { - guard case .executionOptions(let l) = lhs, case .executionOptions(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.command, .command): return { - guard case .command(let l) = lhs, case .command(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.spawn, .spawn): return { - guard case .spawn(let l) = lhs, case .spawn(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.grpcServer, .grpcServer): return { - guard case .grpcServer(let l) = lhs, case .grpcServer(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.canonicalizeFlags, .canonicalizeFlags): return { - guard case .canonicalizeFlags(let l) = lhs, case .canonicalizeFlags(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.buildConfiguration, .buildConfiguration): return { - guard case .buildConfiguration(let l) = lhs, case .buildConfiguration(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.infoCommand, .infoCommand): return { - guard case .infoCommand(let l) = lhs, case .infoCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.memoryOptions, .memoryOptions): return { - guard case .memoryOptions(let l) = lhs, case .memoryOptions(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.query, .query): return { - guard case .query(let l) = lhs, case .query(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.localExecution, .localExecution): return { - guard case .localExecution(let l) = lhs, case .localExecution(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.actionCache, .actionCache): return { - guard case .actionCache(let l) = lhs, case .actionCache(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.fetchCommand, .fetchCommand): return { - guard case .fetchCommand(let l) = lhs, case .fetchCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.syncCommand, .syncCommand): return { - guard case .syncCommand(let l) = lhs, case .syncCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.sandbox, .sandbox): return { - guard case .sandbox(let l) = lhs, case .sandbox(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.includeScanning, .includeScanning): return { - guard case .includeScanning(let l) = lhs, case .includeScanning(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.testCommand, .testCommand): return { - guard case .testCommand(let l) = lhs, case .testCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.actionQuery, .actionQuery): return { - guard case .actionQuery(let l) = lhs, case .actionQuery(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.targetPatterns, .targetPatterns): return { - guard case .targetPatterns(let l) = lhs, case .targetPatterns(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.cleanCommand, .cleanCommand): return { - guard case .cleanCommand(let l) = lhs, case .cleanCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.configCommand, .configCommand): return { - guard case .configCommand(let l) = lhs, case .configCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.configurableQuery, .configurableQuery): return { - guard case .configurableQuery(let l) = lhs, case .configurableQuery(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.dumpCommand, .dumpCommand): return { - guard case .dumpCommand(let l) = lhs, case .dumpCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.helpCommand, .helpCommand): return { - guard case .helpCommand(let l) = lhs, case .helpCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.mobileInstall, .mobileInstall): return { - guard case .mobileInstall(let l) = lhs, case .mobileInstall(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.profileCommand, .profileCommand): return { - guard case .profileCommand(let l) = lhs, case .profileCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.runCommand, .runCommand): return { - guard case .runCommand(let l) = lhs, case .runCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.versionCommand, .versionCommand): return { - guard case .versionCommand(let l) = lhs, case .versionCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.printActionCommand, .printActionCommand): return { - guard case .printActionCommand(let l) = lhs, case .printActionCommand(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.workspaceStatus, .workspaceStatus): return { - guard case .workspaceStatus(let l) = lhs, case .workspaceStatus(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.javaCompile, .javaCompile): return { - guard case .javaCompile(let l) = lhs, case .javaCompile(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.actionRewinding, .actionRewinding): return { - guard case .actionRewinding(let l) = lhs, case .actionRewinding(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.cppCompile, .cppCompile): return { - guard case .cppCompile(let l) = lhs, case .cppCompile(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.starlarkAction, .starlarkAction): return { - guard case .starlarkAction(let l) = lhs, case .starlarkAction(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.ninjaAction, .ninjaAction): return { - guard case .ninjaAction(let l) = lhs, case .ninjaAction(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.dynamicExecution, .dynamicExecution): return { - guard case .dynamicExecution(let l) = lhs, case .dynamicExecution(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.failAction, .failAction): return { - guard case .failAction(let l) = lhs, case .failAction(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.symlinkAction, .symlinkAction): return { - guard case .symlinkAction(let l) = lhs, case .symlinkAction(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.cppLink, .cppLink): return { - guard case .cppLink(let l) = lhs, case .cppLink(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.ltoAction, .ltoAction): return { - guard case .ltoAction(let l) = lhs, case .ltoAction(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.testAction, .testAction): return { - guard case .testAction(let l) = lhs, case .testAction(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.worker, .worker): return { - guard case .worker(let l) = lhs, case .worker(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.analysis, .analysis): return { - guard case .analysis(let l) = lhs, case .analysis(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.packageLoading, .packageLoading): return { - guard case .packageLoading(let l) = lhs, case .packageLoading(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.toolchain, .toolchain): return { - guard case .toolchain(let l) = lhs, case .toolchain(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.starlarkLoading, .starlarkLoading): return { - guard case .starlarkLoading(let l) = lhs, case .starlarkLoading(let r) = rhs else { preconditionFailure() } - return l == r - }() + case (.interrupted(let l), .interrupted(let r)): return l == r + case (.externalRepository(let l), .externalRepository(let r)): return l == r + case (.buildProgress(let l), .buildProgress(let r)): return l == r + case (.remoteOptions(let l), .remoteOptions(let r)): return l == r + case (.clientEnvironment(let l), .clientEnvironment(let r)): return l == r + case (.crash(let l), .crash(let r)): return l == r + case (.symlinkForest(let l), .symlinkForest(let r)): return l == r + case (.packageOptions(let l), .packageOptions(let r)): return l == r + case (.remoteExecution(let l), .remoteExecution(let r)): return l == r + case (.execution(let l), .execution(let r)): return l == r + case (.workspaces(let l), .workspaces(let r)): return l == r + case (.crashOptions(let l), .crashOptions(let r)): return l == r + case (.filesystem(let l), .filesystem(let r)): return l == r + case (.executionOptions(let l), .executionOptions(let r)): return l == r + case (.command(let l), .command(let r)): return l == r + case (.spawn(let l), .spawn(let r)): return l == r + case (.grpcServer(let l), .grpcServer(let r)): return l == r + case (.canonicalizeFlags(let l), .canonicalizeFlags(let r)): return l == r + case (.buildConfiguration(let l), .buildConfiguration(let r)): return l == r + case (.infoCommand(let l), .infoCommand(let r)): return l == r + case (.memoryOptions(let l), .memoryOptions(let r)): return l == r + case (.query(let l), .query(let r)): return l == r + case (.localExecution(let l), .localExecution(let r)): return l == r default: return false } } @@ -878,6 +290,8 @@ public struct FailureDetails_FailureDetail { } public init() {} + + fileprivate var _storage = _StorageClass.defaultInstance } public struct FailureDetails_Interrupted { @@ -891,29 +305,14 @@ public struct FailureDetails_Interrupted { public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int - - /// Unknown interrupt. Avoid using this code, instead use INTERRUPTED. case interruptedUnknown // = 0 - - /// Command was interrupted (cancelled). - case interrupted // = 28 - - /// The following more specific interrupt codes have been deprecated and - /// consolidated into INTERRUPTED. - case deprecatedBuild // = 4 - case deprecatedBuildCompletion // = 5 - case deprecatedPackageLoadingSync // = 6 - case deprecatedExecutorCompletion // = 7 - case deprecatedCommandDispatch // = 8 - case deprecatedInfoItem // = 9 - case deprecatedAfterQuery // = 10 - case deprecatedFetchCommand // = 17 - case deprecatedSyncCommand // = 18 - case deprecatedCleanCommand // = 20 - case deprecatedMobileInstallCommand // = 21 - case deprecatedQuery // = 22 - case deprecatedRunCommand // = 23 - case deprecatedOptionsParsing // = 27 + case build // = 4 + case buildCompletion // = 5 + case packageLoadingSync // = 6 + case executorCompletion // = 7 + case commandDispatch // = 8 + case infoItem // = 9 + case afterQuery // = 10 case UNRECOGNIZED(Int) public init() { @@ -923,21 +322,13 @@ public struct FailureDetails_Interrupted { public init?(rawValue: Int) { switch rawValue { case 0: self = .interruptedUnknown - case 4: self = .deprecatedBuild - case 5: self = .deprecatedBuildCompletion - case 6: self = .deprecatedPackageLoadingSync - case 7: self = .deprecatedExecutorCompletion - case 8: self = .deprecatedCommandDispatch - case 9: self = .deprecatedInfoItem - case 10: self = .deprecatedAfterQuery - case 17: self = .deprecatedFetchCommand - case 18: self = .deprecatedSyncCommand - case 20: self = .deprecatedCleanCommand - case 21: self = .deprecatedMobileInstallCommand - case 22: self = .deprecatedQuery - case 23: self = .deprecatedRunCommand - case 27: self = .deprecatedOptionsParsing - case 28: self = .interrupted + case 4: self = .build + case 5: self = .buildCompletion + case 6: self = .packageLoadingSync + case 7: self = .executorCompletion + case 8: self = .commandDispatch + case 9: self = .infoItem + case 10: self = .afterQuery default: self = .UNRECOGNIZED(rawValue) } } @@ -945,21 +336,13 @@ public struct FailureDetails_Interrupted { public var rawValue: Int { switch self { case .interruptedUnknown: return 0 - case .deprecatedBuild: return 4 - case .deprecatedBuildCompletion: return 5 - case .deprecatedPackageLoadingSync: return 6 - case .deprecatedExecutorCompletion: return 7 - case .deprecatedCommandDispatch: return 8 - case .deprecatedInfoItem: return 9 - case .deprecatedAfterQuery: return 10 - case .deprecatedFetchCommand: return 17 - case .deprecatedSyncCommand: return 18 - case .deprecatedCleanCommand: return 20 - case .deprecatedMobileInstallCommand: return 21 - case .deprecatedQuery: return 22 - case .deprecatedRunCommand: return 23 - case .deprecatedOptionsParsing: return 27 - case .interrupted: return 28 + case .build: return 4 + case .buildCompletion: return 5 + case .packageLoadingSync: return 6 + case .executorCompletion: return 7 + case .commandDispatch: return 8 + case .infoItem: return 9 + case .afterQuery: return 10 case .UNRECOGNIZED(let i): return i } } @@ -975,21 +358,13 @@ extension FailureDetails_Interrupted.Code: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. public static var allCases: [FailureDetails_Interrupted.Code] = [ .interruptedUnknown, - .interrupted, - .deprecatedBuild, - .deprecatedBuildCompletion, - .deprecatedPackageLoadingSync, - .deprecatedExecutorCompletion, - .deprecatedCommandDispatch, - .deprecatedInfoItem, - .deprecatedAfterQuery, - .deprecatedFetchCommand, - .deprecatedSyncCommand, - .deprecatedCleanCommand, - .deprecatedMobileInstallCommand, - .deprecatedQuery, - .deprecatedRunCommand, - .deprecatedOptionsParsing, + .build, + .buildCompletion, + .packageLoadingSync, + .executorCompletion, + .commandDispatch, + .infoItem, + .afterQuery, ] } @@ -1002,16 +377,8 @@ public struct FailureDetails_Spawn { public var code: FailureDetails_Spawn.Code = .spawnUnknown - /// For Codes describing generic failure to spawn (eg. EXECUTION_FAILED and - /// EXECUTION_DENIED) the `catastrophic` field may be set to true indicating a - /// failure that immediately terminated the entire build tool. public var catastrophic: Bool = false - /// If Code is NON_ZERO_EXIT, the `spawn_exit_code` field may be set to the - /// non-zero exit code returned by the spawned process to the OS. - /// - /// NOTE: This field must not be confused with the build tool's overall - /// exit code. public var spawnExitCode: Int32 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1019,27 +386,12 @@ public struct FailureDetails_Spawn { public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int case spawnUnknown // = 0 - - /// See the SpawnResult.Status Java enum for definitions of the following - /// Spawn failure codes. case nonZeroExit // = 1 case timeout // = 2 - - /// Note: Spawn OUT_OF_MEMORY leads to a BUILD_FAILURE exit_code because the - /// build tool itself did not run out of memory. case outOfMemory // = 3 case executionFailed // = 4 case executionDenied // = 5 case remoteCacheFailed // = 6 - case commandLineExpansionFailure // = 7 - case execIoException // = 8 - case invalidTimeout // = 9 - case invalidRemoteExecutionProperties // = 10 - case noUsableStrategyFound // = 11 - - /// TODO(b/138456686): this code should be deprecated when SpawnResult is - /// refactored to prohibit undetailed failures - case unspecifiedExecutionFailure // = 12 case UNRECOGNIZED(Int) public init() { @@ -1055,12 +407,6 @@ public struct FailureDetails_Spawn { case 4: self = .executionFailed case 5: self = .executionDenied case 6: self = .remoteCacheFailed - case 7: self = .commandLineExpansionFailure - case 8: self = .execIoException - case 9: self = .invalidTimeout - case 10: self = .invalidRemoteExecutionProperties - case 11: self = .noUsableStrategyFound - case 12: self = .unspecifiedExecutionFailure default: self = .UNRECOGNIZED(rawValue) } } @@ -1074,12 +420,6 @@ public struct FailureDetails_Spawn { case .executionFailed: return 4 case .executionDenied: return 5 case .remoteCacheFailed: return 6 - case .commandLineExpansionFailure: return 7 - case .execIoException: return 8 - case .invalidTimeout: return 9 - case .invalidRemoteExecutionProperties: return 10 - case .noUsableStrategyFound: return 11 - case .unspecifiedExecutionFailure: return 12 case .UNRECOGNIZED(let i): return i } } @@ -1101,12 +441,6 @@ extension FailureDetails_Spawn.Code: CaseIterable { .executionFailed, .executionDenied, .remoteCacheFailed, - .commandLineExpansionFailure, - .execIoException, - .invalidTimeout, - .invalidRemoteExecutionProperties, - .noUsableStrategyFound, - .unspecifiedExecutionFailure, ] } @@ -1117,7 +451,6 @@ public struct FailureDetails_ExternalRepository { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Additional data could include external repository names. public var code: FailureDetails_ExternalRepository.Code = .externalRepositoryUnknown public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1126,7 +459,6 @@ public struct FailureDetails_ExternalRepository { public typealias RawValue = Int case externalRepositoryUnknown // = 0 case overrideDisallowedManagedDirectories // = 1 - case badDownloaderConfig // = 2 case UNRECOGNIZED(Int) public init() { @@ -1137,7 +469,6 @@ public struct FailureDetails_ExternalRepository { switch rawValue { case 0: self = .externalRepositoryUnknown case 1: self = .overrideDisallowedManagedDirectories - case 2: self = .badDownloaderConfig default: self = .UNRECOGNIZED(rawValue) } } @@ -1146,7 +477,6 @@ public struct FailureDetails_ExternalRepository { switch self { case .externalRepositoryUnknown: return 0 case .overrideDisallowedManagedDirectories: return 1 - case .badDownloaderConfig: return 2 case .UNRECOGNIZED(let i): return i } } @@ -1163,7 +493,6 @@ extension FailureDetails_ExternalRepository.Code: CaseIterable { public static var allCases: [FailureDetails_ExternalRepository.Code] = [ .externalRepositoryUnknown, .overrideDisallowedManagedDirectories, - .badDownloaderConfig, ] } @@ -1174,7 +503,6 @@ public struct FailureDetails_BuildProgress { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Additional data could include the build progress upload endpoint. public var code: FailureDetails_BuildProgress.Code = .buildProgressUnknown public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1291,11 +619,7 @@ public struct FailureDetails_RemoteOptions { public typealias RawValue = Int case remoteOptionsUnknown // = 0 case remoteDefaultExecPropertiesLogicError // = 1 - - /// Credentials could not be read from the requested file/socket/process/etc. case credentialsReadFailure // = 2 - - /// Credentials could not be written to a shared, temporary file. case credentialsWriteFailure // = 3 case downloaderWithoutGrpcCache // = 4 case executionWithInvalidCache // = 5 @@ -1409,8 +733,6 @@ public struct FailureDetails_Crash { public var code: FailureDetails_Crash.Code = .crashUnknown - /// The cause chain of the crash, with the outermost throwable first. Limited - /// to the outermost exception and at most 4 nested causes (so, max size of 5). public var causes: [FailureDetails_Throwable] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1463,15 +785,10 @@ public struct FailureDetails_Throwable { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The class name of the java.lang.Throwable. public var throwableClass: String = String() - /// The throwable's message. public var message: String = String() - /// The result of calling toString on the deepest (i.e. closest to the - /// throwable's construction site) 1000 (or fewer) StackTraceElements. - /// Unstructured to simplify string matching. public var stackTrace: [String] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -1493,7 +810,6 @@ public struct FailureDetails_SymlinkForest { case symlinkForestUnknown // = 0 case toplevelOutdirPackagePathConflict // = 1 case toplevelOutdirUsedAsSource // = 2 - case creationFailed // = 3 case UNRECOGNIZED(Int) public init() { @@ -1505,7 +821,6 @@ public struct FailureDetails_SymlinkForest { case 0: self = .symlinkForestUnknown case 1: self = .toplevelOutdirPackagePathConflict case 2: self = .toplevelOutdirUsedAsSource - case 3: self = .creationFailed default: self = .UNRECOGNIZED(rawValue) } } @@ -1515,7 +830,6 @@ public struct FailureDetails_SymlinkForest { case .symlinkForestUnknown: return 0 case .toplevelOutdirPackagePathConflict: return 1 case .toplevelOutdirUsedAsSource: return 2 - case .creationFailed: return 3 case .UNRECOGNIZED(let i): return i } } @@ -1533,7 +847,6 @@ extension FailureDetails_SymlinkForest.Code: CaseIterable { .symlinkForestUnknown, .toplevelOutdirPackagePathConflict, .toplevelOutdirUsedAsSource, - .creationFailed, ] } @@ -1600,10 +913,6 @@ public struct FailureDetails_RemoteExecution { public var unknownFields = SwiftProtobuf.UnknownStorage() - /// The association of some of these options with exit code 2, "command line - /// error", seems sketchy. Especially worth reconsidering are the channel init - /// failure modes, which can correspond to failures occurring in gRPC setup. - /// These all correspond with current Bazel behavior. public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int case remoteExecutionUnknown // = 0 @@ -1619,10 +928,6 @@ public struct FailureDetails_RemoteExecution { case downloadedInputsDeletionFailure // = 10 case remoteDownloadOutputsMinimalWithoutInmemoryDotd // = 11 case remoteDownloadOutputsMinimalWithoutInmemoryJdeps // = 12 - case incompleteOutputDownloadCleanupFailure // = 13 - case remoteDefaultPlatformPropertiesParseFailure // = 14 - case illegalOutput // = 15 - case invalidExecAndPlatformProperties // = 16 case UNRECOGNIZED(Int) public init() { @@ -1644,10 +949,6 @@ public struct FailureDetails_RemoteExecution { case 10: self = .downloadedInputsDeletionFailure case 11: self = .remoteDownloadOutputsMinimalWithoutInmemoryDotd case 12: self = .remoteDownloadOutputsMinimalWithoutInmemoryJdeps - case 13: self = .incompleteOutputDownloadCleanupFailure - case 14: self = .remoteDefaultPlatformPropertiesParseFailure - case 15: self = .illegalOutput - case 16: self = .invalidExecAndPlatformProperties default: self = .UNRECOGNIZED(rawValue) } } @@ -1667,10 +968,6 @@ public struct FailureDetails_RemoteExecution { case .downloadedInputsDeletionFailure: return 10 case .remoteDownloadOutputsMinimalWithoutInmemoryDotd: return 11 case .remoteDownloadOutputsMinimalWithoutInmemoryJdeps: return 12 - case .incompleteOutputDownloadCleanupFailure: return 13 - case .remoteDefaultPlatformPropertiesParseFailure: return 14 - case .illegalOutput: return 15 - case .invalidExecAndPlatformProperties: return 16 case .UNRECOGNIZED(let i): return i } } @@ -1698,10 +995,6 @@ extension FailureDetails_RemoteExecution.Code: CaseIterable { .downloadedInputsDeletionFailure, .remoteDownloadOutputsMinimalWithoutInmemoryDotd, .remoteDownloadOutputsMinimalWithoutInmemoryJdeps, - .incompleteOutputDownloadCleanupFailure, - .remoteDefaultPlatformPropertiesParseFailure, - .illegalOutput, - .invalidExecAndPlatformProperties, ] } @@ -1721,43 +1014,6 @@ public struct FailureDetails_Execution { case executionUnknown // = 0 case executionLogInitializationFailure // = 1 case executionLogWriteFailure // = 2 - case execrootCreationFailure // = 3 - case tempActionOutputDirectoryDeletionFailure // = 4 - case tempActionOutputDirectoryCreationFailure // = 5 - case persistentActionOutputDirectoryCreationFailure // = 6 - case localOutputDirectorySymlinkFailure // = 7 - - /// SOURCE_INPUT_MISSING - case localTemplateExpansionFailure // = 9 - case inputDirectoryCheckIoException // = 10 - case extraActionOutputCreationFailure // = 11 - case testRunnerIoException // = 12 - case fileWriteIoException // = 13 - case testOutErrIoException // = 14 - case symlinkTreeManifestCopyIoException // = 15 - case symlinkTreeManifestLinkIoException // = 16 - case symlinkTreeCreationIoException // = 17 - case symlinkTreeCreationCommandException // = 18 - case actionInputReadIoException // = 19 - case actionNotUpToDate // = 20 - case pseudoActionExecutionProhibited // = 21 - case discoveredInputDoesNotExist // = 22 - case actionOutputsDeletionFailure // = 23 - case actionOutputsNotCreated // = 24 - case actionFinalizationFailure // = 25 - case actionInputLost // = 26 - case filesystemContextUpdateFailure // = 27 - case actionOutputCloseFailure // = 28 - case inputDiscoveryIoException // = 29 - case treeArtifactDirectoryCreationFailure // = 30 - case actionOutputDirectoryCreationFailure // = 31 - case actionFsOutputDirectoryCreationFailure // = 32 - case actionFsOutErrDirectoryCreationFailure // = 33 - case nonActionExecutionFailure // = 34 - case cycle // = 35 - case sourceInputMissing // = 36 - case unexpectedException // = 37 - case sourceInputIoException // = 39 case UNRECOGNIZED(Int) public init() { @@ -1769,41 +1025,6 @@ public struct FailureDetails_Execution { case 0: self = .executionUnknown case 1: self = .executionLogInitializationFailure case 2: self = .executionLogWriteFailure - case 3: self = .execrootCreationFailure - case 4: self = .tempActionOutputDirectoryDeletionFailure - case 5: self = .tempActionOutputDirectoryCreationFailure - case 6: self = .persistentActionOutputDirectoryCreationFailure - case 7: self = .localOutputDirectorySymlinkFailure - case 9: self = .localTemplateExpansionFailure - case 10: self = .inputDirectoryCheckIoException - case 11: self = .extraActionOutputCreationFailure - case 12: self = .testRunnerIoException - case 13: self = .fileWriteIoException - case 14: self = .testOutErrIoException - case 15: self = .symlinkTreeManifestCopyIoException - case 16: self = .symlinkTreeManifestLinkIoException - case 17: self = .symlinkTreeCreationIoException - case 18: self = .symlinkTreeCreationCommandException - case 19: self = .actionInputReadIoException - case 20: self = .actionNotUpToDate - case 21: self = .pseudoActionExecutionProhibited - case 22: self = .discoveredInputDoesNotExist - case 23: self = .actionOutputsDeletionFailure - case 24: self = .actionOutputsNotCreated - case 25: self = .actionFinalizationFailure - case 26: self = .actionInputLost - case 27: self = .filesystemContextUpdateFailure - case 28: self = .actionOutputCloseFailure - case 29: self = .inputDiscoveryIoException - case 30: self = .treeArtifactDirectoryCreationFailure - case 31: self = .actionOutputDirectoryCreationFailure - case 32: self = .actionFsOutputDirectoryCreationFailure - case 33: self = .actionFsOutErrDirectoryCreationFailure - case 34: self = .nonActionExecutionFailure - case 35: self = .cycle - case 36: self = .sourceInputMissing - case 37: self = .unexpectedException - case 39: self = .sourceInputIoException default: self = .UNRECOGNIZED(rawValue) } } @@ -1813,41 +1034,6 @@ public struct FailureDetails_Execution { case .executionUnknown: return 0 case .executionLogInitializationFailure: return 1 case .executionLogWriteFailure: return 2 - case .execrootCreationFailure: return 3 - case .tempActionOutputDirectoryDeletionFailure: return 4 - case .tempActionOutputDirectoryCreationFailure: return 5 - case .persistentActionOutputDirectoryCreationFailure: return 6 - case .localOutputDirectorySymlinkFailure: return 7 - case .localTemplateExpansionFailure: return 9 - case .inputDirectoryCheckIoException: return 10 - case .extraActionOutputCreationFailure: return 11 - case .testRunnerIoException: return 12 - case .fileWriteIoException: return 13 - case .testOutErrIoException: return 14 - case .symlinkTreeManifestCopyIoException: return 15 - case .symlinkTreeManifestLinkIoException: return 16 - case .symlinkTreeCreationIoException: return 17 - case .symlinkTreeCreationCommandException: return 18 - case .actionInputReadIoException: return 19 - case .actionNotUpToDate: return 20 - case .pseudoActionExecutionProhibited: return 21 - case .discoveredInputDoesNotExist: return 22 - case .actionOutputsDeletionFailure: return 23 - case .actionOutputsNotCreated: return 24 - case .actionFinalizationFailure: return 25 - case .actionInputLost: return 26 - case .filesystemContextUpdateFailure: return 27 - case .actionOutputCloseFailure: return 28 - case .inputDiscoveryIoException: return 29 - case .treeArtifactDirectoryCreationFailure: return 30 - case .actionOutputDirectoryCreationFailure: return 31 - case .actionFsOutputDirectoryCreationFailure: return 32 - case .actionFsOutErrDirectoryCreationFailure: return 33 - case .nonActionExecutionFailure: return 34 - case .cycle: return 35 - case .sourceInputMissing: return 36 - case .unexpectedException: return 37 - case .sourceInputIoException: return 39 case .UNRECOGNIZED(let i): return i } } @@ -1865,47 +1051,11 @@ extension FailureDetails_Execution.Code: CaseIterable { .executionUnknown, .executionLogInitializationFailure, .executionLogWriteFailure, - .execrootCreationFailure, - .tempActionOutputDirectoryDeletionFailure, - .tempActionOutputDirectoryCreationFailure, - .persistentActionOutputDirectoryCreationFailure, - .localOutputDirectorySymlinkFailure, - .localTemplateExpansionFailure, - .inputDirectoryCheckIoException, - .extraActionOutputCreationFailure, - .testRunnerIoException, - .fileWriteIoException, - .testOutErrIoException, - .symlinkTreeManifestCopyIoException, - .symlinkTreeManifestLinkIoException, - .symlinkTreeCreationIoException, - .symlinkTreeCreationCommandException, - .actionInputReadIoException, - .actionNotUpToDate, - .pseudoActionExecutionProhibited, - .discoveredInputDoesNotExist, - .actionOutputsDeletionFailure, - .actionOutputsNotCreated, - .actionFinalizationFailure, - .actionInputLost, - .filesystemContextUpdateFailure, - .actionOutputCloseFailure, - .inputDiscoveryIoException, - .treeArtifactDirectoryCreationFailure, - .actionOutputDirectoryCreationFailure, - .actionFsOutputDirectoryCreationFailure, - .actionFsOutErrDirectoryCreationFailure, - .nonActionExecutionFailure, - .cycle, - .sourceInputMissing, - .unexpectedException, - .sourceInputIoException, ] } #endif // swift(>=4.2) -/// Failure details about Bazel's WORKSPACE features. public struct FailureDetails_Workspaces { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1920,9 +1070,6 @@ public struct FailureDetails_Workspaces { case workspacesUnknown // = 0 case workspacesLogInitializationFailure // = 1 case workspacesLogWriteFailure // = 2 - - /// See `managed_directories` in - /// https://docs.bazel.build/versions/master/skylark/lib/globals.html#workspace. case illegalWorkspaceFileSymlinkWithManagedDirectories // = 3 case workspaceFileReadFailureWithManagedDirectories // = 4 case UNRECOGNIZED(Int) @@ -2033,6 +1180,8 @@ public struct FailureDetails_Filesystem { public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int case filesystemUnknown // = 0 + case defaultDigestHashFunctionChanged // = 1 + case defaultDigestHashFunctionNotSet // = 2 case embeddedBinariesEnumerationFailure // = 3 case serverPidTxtFileReadFailure // = 4 case serverFileWriteFailure // = 5 @@ -2046,6 +1195,8 @@ public struct FailureDetails_Filesystem { public init?(rawValue: Int) { switch rawValue { case 0: self = .filesystemUnknown + case 1: self = .defaultDigestHashFunctionChanged + case 2: self = .defaultDigestHashFunctionNotSet case 3: self = .embeddedBinariesEnumerationFailure case 4: self = .serverPidTxtFileReadFailure case 5: self = .serverFileWriteFailure @@ -2057,6 +1208,8 @@ public struct FailureDetails_Filesystem { public var rawValue: Int { switch self { case .filesystemUnknown: return 0 + case .defaultDigestHashFunctionChanged: return 1 + case .defaultDigestHashFunctionNotSet: return 2 case .embeddedBinariesEnumerationFailure: return 3 case .serverPidTxtFileReadFailure: return 4 case .serverFileWriteFailure: return 5 @@ -2076,6 +1229,8 @@ extension FailureDetails_Filesystem.Code: CaseIterable { // The compiler won't synthesize support with the UNRECOGNIZED case. public static var allCases: [FailureDetails_Filesystem.Code] = [ .filesystemUnknown, + .defaultDigestHashFunctionChanged, + .defaultDigestHashFunctionNotSet, .embeddedBinariesEnumerationFailure, .serverPidTxtFileReadFailure, .serverFileWriteFailure, @@ -2094,23 +1249,11 @@ public struct FailureDetails_ExecutionOptions { public var unknownFields = SwiftProtobuf.UnknownStorage() - /// All numerical exit code associations correspond to pre-existing Bazel - /// behavior. These associations are suspicious: - /// - REQUESTED_STRATEGY_INCOMPATIBLE_WITH_SANDBOXING (instead: 2?) - /// - DEPRECATED_LOCAL_RESOURCES_USED (instead: 2?) - /// TODO(b/138456686): Revise these after the (intentionally non-breaking) - /// initial rollout of FailureDetail-based encoding. public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int case executionOptionsUnknown // = 0 case invalidStrategy // = 3 case requestedStrategyIncompatibleWithSandboxing // = 4 - case deprecatedLocalResourcesUsed // = 5 - case invalidCyclicDynamicStrategy // = 6 - case restrictionUnmatchedToActionContext // = 7 - case remoteFallbackStrategyNotAbstractSpawn // = 8 - case strategyNotFound // = 9 - case dynamicStrategyNotSandboxed // = 10 case UNRECOGNIZED(Int) public init() { @@ -2122,12 +1265,6 @@ public struct FailureDetails_ExecutionOptions { case 0: self = .executionOptionsUnknown case 3: self = .invalidStrategy case 4: self = .requestedStrategyIncompatibleWithSandboxing - case 5: self = .deprecatedLocalResourcesUsed - case 6: self = .invalidCyclicDynamicStrategy - case 7: self = .restrictionUnmatchedToActionContext - case 8: self = .remoteFallbackStrategyNotAbstractSpawn - case 9: self = .strategyNotFound - case 10: self = .dynamicStrategyNotSandboxed default: self = .UNRECOGNIZED(rawValue) } } @@ -2137,12 +1274,6 @@ public struct FailureDetails_ExecutionOptions { case .executionOptionsUnknown: return 0 case .invalidStrategy: return 3 case .requestedStrategyIncompatibleWithSandboxing: return 4 - case .deprecatedLocalResourcesUsed: return 5 - case .invalidCyclicDynamicStrategy: return 6 - case .restrictionUnmatchedToActionContext: return 7 - case .remoteFallbackStrategyNotAbstractSpawn: return 8 - case .strategyNotFound: return 9 - case .dynamicStrategyNotSandboxed: return 10 case .UNRECOGNIZED(let i): return i } } @@ -2160,12 +1291,6 @@ extension FailureDetails_ExecutionOptions.Code: CaseIterable { .executionOptionsUnknown, .invalidStrategy, .requestedStrategyIncompatibleWithSandboxing, - .deprecatedLocalResourcesUsed, - .invalidCyclicDynamicStrategy, - .restrictionUnmatchedToActionContext, - .remoteFallbackStrategyNotAbstractSpawn, - .strategyNotFound, - .dynamicStrategyNotSandboxed, ] } @@ -2182,10 +1307,6 @@ public struct FailureDetails_Command { public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int - - /// The name "COMMAND_UNKNOWN" might reasonably be interpreted as "command - /// not found". The enum's default value should represent a lack of knowledge - /// about the failure instead. case commandFailureUnknown // = 0 case commandNotFound // = 1 case anotherCommandRunning // = 2 @@ -2198,9 +1319,6 @@ public struct FailureDetails_Command { case optionsParseFailure // = 9 case starlarkOptionsParseFailure // = 10 case argumentsNotRecognized // = 11 - case notInWorkspace // = 12 - case spacesInWorkspacePath // = 13 - case inOutputDirectory // = 14 case UNRECOGNIZED(Int) public init() { @@ -2221,9 +1339,6 @@ public struct FailureDetails_Command { case 9: self = .optionsParseFailure case 10: self = .starlarkOptionsParseFailure case 11: self = .argumentsNotRecognized - case 12: self = .notInWorkspace - case 13: self = .spacesInWorkspacePath - case 14: self = .inOutputDirectory default: self = .UNRECOGNIZED(rawValue) } } @@ -2242,9 +1357,6 @@ public struct FailureDetails_Command { case .optionsParseFailure: return 9 case .starlarkOptionsParseFailure: return 10 case .argumentsNotRecognized: return 11 - case .notInWorkspace: return 12 - case .spacesInWorkspacePath: return 13 - case .inOutputDirectory: return 14 case .UNRECOGNIZED(let i): return i } } @@ -2271,9 +1383,6 @@ extension FailureDetails_Command.Code: CaseIterable { .optionsParseFailure, .starlarkOptionsParseFailure, .argumentsNotRecognized, - .notInWorkspace, - .spacesInWorkspacePath, - .inOutputDirectory, ] } @@ -2395,11 +1504,6 @@ extension FailureDetails_CanonicalizeFlags.Code: CaseIterable { #endif // swift(>=4.2) -/// Failure modes described by this category pertain to the Bazel invocation -/// configuration consumed by Bazel's analysis phase. This category is not -/// intended as a grab-bag for all Bazel flag value constraint violations, which -/// instead generally belong in the category for the subsystem whose flag values -/// participate in the constraint. public struct FailureDetails_BuildConfiguration { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -2413,21 +1517,6 @@ public struct FailureDetails_BuildConfiguration { public typealias RawValue = Int case buildConfigurationUnknown // = 0 case platformMappingEvaluationFailure // = 1 - case platformMappingsFileIsDirectory // = 2 - case platformMappingsFileNotFound // = 3 - case topLevelConfigurationCreationFailure // = 4 - case invalidConfiguration // = 5 - case invalidBuildOptions // = 6 - case multiCpuPrereqUnmet // = 7 - case heuristicInstrumentationFilterInvalid // = 8 - case cycle // = 9 - case conflictingConfigurations // = 10 - - /// This can come from either an invalid user-specified option or a - /// configuration transition. There's no sure-fire way to distinguish the two - /// possibilities in Bazel, so we go with the more straightforward - /// command-line error exit code 2. - case invalidOutputDirectoryMnemonic // = 11 case UNRECOGNIZED(Int) public init() { @@ -2438,16 +1527,6 @@ public struct FailureDetails_BuildConfiguration { switch rawValue { case 0: self = .buildConfigurationUnknown case 1: self = .platformMappingEvaluationFailure - case 2: self = .platformMappingsFileIsDirectory - case 3: self = .platformMappingsFileNotFound - case 4: self = .topLevelConfigurationCreationFailure - case 5: self = .invalidConfiguration - case 6: self = .invalidBuildOptions - case 7: self = .multiCpuPrereqUnmet - case 8: self = .heuristicInstrumentationFilterInvalid - case 9: self = .cycle - case 10: self = .conflictingConfigurations - case 11: self = .invalidOutputDirectoryMnemonic default: self = .UNRECOGNIZED(rawValue) } } @@ -2456,16 +1535,6 @@ public struct FailureDetails_BuildConfiguration { switch self { case .buildConfigurationUnknown: return 0 case .platformMappingEvaluationFailure: return 1 - case .platformMappingsFileIsDirectory: return 2 - case .platformMappingsFileNotFound: return 3 - case .topLevelConfigurationCreationFailure: return 4 - case .invalidConfiguration: return 5 - case .invalidBuildOptions: return 6 - case .multiCpuPrereqUnmet: return 7 - case .heuristicInstrumentationFilterInvalid: return 8 - case .cycle: return 9 - case .conflictingConfigurations: return 10 - case .invalidOutputDirectoryMnemonic: return 11 case .UNRECOGNIZED(let i): return i } } @@ -2482,16 +1551,6 @@ extension FailureDetails_BuildConfiguration.Code: CaseIterable { public static var allCases: [FailureDetails_BuildConfiguration.Code] = [ .buildConfigurationUnknown, .platformMappingEvaluationFailure, - .platformMappingsFileIsDirectory, - .platformMappingsFileNotFound, - .topLevelConfigurationCreationFailure, - .invalidConfiguration, - .invalidBuildOptions, - .multiCpuPrereqUnmet, - .heuristicInstrumentationFilterInvalid, - .cycle, - .conflictingConfigurations, - .invalidOutputDirectoryMnemonic, ] } @@ -2506,9 +1565,6 @@ public struct FailureDetails_InfoCommand { public var unknownFields = SwiftProtobuf.UnknownStorage() - /// The distinction between a failure to write a single info item and a failure - /// to write them all seems sketchy. Why do they have different exit codes? - /// This reflects current Bazel behavior, but deserves more thought. public enum Code: SwiftProtobuf.Enum { public typealias RawValue = Int case infoCommandUnknown // = 0 @@ -2577,7 +1633,6 @@ public struct FailureDetails_MemoryOptions { public typealias RawValue = Int case memoryOptionsUnknown // = 0 case experimentalOomMoreEagerlyThresholdInvalidValue // = 1 - case experimentalOomMoreEagerlyNoTenuredCollectorsFound // = 2 case UNRECOGNIZED(Int) public init() { @@ -2588,7 +1643,6 @@ public struct FailureDetails_MemoryOptions { switch rawValue { case 0: self = .memoryOptionsUnknown case 1: self = .experimentalOomMoreEagerlyThresholdInvalidValue - case 2: self = .experimentalOomMoreEagerlyNoTenuredCollectorsFound default: self = .UNRECOGNIZED(rawValue) } } @@ -2597,7 +1651,6 @@ public struct FailureDetails_MemoryOptions { switch self { case .memoryOptionsUnknown: return 0 case .experimentalOomMoreEagerlyThresholdInvalidValue: return 1 - case .experimentalOomMoreEagerlyNoTenuredCollectorsFound: return 2 case .UNRECOGNIZED(let i): return i } } @@ -2614,7 +1667,6 @@ extension FailureDetails_MemoryOptions.Code: CaseIterable { public static var allCases: [FailureDetails_MemoryOptions.Code] = [ .memoryOptionsUnknown, .experimentalOomMoreEagerlyThresholdInvalidValue, - .experimentalOomMoreEagerlyNoTenuredCollectorsFound, ] } @@ -2640,46 +1692,6 @@ public struct FailureDetails_Query { case queryOutputWriteFailure // = 6 case queryStdoutFlushFailure // = 13 case analysisQueryPrereqUnmet // = 14 - case queryResultsFlushFailure // = 15 - - /// Deprecated - folded into SYNTAX_ERROR. - case deprecatedUnclosedQuotationExpressionError // = 16 - case variableNameInvalid // = 17 - case variableUndefined // = 18 - case buildfilesAndLoadfilesCannotUseOutputLocationError // = 19 - case buildFileError // = 20 - case cycle // = 21 - case uniqueSkykeyThresholdExceeded // = 22 - case targetNotInUniverseScope // = 23 - case invalidFullUniverseExpression // = 24 - case universeScopeLimitExceeded // = 25 - case invalidationLimitExceeded // = 26 - case outputFormatPrereqUnmet // = 27 - case argumentsMissing // = 28 - case rbuildfilesFunctionRequiresSkyquery // = 29 - case fullTargetsNotSupported // = 30 - - /// Deprecated - folded into SYNTAX_ERROR. - case deprecatedUnexpectedTokenError // = 31 - - /// Deprecated - folded into SYNTAX_ERROR. - case deprecatedIntegerLiteralMissing // = 32 - - /// Deprecated - folded into SYNTAX_ERROR. - case deprecatedInvalidStartingCharacterError // = 33 - - /// Deprecated - folded into SYNTAX_ERROR. - case deprecatedPrematureEndOfInputError // = 34 - - /// Indicates the user specified invalid query syntax. - case syntaxError // = 35 - case outputFormatterIoException // = 36 - case skyqueryTransitiveTargetError // = 37 - case skyqueryTargetException // = 38 - case invalidLabelInTestSuite // = 39 - - /// Indicates any usage of flags that must not be combined. - case illegalFlagCombination // = 40 case UNRECOGNIZED(Int) public init() { @@ -2697,32 +1709,6 @@ public struct FailureDetails_Query { case 6: self = .queryOutputWriteFailure case 13: self = .queryStdoutFlushFailure case 14: self = .analysisQueryPrereqUnmet - case 15: self = .queryResultsFlushFailure - case 16: self = .deprecatedUnclosedQuotationExpressionError - case 17: self = .variableNameInvalid - case 18: self = .variableUndefined - case 19: self = .buildfilesAndLoadfilesCannotUseOutputLocationError - case 20: self = .buildFileError - case 21: self = .cycle - case 22: self = .uniqueSkykeyThresholdExceeded - case 23: self = .targetNotInUniverseScope - case 24: self = .invalidFullUniverseExpression - case 25: self = .universeScopeLimitExceeded - case 26: self = .invalidationLimitExceeded - case 27: self = .outputFormatPrereqUnmet - case 28: self = .argumentsMissing - case 29: self = .rbuildfilesFunctionRequiresSkyquery - case 30: self = .fullTargetsNotSupported - case 31: self = .deprecatedUnexpectedTokenError - case 32: self = .deprecatedIntegerLiteralMissing - case 33: self = .deprecatedInvalidStartingCharacterError - case 34: self = .deprecatedPrematureEndOfInputError - case 35: self = .syntaxError - case 36: self = .outputFormatterIoException - case 37: self = .skyqueryTransitiveTargetError - case 38: self = .skyqueryTargetException - case 39: self = .invalidLabelInTestSuite - case 40: self = .illegalFlagCombination default: self = .UNRECOGNIZED(rawValue) } } @@ -2738,32 +1724,6 @@ public struct FailureDetails_Query { case .queryOutputWriteFailure: return 6 case .queryStdoutFlushFailure: return 13 case .analysisQueryPrereqUnmet: return 14 - case .queryResultsFlushFailure: return 15 - case .deprecatedUnclosedQuotationExpressionError: return 16 - case .variableNameInvalid: return 17 - case .variableUndefined: return 18 - case .buildfilesAndLoadfilesCannotUseOutputLocationError: return 19 - case .buildFileError: return 20 - case .cycle: return 21 - case .uniqueSkykeyThresholdExceeded: return 22 - case .targetNotInUniverseScope: return 23 - case .invalidFullUniverseExpression: return 24 - case .universeScopeLimitExceeded: return 25 - case .invalidationLimitExceeded: return 26 - case .outputFormatPrereqUnmet: return 27 - case .argumentsMissing: return 28 - case .rbuildfilesFunctionRequiresSkyquery: return 29 - case .fullTargetsNotSupported: return 30 - case .deprecatedUnexpectedTokenError: return 31 - case .deprecatedIntegerLiteralMissing: return 32 - case .deprecatedInvalidStartingCharacterError: return 33 - case .deprecatedPrematureEndOfInputError: return 34 - case .syntaxError: return 35 - case .outputFormatterIoException: return 36 - case .skyqueryTransitiveTargetError: return 37 - case .skyqueryTargetException: return 38 - case .invalidLabelInTestSuite: return 39 - case .illegalFlagCombination: return 40 case .UNRECOGNIZED(let i): return i } } @@ -2787,32 +1747,6 @@ extension FailureDetails_Query.Code: CaseIterable { .queryOutputWriteFailure, .queryStdoutFlushFailure, .analysisQueryPrereqUnmet, - .queryResultsFlushFailure, - .deprecatedUnclosedQuotationExpressionError, - .variableNameInvalid, - .variableUndefined, - .buildfilesAndLoadfilesCannotUseOutputLocationError, - .buildFileError, - .cycle, - .uniqueSkykeyThresholdExceeded, - .targetNotInUniverseScope, - .invalidFullUniverseExpression, - .universeScopeLimitExceeded, - .invalidationLimitExceeded, - .outputFormatPrereqUnmet, - .argumentsMissing, - .rbuildfilesFunctionRequiresSkyquery, - .fullTargetsNotSupported, - .deprecatedUnexpectedTokenError, - .deprecatedIntegerLiteralMissing, - .deprecatedInvalidStartingCharacterError, - .deprecatedPrematureEndOfInputError, - .syntaxError, - .outputFormatterIoException, - .skyqueryTransitiveTargetError, - .skyqueryTargetException, - .invalidLabelInTestSuite, - .illegalFlagCombination, ] } @@ -2870,6564 +1804,1349 @@ extension FailureDetails_LocalExecution.Code: CaseIterable { #endif // swift(>=4.2) -public struct FailureDetails_ActionCache { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_ActionCache.Code = .actionCacheUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case actionCacheUnknown // = 0 - case initializationFailure // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .actionCacheUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .actionCacheUnknown - case 1: self = .initializationFailure - default: self = .UNRECOGNIZED(rawValue) - } - } +// MARK: - Extension support defined in failure_details.proto. - public var rawValue: Int { - switch self { - case .actionCacheUnknown: return 0 - case .initializationFailure: return 1 - case .UNRECOGNIZED(let i): return i - } - } +extension SwiftProtobuf.Google_Protobuf_EnumValueOptions { + public var FailureDetails_metadata: FailureDetails_FailureDetailMetadata { + get {return getExtensionValue(ext: FailureDetails_Extensions_metadata) ?? FailureDetails_FailureDetailMetadata()} + set {setExtensionValue(ext: FailureDetails_Extensions_metadata, value: newValue)} + } + /// Returns true if extension `FailureDetails_Extensions_metadata` + /// has been explicitly set. + public var hasFailureDetails_metadata: Bool { + return hasExtensionValue(ext: FailureDetails_Extensions_metadata) + } + /// Clears the value of extension `FailureDetails_Extensions_metadata`. + /// Subsequent reads from it will return its default value. + public mutating func clearFailureDetails_metadata() { + clearExtensionValue(ext: FailureDetails_Extensions_metadata) } - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_ActionCache.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_ActionCache.Code] = [ - .actionCacheUnknown, - .initializationFailure, - ] } -#endif // swift(>=4.2) - -public struct FailureDetails_FetchCommand { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. +/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by +/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed +/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create +/// a larger `SwiftProtobuf.SimpleExtensionMap`. +public let FailureDetails_FailureDetails_Extensions: SwiftProtobuf.SimpleExtensionMap = [ + FailureDetails_Extensions_metadata +] - public var code: FailureDetails_FetchCommand.Code = .fetchCommandUnknown +let FailureDetails_Extensions_metadata = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_EnumValueOptions>( + _protobuf_fieldNumber: 1078, + fieldName: "failure_details.metadata" +) - public var unknownFields = SwiftProtobuf.UnknownStorage() +// MARK: - Code below here is support for the SwiftProtobuf runtime. - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case fetchCommandUnknown // = 0 - case expressionMissing // = 1 - case optionsInvalid // = 2 - case queryParseError // = 3 - case queryEvaluationError // = 4 - case UNRECOGNIZED(Int) +fileprivate let _protobuf_package = "failure_details" - public init() { - self = .fetchCommandUnknown - } +extension FailureDetails_FailureDetailMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".FailureDetailMetadata" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "exit_code"), + ] - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .fetchCommandUnknown - case 1: self = .expressionMissing - case 2: self = .optionsInvalid - case 3: self = .queryParseError - case 4: self = .queryEvaluationError - default: self = .UNRECOGNIZED(rawValue) + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularUInt32Field(value: &self.exitCode) + default: break } } + } - public var rawValue: Int { - switch self { - case .fetchCommandUnknown: return 0 - case .expressionMissing: return 1 - case .optionsInvalid: return 2 - case .queryParseError: return 3 - case .queryEvaluationError: return 4 - case .UNRECOGNIZED(let i): return i - } + public func traverse(visitor: inout V) throws { + if self.exitCode != 0 { + try visitor.visitSingularUInt32Field(value: self.exitCode, fieldNumber: 1) } - + try unknownFields.traverse(visitor: &visitor) } - public init() {} + public static func ==(lhs: FailureDetails_FailureDetailMetadata, rhs: FailureDetails_FailureDetailMetadata) -> Bool { + if lhs.exitCode != rhs.exitCode {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } } -#if swift(>=4.2) - -extension FailureDetails_FetchCommand.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_FetchCommand.Code] = [ - .fetchCommandUnknown, - .expressionMissing, - .optionsInvalid, - .queryParseError, - .queryEvaluationError, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_SyncCommand { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_SyncCommand.Code = .syncCommandUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case syncCommandUnknown // = 0 - case packageLookupError // = 1 - case workspaceEvaluationError // = 2 - case repositoryFetchErrors // = 3 - case repositoryNameInvalid // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .syncCommandUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .syncCommandUnknown - case 1: self = .packageLookupError - case 2: self = .workspaceEvaluationError - case 3: self = .repositoryFetchErrors - case 4: self = .repositoryNameInvalid - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .syncCommandUnknown: return 0 - case .packageLookupError: return 1 - case .workspaceEvaluationError: return 2 - case .repositoryFetchErrors: return 3 - case .repositoryNameInvalid: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_SyncCommand.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_SyncCommand.Code] = [ - .syncCommandUnknown, - .packageLookupError, - .workspaceEvaluationError, - .repositoryFetchErrors, - .repositoryNameInvalid, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_Sandbox { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_Sandbox.Code = .sandboxFailureUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case sandboxFailureUnknown // = 0 - case initializationFailure // = 1 - case executionIoException // = 2 - case dockerCommandFailure // = 3 - case noDockerImage // = 4 - case dockerImagePreparationFailure // = 5 - case bindMountAnalysisFailure // = 6 - case mountSourceDoesNotExist // = 7 - case mountSourceTargetTypeMismatch // = 8 - case mountTargetDoesNotExist // = 9 - case subprocessStartFailed // = 10 - case UNRECOGNIZED(Int) - - public init() { - self = .sandboxFailureUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .sandboxFailureUnknown - case 1: self = .initializationFailure - case 2: self = .executionIoException - case 3: self = .dockerCommandFailure - case 4: self = .noDockerImage - case 5: self = .dockerImagePreparationFailure - case 6: self = .bindMountAnalysisFailure - case 7: self = .mountSourceDoesNotExist - case 8: self = .mountSourceTargetTypeMismatch - case 9: self = .mountTargetDoesNotExist - case 10: self = .subprocessStartFailed - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .sandboxFailureUnknown: return 0 - case .initializationFailure: return 1 - case .executionIoException: return 2 - case .dockerCommandFailure: return 3 - case .noDockerImage: return 4 - case .dockerImagePreparationFailure: return 5 - case .bindMountAnalysisFailure: return 6 - case .mountSourceDoesNotExist: return 7 - case .mountSourceTargetTypeMismatch: return 8 - case .mountTargetDoesNotExist: return 9 - case .subprocessStartFailed: return 10 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_Sandbox.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_Sandbox.Code] = [ - .sandboxFailureUnknown, - .initializationFailure, - .executionIoException, - .dockerCommandFailure, - .noDockerImage, - .dockerImagePreparationFailure, - .bindMountAnalysisFailure, - .mountSourceDoesNotExist, - .mountSourceTargetTypeMismatch, - .mountTargetDoesNotExist, - .subprocessStartFailed, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_IncludeScanning { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_IncludeScanning.Code = .includeScanningUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case includeScanningUnknown // = 0 - case initializeIncludeHintsError // = 1 - case scanningIoException // = 2 - case includeHintsFileNotInPackage // = 3 - case includeHintsReadFailure // = 4 - case illegalAbsolutePath // = 5 - - /// TODO(b/138456686): this code should be deprecated in favor of more finely - /// resolved loading-phase codes. - case packageLoadFailure // = 6 - case UNRECOGNIZED(Int) - - public init() { - self = .includeScanningUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .includeScanningUnknown - case 1: self = .initializeIncludeHintsError - case 2: self = .scanningIoException - case 3: self = .includeHintsFileNotInPackage - case 4: self = .includeHintsReadFailure - case 5: self = .illegalAbsolutePath - case 6: self = .packageLoadFailure - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .includeScanningUnknown: return 0 - case .initializeIncludeHintsError: return 1 - case .scanningIoException: return 2 - case .includeHintsFileNotInPackage: return 3 - case .includeHintsReadFailure: return 4 - case .illegalAbsolutePath: return 5 - case .packageLoadFailure: return 6 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_IncludeScanning.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_IncludeScanning.Code] = [ - .includeScanningUnknown, - .initializeIncludeHintsError, - .scanningIoException, - .includeHintsFileNotInPackage, - .includeHintsReadFailure, - .illegalAbsolutePath, - .packageLoadFailure, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_TestCommand { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_TestCommand.Code = .testCommandUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case testCommandUnknown // = 0 - case noTestTargets // = 1 - case testWithNoanalyze // = 2 - case testsFailed // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .testCommandUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .testCommandUnknown - case 1: self = .noTestTargets - case 2: self = .testWithNoanalyze - case 3: self = .testsFailed - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .testCommandUnknown: return 0 - case .noTestTargets: return 1 - case .testWithNoanalyze: return 2 - case .testsFailed: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_TestCommand.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_TestCommand.Code] = [ - .testCommandUnknown, - .noTestTargets, - .testWithNoanalyze, - .testsFailed, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_ActionQuery { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_ActionQuery.Code = .actionQueryUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// All numerical exit code associations correspond to pre-existing Bazel - /// behavior. These associations are suspicious: - /// - COMMAND_LINE_EXPANSION_FAILURE: this is associated with 2, the numerical - /// exit code for "bad Bazel command line", but is generated when an - /// action's command line fails to expand, which sounds similar but is - /// completely different. - /// - OUTPUT_FAILURE: this is associated with 6, an undocumented exit code. - /// - INVALID_AQUERY_EXPRESSION: this is associate with 1, which is not - /// documented for (a)query. - /// TODO(b/138456686): Revise these after the (intentionally non-breaking) - /// initial rollout of FailureDetail-based encoding. - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case actionQueryUnknown // = 0 - case commandLineExpansionFailure // = 1 - case outputFailure // = 2 - case commandLineExpressionMissing // = 3 - case expressionParseFailure // = 4 - case skyframeStateWithCommandLineExpression // = 5 - case invalidAqueryExpression // = 6 - case skyframeStatePrereqUnmet // = 7 - case aqueryOutputTooBig // = 8 - case illegalPatternSyntax // = 9 - case incorrectArguments // = 10 - case topLevelTargetsWithSkyframeStateNotSupported // = 11 - case skyframeStateAfterExecution // = 12 - case UNRECOGNIZED(Int) - - public init() { - self = .actionQueryUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .actionQueryUnknown - case 1: self = .commandLineExpansionFailure - case 2: self = .outputFailure - case 3: self = .commandLineExpressionMissing - case 4: self = .expressionParseFailure - case 5: self = .skyframeStateWithCommandLineExpression - case 6: self = .invalidAqueryExpression - case 7: self = .skyframeStatePrereqUnmet - case 8: self = .aqueryOutputTooBig - case 9: self = .illegalPatternSyntax - case 10: self = .incorrectArguments - case 11: self = .topLevelTargetsWithSkyframeStateNotSupported - case 12: self = .skyframeStateAfterExecution - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .actionQueryUnknown: return 0 - case .commandLineExpansionFailure: return 1 - case .outputFailure: return 2 - case .commandLineExpressionMissing: return 3 - case .expressionParseFailure: return 4 - case .skyframeStateWithCommandLineExpression: return 5 - case .invalidAqueryExpression: return 6 - case .skyframeStatePrereqUnmet: return 7 - case .aqueryOutputTooBig: return 8 - case .illegalPatternSyntax: return 9 - case .incorrectArguments: return 10 - case .topLevelTargetsWithSkyframeStateNotSupported: return 11 - case .skyframeStateAfterExecution: return 12 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_ActionQuery.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_ActionQuery.Code] = [ - .actionQueryUnknown, - .commandLineExpansionFailure, - .outputFailure, - .commandLineExpressionMissing, - .expressionParseFailure, - .skyframeStateWithCommandLineExpression, - .invalidAqueryExpression, - .skyframeStatePrereqUnmet, - .aqueryOutputTooBig, - .illegalPatternSyntax, - .incorrectArguments, - .topLevelTargetsWithSkyframeStateNotSupported, - .skyframeStateAfterExecution, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_TargetPatterns { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_TargetPatterns.Code = .targetPatternsUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case targetPatternsUnknown // = 0 - case targetPatternFileWithCommandLinePattern // = 1 - case targetPatternFileReadFailure // = 2 - case targetPatternParseFailure // = 3 - case packageNotFound // = 4 - case targetFormatInvalid // = 5 - case absoluteTargetPatternInvalid // = 6 - case cannotDetermineTargetFromFilename // = 7 - case labelSyntaxError // = 8 - case targetCannotBeEmptyString // = 9 - case packagePartCannotEndInSlash // = 10 - case cycle // = 11 - case cannotPreloadTarget // = 12 - case targetsMissing // = 13 - case recursiveTargetPatternsNotAllowed // = 14 - case upLevelReferencesNotAllowed // = 15 - case negativeTargetPatternNotAllowed // = 16 - case targetMustBeAFile // = 17 - case dependencyNotFound // = 18 - case packageNameInvalid // = 19 - case UNRECOGNIZED(Int) - - public init() { - self = .targetPatternsUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .targetPatternsUnknown - case 1: self = .targetPatternFileWithCommandLinePattern - case 2: self = .targetPatternFileReadFailure - case 3: self = .targetPatternParseFailure - case 4: self = .packageNotFound - case 5: self = .targetFormatInvalid - case 6: self = .absoluteTargetPatternInvalid - case 7: self = .cannotDetermineTargetFromFilename - case 8: self = .labelSyntaxError - case 9: self = .targetCannotBeEmptyString - case 10: self = .packagePartCannotEndInSlash - case 11: self = .cycle - case 12: self = .cannotPreloadTarget - case 13: self = .targetsMissing - case 14: self = .recursiveTargetPatternsNotAllowed - case 15: self = .upLevelReferencesNotAllowed - case 16: self = .negativeTargetPatternNotAllowed - case 17: self = .targetMustBeAFile - case 18: self = .dependencyNotFound - case 19: self = .packageNameInvalid - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .targetPatternsUnknown: return 0 - case .targetPatternFileWithCommandLinePattern: return 1 - case .targetPatternFileReadFailure: return 2 - case .targetPatternParseFailure: return 3 - case .packageNotFound: return 4 - case .targetFormatInvalid: return 5 - case .absoluteTargetPatternInvalid: return 6 - case .cannotDetermineTargetFromFilename: return 7 - case .labelSyntaxError: return 8 - case .targetCannotBeEmptyString: return 9 - case .packagePartCannotEndInSlash: return 10 - case .cycle: return 11 - case .cannotPreloadTarget: return 12 - case .targetsMissing: return 13 - case .recursiveTargetPatternsNotAllowed: return 14 - case .upLevelReferencesNotAllowed: return 15 - case .negativeTargetPatternNotAllowed: return 16 - case .targetMustBeAFile: return 17 - case .dependencyNotFound: return 18 - case .packageNameInvalid: return 19 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_TargetPatterns.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_TargetPatterns.Code] = [ - .targetPatternsUnknown, - .targetPatternFileWithCommandLinePattern, - .targetPatternFileReadFailure, - .targetPatternParseFailure, - .packageNotFound, - .targetFormatInvalid, - .absoluteTargetPatternInvalid, - .cannotDetermineTargetFromFilename, - .labelSyntaxError, - .targetCannotBeEmptyString, - .packagePartCannotEndInSlash, - .cycle, - .cannotPreloadTarget, - .targetsMissing, - .recursiveTargetPatternsNotAllowed, - .upLevelReferencesNotAllowed, - .negativeTargetPatternNotAllowed, - .targetMustBeAFile, - .dependencyNotFound, - .packageNameInvalid, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_CleanCommand { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_CleanCommand.Code = .cleanCommandUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case cleanCommandUnknown // = 0 - case outputServiceCleanFailure // = 1 - case actionCacheCleanFailure // = 2 - case outErrCloseFailure // = 3 - case outputBaseDeleteFailure // = 4 - case outputBaseTempMoveFailure // = 5 - case asyncOutputBaseDeleteFailure // = 6 - case execrootDeleteFailure // = 7 - case execrootTempMoveFailure // = 8 - case asyncExecrootDeleteFailure // = 9 - case argumentsNotRecognized // = 10 - case UNRECOGNIZED(Int) - - public init() { - self = .cleanCommandUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .cleanCommandUnknown - case 1: self = .outputServiceCleanFailure - case 2: self = .actionCacheCleanFailure - case 3: self = .outErrCloseFailure - case 4: self = .outputBaseDeleteFailure - case 5: self = .outputBaseTempMoveFailure - case 6: self = .asyncOutputBaseDeleteFailure - case 7: self = .execrootDeleteFailure - case 8: self = .execrootTempMoveFailure - case 9: self = .asyncExecrootDeleteFailure - case 10: self = .argumentsNotRecognized - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .cleanCommandUnknown: return 0 - case .outputServiceCleanFailure: return 1 - case .actionCacheCleanFailure: return 2 - case .outErrCloseFailure: return 3 - case .outputBaseDeleteFailure: return 4 - case .outputBaseTempMoveFailure: return 5 - case .asyncOutputBaseDeleteFailure: return 6 - case .execrootDeleteFailure: return 7 - case .execrootTempMoveFailure: return 8 - case .asyncExecrootDeleteFailure: return 9 - case .argumentsNotRecognized: return 10 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_CleanCommand.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_CleanCommand.Code] = [ - .cleanCommandUnknown, - .outputServiceCleanFailure, - .actionCacheCleanFailure, - .outErrCloseFailure, - .outputBaseDeleteFailure, - .outputBaseTempMoveFailure, - .asyncOutputBaseDeleteFailure, - .execrootDeleteFailure, - .execrootTempMoveFailure, - .asyncExecrootDeleteFailure, - .argumentsNotRecognized, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_ConfigCommand { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_ConfigCommand.Code = .configCommandUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case configCommandUnknown // = 0 - case tooManyConfigIds // = 1 - case configurationNotFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .configCommandUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .configCommandUnknown - case 1: self = .tooManyConfigIds - case 2: self = .configurationNotFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .configCommandUnknown: return 0 - case .tooManyConfigIds: return 1 - case .configurationNotFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_ConfigCommand.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_ConfigCommand.Code] = [ - .configCommandUnknown, - .tooManyConfigIds, - .configurationNotFound, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_ConfigurableQuery { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_ConfigurableQuery.Code = .configurableQueryUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case configurableQueryUnknown // = 0 - case commandLineExpressionMissing // = 1 - case expressionParseFailure // = 2 - case filtersNotSupported // = 3 - case buildfilesFunctionNotSupported // = 4 - case siblingsFunctionNotSupported // = 5 - case visibleFunctionNotSupported // = 6 - case attributeMissing // = 7 - case incorrectConfigArgumentError // = 8 - case targetMissing // = 9 - case starlarkSyntaxError // = 10 - case starlarkEvalError // = 11 - - /// Indicates failure to correctly define a format function - case formatFunctionError // = 12 - case UNRECOGNIZED(Int) - - public init() { - self = .configurableQueryUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .configurableQueryUnknown - case 1: self = .commandLineExpressionMissing - case 2: self = .expressionParseFailure - case 3: self = .filtersNotSupported - case 4: self = .buildfilesFunctionNotSupported - case 5: self = .siblingsFunctionNotSupported - case 6: self = .visibleFunctionNotSupported - case 7: self = .attributeMissing - case 8: self = .incorrectConfigArgumentError - case 9: self = .targetMissing - case 10: self = .starlarkSyntaxError - case 11: self = .starlarkEvalError - case 12: self = .formatFunctionError - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .configurableQueryUnknown: return 0 - case .commandLineExpressionMissing: return 1 - case .expressionParseFailure: return 2 - case .filtersNotSupported: return 3 - case .buildfilesFunctionNotSupported: return 4 - case .siblingsFunctionNotSupported: return 5 - case .visibleFunctionNotSupported: return 6 - case .attributeMissing: return 7 - case .incorrectConfigArgumentError: return 8 - case .targetMissing: return 9 - case .starlarkSyntaxError: return 10 - case .starlarkEvalError: return 11 - case .formatFunctionError: return 12 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_ConfigurableQuery.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_ConfigurableQuery.Code] = [ - .configurableQueryUnknown, - .commandLineExpressionMissing, - .expressionParseFailure, - .filtersNotSupported, - .buildfilesFunctionNotSupported, - .siblingsFunctionNotSupported, - .visibleFunctionNotSupported, - .attributeMissing, - .incorrectConfigArgumentError, - .targetMissing, - .starlarkSyntaxError, - .starlarkEvalError, - .formatFunctionError, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_DumpCommand { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_DumpCommand.Code = .dumpCommandUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case dumpCommandUnknown // = 0 - case noOutputSpecified // = 1 - case actionCacheDumpFailed // = 2 - case commandLineExpansionFailure // = 3 - case actionGraphDumpFailed // = 4 - case starlarkHeapDumpFailed // = 5 - case UNRECOGNIZED(Int) - - public init() { - self = .dumpCommandUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .dumpCommandUnknown - case 1: self = .noOutputSpecified - case 2: self = .actionCacheDumpFailed - case 3: self = .commandLineExpansionFailure - case 4: self = .actionGraphDumpFailed - case 5: self = .starlarkHeapDumpFailed - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .dumpCommandUnknown: return 0 - case .noOutputSpecified: return 1 - case .actionCacheDumpFailed: return 2 - case .commandLineExpansionFailure: return 3 - case .actionGraphDumpFailed: return 4 - case .starlarkHeapDumpFailed: return 5 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_DumpCommand.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_DumpCommand.Code] = [ - .dumpCommandUnknown, - .noOutputSpecified, - .actionCacheDumpFailed, - .commandLineExpansionFailure, - .actionGraphDumpFailed, - .starlarkHeapDumpFailed, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_HelpCommand { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_HelpCommand.Code = .helpCommandUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case helpCommandUnknown // = 0 - case missingArgument // = 1 - case commandNotFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .helpCommandUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .helpCommandUnknown - case 1: self = .missingArgument - case 2: self = .commandNotFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .helpCommandUnknown: return 0 - case .missingArgument: return 1 - case .commandNotFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_HelpCommand.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_HelpCommand.Code] = [ - .helpCommandUnknown, - .missingArgument, - .commandNotFound, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_MobileInstall { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_MobileInstall.Code = .mobileInstallUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case mobileInstallUnknown // = 0 - case classicUnsupported // = 1 - case noTargetSpecified // = 2 - case multipleTargetsSpecified // = 3 - case targetTypeInvalid // = 4 - case nonZeroExit // = 5 - case errorRunningProgram // = 6 - case UNRECOGNIZED(Int) - - public init() { - self = .mobileInstallUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .mobileInstallUnknown - case 1: self = .classicUnsupported - case 2: self = .noTargetSpecified - case 3: self = .multipleTargetsSpecified - case 4: self = .targetTypeInvalid - case 5: self = .nonZeroExit - case 6: self = .errorRunningProgram - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .mobileInstallUnknown: return 0 - case .classicUnsupported: return 1 - case .noTargetSpecified: return 2 - case .multipleTargetsSpecified: return 3 - case .targetTypeInvalid: return 4 - case .nonZeroExit: return 5 - case .errorRunningProgram: return 6 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_MobileInstall.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_MobileInstall.Code] = [ - .mobileInstallUnknown, - .classicUnsupported, - .noTargetSpecified, - .multipleTargetsSpecified, - .targetTypeInvalid, - .nonZeroExit, - .errorRunningProgram, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_ProfileCommand { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_ProfileCommand.Code = .profileCommandUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case profileCommandUnknown // = 0 - case oldBinaryFormatUnsupported // = 1 - case fileReadFailure // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .profileCommandUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .profileCommandUnknown - case 1: self = .oldBinaryFormatUnsupported - case 2: self = .fileReadFailure - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .profileCommandUnknown: return 0 - case .oldBinaryFormatUnsupported: return 1 - case .fileReadFailure: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_ProfileCommand.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_ProfileCommand.Code] = [ - .profileCommandUnknown, - .oldBinaryFormatUnsupported, - .fileReadFailure, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_RunCommand { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_RunCommand.Code = .runCommandUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case runCommandUnknown // = 0 - case noTargetSpecified // = 1 - case tooManyTargetsSpecified // = 2 - case targetNotExecutable // = 3 - case targetBuiltButPathNotExecutable // = 4 - case targetBuiltButPathValidationFailed // = 5 - case runUnderTargetNotBuilt // = 6 - case runPrereqUnmet // = 7 - case tooManyTestShardsOrRuns // = 8 - case testEnvironmentSetupFailure // = 9 - case commandLineExpansionFailure // = 10 - case noShellSpecified // = 11 - case scriptWriteFailure // = 12 - case runfilesDirectoriesCreationFailure // = 13 - case runfilesSymlinksCreationFailure // = 14 - case testEnvironmentSetupInterrupted // = 15 - case UNRECOGNIZED(Int) - - public init() { - self = .runCommandUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .runCommandUnknown - case 1: self = .noTargetSpecified - case 2: self = .tooManyTargetsSpecified - case 3: self = .targetNotExecutable - case 4: self = .targetBuiltButPathNotExecutable - case 5: self = .targetBuiltButPathValidationFailed - case 6: self = .runUnderTargetNotBuilt - case 7: self = .runPrereqUnmet - case 8: self = .tooManyTestShardsOrRuns - case 9: self = .testEnvironmentSetupFailure - case 10: self = .commandLineExpansionFailure - case 11: self = .noShellSpecified - case 12: self = .scriptWriteFailure - case 13: self = .runfilesDirectoriesCreationFailure - case 14: self = .runfilesSymlinksCreationFailure - case 15: self = .testEnvironmentSetupInterrupted - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .runCommandUnknown: return 0 - case .noTargetSpecified: return 1 - case .tooManyTargetsSpecified: return 2 - case .targetNotExecutable: return 3 - case .targetBuiltButPathNotExecutable: return 4 - case .targetBuiltButPathValidationFailed: return 5 - case .runUnderTargetNotBuilt: return 6 - case .runPrereqUnmet: return 7 - case .tooManyTestShardsOrRuns: return 8 - case .testEnvironmentSetupFailure: return 9 - case .commandLineExpansionFailure: return 10 - case .noShellSpecified: return 11 - case .scriptWriteFailure: return 12 - case .runfilesDirectoriesCreationFailure: return 13 - case .runfilesSymlinksCreationFailure: return 14 - case .testEnvironmentSetupInterrupted: return 15 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_RunCommand.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_RunCommand.Code] = [ - .runCommandUnknown, - .noTargetSpecified, - .tooManyTargetsSpecified, - .targetNotExecutable, - .targetBuiltButPathNotExecutable, - .targetBuiltButPathValidationFailed, - .runUnderTargetNotBuilt, - .runPrereqUnmet, - .tooManyTestShardsOrRuns, - .testEnvironmentSetupFailure, - .commandLineExpansionFailure, - .noShellSpecified, - .scriptWriteFailure, - .runfilesDirectoriesCreationFailure, - .runfilesSymlinksCreationFailure, - .testEnvironmentSetupInterrupted, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_VersionCommand { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_VersionCommand.Code = .versionCommandUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case versionCommandUnknown // = 0 - case notAvailable // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .versionCommandUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .versionCommandUnknown - case 1: self = .notAvailable - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .versionCommandUnknown: return 0 - case .notAvailable: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_VersionCommand.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_VersionCommand.Code] = [ - .versionCommandUnknown, - .notAvailable, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_PrintActionCommand { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_PrintActionCommand.Code = .printActionCommandUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case printActionCommandUnknown // = 0 - case targetNotFound // = 1 - case commandLineExpansionFailure // = 2 - case targetKindUnsupported // = 3 - case actionsNotFound // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .printActionCommandUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .printActionCommandUnknown - case 1: self = .targetNotFound - case 2: self = .commandLineExpansionFailure - case 3: self = .targetKindUnsupported - case 4: self = .actionsNotFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .printActionCommandUnknown: return 0 - case .targetNotFound: return 1 - case .commandLineExpansionFailure: return 2 - case .targetKindUnsupported: return 3 - case .actionsNotFound: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_PrintActionCommand.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_PrintActionCommand.Code] = [ - .printActionCommandUnknown, - .targetNotFound, - .commandLineExpansionFailure, - .targetKindUnsupported, - .actionsNotFound, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_WorkspaceStatus { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_WorkspaceStatus.Code = .workspaceStatusUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case workspaceStatusUnknown // = 0 - case nonZeroExit // = 1 - case abnormalTermination // = 2 - case execFailed // = 3 - case parseFailure // = 4 - case validationFailure // = 5 - case contentUpdateIoException // = 6 - case stderrIoException // = 7 - case UNRECOGNIZED(Int) - - public init() { - self = .workspaceStatusUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .workspaceStatusUnknown - case 1: self = .nonZeroExit - case 2: self = .abnormalTermination - case 3: self = .execFailed - case 4: self = .parseFailure - case 5: self = .validationFailure - case 6: self = .contentUpdateIoException - case 7: self = .stderrIoException - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .workspaceStatusUnknown: return 0 - case .nonZeroExit: return 1 - case .abnormalTermination: return 2 - case .execFailed: return 3 - case .parseFailure: return 4 - case .validationFailure: return 5 - case .contentUpdateIoException: return 6 - case .stderrIoException: return 7 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_WorkspaceStatus.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_WorkspaceStatus.Code] = [ - .workspaceStatusUnknown, - .nonZeroExit, - .abnormalTermination, - .execFailed, - .parseFailure, - .validationFailure, - .contentUpdateIoException, - .stderrIoException, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_JavaCompile { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_JavaCompile.Code = .javaCompileUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case javaCompileUnknown // = 0 - case reducedClasspathFailure // = 1 - case commandLineExpansionFailure // = 2 - case jdepsReadIoException // = 3 - case reducedClasspathFallbackCleanupFailure // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .javaCompileUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .javaCompileUnknown - case 1: self = .reducedClasspathFailure - case 2: self = .commandLineExpansionFailure - case 3: self = .jdepsReadIoException - case 4: self = .reducedClasspathFallbackCleanupFailure - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .javaCompileUnknown: return 0 - case .reducedClasspathFailure: return 1 - case .commandLineExpansionFailure: return 2 - case .jdepsReadIoException: return 3 - case .reducedClasspathFallbackCleanupFailure: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_JavaCompile.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_JavaCompile.Code] = [ - .javaCompileUnknown, - .reducedClasspathFailure, - .commandLineExpansionFailure, - .jdepsReadIoException, - .reducedClasspathFallbackCleanupFailure, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_ActionRewinding { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_ActionRewinding.Code = .actionRewindingUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case actionRewindingUnknown // = 0 - case lostInputTooManyTimes // = 1 - case lostInputIsSource // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .actionRewindingUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .actionRewindingUnknown - case 1: self = .lostInputTooManyTimes - case 2: self = .lostInputIsSource - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .actionRewindingUnknown: return 0 - case .lostInputTooManyTimes: return 1 - case .lostInputIsSource: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_ActionRewinding.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_ActionRewinding.Code] = [ - .actionRewindingUnknown, - .lostInputTooManyTimes, - .lostInputIsSource, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_CppCompile { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_CppCompile.Code = .cppCompileUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case cppCompileUnknown // = 0 - case findUsedHeadersIoException // = 1 - case copyOutErrFailure // = 2 - case dFileReadFailure // = 3 - case commandGenerationFailure // = 4 - case moduleExpansionTimeout // = 5 - case includePathOutsideExecRoot // = 6 - case fakeCommandGenerationFailure // = 7 - case undeclaredInclusions // = 8 - case dFileParseFailure // = 9 - case coverageNotesCreationFailure // = 10 - case moduleExpansionMissingData // = 11 - case UNRECOGNIZED(Int) - - public init() { - self = .cppCompileUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .cppCompileUnknown - case 1: self = .findUsedHeadersIoException - case 2: self = .copyOutErrFailure - case 3: self = .dFileReadFailure - case 4: self = .commandGenerationFailure - case 5: self = .moduleExpansionTimeout - case 6: self = .includePathOutsideExecRoot - case 7: self = .fakeCommandGenerationFailure - case 8: self = .undeclaredInclusions - case 9: self = .dFileParseFailure - case 10: self = .coverageNotesCreationFailure - case 11: self = .moduleExpansionMissingData - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .cppCompileUnknown: return 0 - case .findUsedHeadersIoException: return 1 - case .copyOutErrFailure: return 2 - case .dFileReadFailure: return 3 - case .commandGenerationFailure: return 4 - case .moduleExpansionTimeout: return 5 - case .includePathOutsideExecRoot: return 6 - case .fakeCommandGenerationFailure: return 7 - case .undeclaredInclusions: return 8 - case .dFileParseFailure: return 9 - case .coverageNotesCreationFailure: return 10 - case .moduleExpansionMissingData: return 11 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_CppCompile.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_CppCompile.Code] = [ - .cppCompileUnknown, - .findUsedHeadersIoException, - .copyOutErrFailure, - .dFileReadFailure, - .commandGenerationFailure, - .moduleExpansionTimeout, - .includePathOutsideExecRoot, - .fakeCommandGenerationFailure, - .undeclaredInclusions, - .dFileParseFailure, - .coverageNotesCreationFailure, - .moduleExpansionMissingData, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_StarlarkAction { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_StarlarkAction.Code = .starlarkActionUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case starlarkActionUnknown // = 0 - case unusedInputListReadFailure // = 1 - case unusedInputListFileNotFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .starlarkActionUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .starlarkActionUnknown - case 1: self = .unusedInputListReadFailure - case 2: self = .unusedInputListFileNotFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .starlarkActionUnknown: return 0 - case .unusedInputListReadFailure: return 1 - case .unusedInputListFileNotFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_StarlarkAction.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_StarlarkAction.Code] = [ - .starlarkActionUnknown, - .unusedInputListReadFailure, - .unusedInputListFileNotFound, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_NinjaAction { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_NinjaAction.Code = .ninjaActionUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case ninjaActionUnknown // = 0 - case invalidDepfileDeclaredDependency // = 1 - case dFileParseFailure // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ninjaActionUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ninjaActionUnknown - case 1: self = .invalidDepfileDeclaredDependency - case 2: self = .dFileParseFailure - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ninjaActionUnknown: return 0 - case .invalidDepfileDeclaredDependency: return 1 - case .dFileParseFailure: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_NinjaAction.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_NinjaAction.Code] = [ - .ninjaActionUnknown, - .invalidDepfileDeclaredDependency, - .dFileParseFailure, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_DynamicExecution { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_DynamicExecution.Code = .dynamicExecutionUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case dynamicExecutionUnknown // = 0 - case xcodeRelatedPrereqUnmet // = 1 - case actionLogMoveFailure // = 2 - case runFailure // = 3 - case noUsableStrategyFound // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .dynamicExecutionUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .dynamicExecutionUnknown - case 1: self = .xcodeRelatedPrereqUnmet - case 2: self = .actionLogMoveFailure - case 3: self = .runFailure - case 4: self = .noUsableStrategyFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .dynamicExecutionUnknown: return 0 - case .xcodeRelatedPrereqUnmet: return 1 - case .actionLogMoveFailure: return 2 - case .runFailure: return 3 - case .noUsableStrategyFound: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_DynamicExecution.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_DynamicExecution.Code] = [ - .dynamicExecutionUnknown, - .xcodeRelatedPrereqUnmet, - .actionLogMoveFailure, - .runFailure, - .noUsableStrategyFound, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_FailAction { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_FailAction.Code = .failActionUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case failActionUnknown // = 0 - case intentionalFailure // = 1 - case incorrectPythonVersion // = 2 - case proguardSpecsMissing // = 3 - case dynamicLinkingNotSupported // = 4 - case sourceFilesMissing // = 5 - case incorrectToolchain // = 6 - case fragmentClassMissing // = 7 - case cantBuildIncompatibleTarget // = 10 - case UNRECOGNIZED(Int) - - public init() { - self = .failActionUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .failActionUnknown - case 1: self = .intentionalFailure - case 2: self = .incorrectPythonVersion - case 3: self = .proguardSpecsMissing - case 4: self = .dynamicLinkingNotSupported - case 5: self = .sourceFilesMissing - case 6: self = .incorrectToolchain - case 7: self = .fragmentClassMissing - case 10: self = .cantBuildIncompatibleTarget - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .failActionUnknown: return 0 - case .intentionalFailure: return 1 - case .incorrectPythonVersion: return 2 - case .proguardSpecsMissing: return 3 - case .dynamicLinkingNotSupported: return 4 - case .sourceFilesMissing: return 5 - case .incorrectToolchain: return 6 - case .fragmentClassMissing: return 7 - case .cantBuildIncompatibleTarget: return 10 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_FailAction.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_FailAction.Code] = [ - .failActionUnknown, - .intentionalFailure, - .incorrectPythonVersion, - .proguardSpecsMissing, - .dynamicLinkingNotSupported, - .sourceFilesMissing, - .incorrectToolchain, - .fragmentClassMissing, - .cantBuildIncompatibleTarget, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_SymlinkAction { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_SymlinkAction.Code = .symlinkActionUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case symlinkActionUnknown // = 0 - case executableInputNotFile // = 1 - case executableInputIsNot // = 2 - case executableInputCheckIoException // = 3 - case linkCreationIoException // = 4 - case linkTouchIoException // = 5 - case UNRECOGNIZED(Int) - - public init() { - self = .symlinkActionUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .symlinkActionUnknown - case 1: self = .executableInputNotFile - case 2: self = .executableInputIsNot - case 3: self = .executableInputCheckIoException - case 4: self = .linkCreationIoException - case 5: self = .linkTouchIoException - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .symlinkActionUnknown: return 0 - case .executableInputNotFile: return 1 - case .executableInputIsNot: return 2 - case .executableInputCheckIoException: return 3 - case .linkCreationIoException: return 4 - case .linkTouchIoException: return 5 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_SymlinkAction.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_SymlinkAction.Code] = [ - .symlinkActionUnknown, - .executableInputNotFile, - .executableInputIsNot, - .executableInputCheckIoException, - .linkCreationIoException, - .linkTouchIoException, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_CppLink { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_CppLink.Code = .cppLinkUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case cppLinkUnknown // = 0 - case commandGenerationFailure // = 1 - case fakeCommandGenerationFailure // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .cppLinkUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .cppLinkUnknown - case 1: self = .commandGenerationFailure - case 2: self = .fakeCommandGenerationFailure - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .cppLinkUnknown: return 0 - case .commandGenerationFailure: return 1 - case .fakeCommandGenerationFailure: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_CppLink.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_CppLink.Code] = [ - .cppLinkUnknown, - .commandGenerationFailure, - .fakeCommandGenerationFailure, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_LtoAction { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_LtoAction.Code = .ltoActionUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case ltoActionUnknown // = 0 - case invalidAbsolutePathInImports // = 1 - case missingBitcodeFiles // = 2 - case importsReadIoException // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ltoActionUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ltoActionUnknown - case 1: self = .invalidAbsolutePathInImports - case 2: self = .missingBitcodeFiles - case 3: self = .importsReadIoException - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ltoActionUnknown: return 0 - case .invalidAbsolutePathInImports: return 1 - case .missingBitcodeFiles: return 2 - case .importsReadIoException: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_LtoAction.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_LtoAction.Code] = [ - .ltoActionUnknown, - .invalidAbsolutePathInImports, - .missingBitcodeFiles, - .importsReadIoException, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_TestAction { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_TestAction.Code = .testActionUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case testActionUnknown // = 0 - case noKeepGoingTestFailure // = 1 - case localTestPrereqUnmet // = 2 - case commandLineExpansionFailure // = 3 - case duplicateCpuTags // = 4 - case invalidCpuTag // = 5 - case UNRECOGNIZED(Int) - - public init() { - self = .testActionUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .testActionUnknown - case 1: self = .noKeepGoingTestFailure - case 2: self = .localTestPrereqUnmet - case 3: self = .commandLineExpansionFailure - case 4: self = .duplicateCpuTags - case 5: self = .invalidCpuTag - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .testActionUnknown: return 0 - case .noKeepGoingTestFailure: return 1 - case .localTestPrereqUnmet: return 2 - case .commandLineExpansionFailure: return 3 - case .duplicateCpuTags: return 4 - case .invalidCpuTag: return 5 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_TestAction.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_TestAction.Code] = [ - .testActionUnknown, - .noKeepGoingTestFailure, - .localTestPrereqUnmet, - .commandLineExpansionFailure, - .duplicateCpuTags, - .invalidCpuTag, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_Worker { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_Worker.Code = .workerUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case workerUnknown // = 0 - case multiplexerInstanceRemovalFailure // = 1 - case multiplexerDoesNotExist // = 2 - case noTools // = 3 - case noFlagfile // = 4 - case virtualInputMaterializationFailure // = 5 - case borrowFailure // = 6 - case prefetchFailure // = 7 - case prepareFailure // = 8 - case requestFailure // = 9 - case parseResponseFailure // = 10 - case noResponse // = 11 - case finishFailure // = 12 - case UNRECOGNIZED(Int) - - public init() { - self = .workerUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .workerUnknown - case 1: self = .multiplexerInstanceRemovalFailure - case 2: self = .multiplexerDoesNotExist - case 3: self = .noTools - case 4: self = .noFlagfile - case 5: self = .virtualInputMaterializationFailure - case 6: self = .borrowFailure - case 7: self = .prefetchFailure - case 8: self = .prepareFailure - case 9: self = .requestFailure - case 10: self = .parseResponseFailure - case 11: self = .noResponse - case 12: self = .finishFailure - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .workerUnknown: return 0 - case .multiplexerInstanceRemovalFailure: return 1 - case .multiplexerDoesNotExist: return 2 - case .noTools: return 3 - case .noFlagfile: return 4 - case .virtualInputMaterializationFailure: return 5 - case .borrowFailure: return 6 - case .prefetchFailure: return 7 - case .prepareFailure: return 8 - case .requestFailure: return 9 - case .parseResponseFailure: return 10 - case .noResponse: return 11 - case .finishFailure: return 12 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_Worker.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_Worker.Code] = [ - .workerUnknown, - .multiplexerInstanceRemovalFailure, - .multiplexerDoesNotExist, - .noTools, - .noFlagfile, - .virtualInputMaterializationFailure, - .borrowFailure, - .prefetchFailure, - .prepareFailure, - .requestFailure, - .parseResponseFailure, - .noResponse, - .finishFailure, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_Analysis { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_Analysis.Code = .analysisUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case analysisUnknown // = 0 - case loadFailure // = 1 - - /// TODO(b/138456686): this code should be deprecated in favor of more finely - /// resolved loading-phase codes. - case genericLoadingPhaseFailure // = 2 - case notAllTargetsAnalyzed // = 3 - case cycle // = 4 - case parameterizedTopLevelAspectInvalid // = 5 - case aspectLabelSyntaxError // = 6 - case aspectPrereqUnmet // = 7 - case aspectNotFound // = 8 - case actionConflict // = 9 - case artifactPrefixConflict // = 10 - case unexpectedAnalysisException // = 11 - case targetsMissingEnvironments // = 12 - case invalidEnvironment // = 13 - case environmentMissingFromGroups // = 14 - case execGroupMissing // = 15 - case invalidExecutionPlatform // = 16 - case aspectCreationFailed // = 17 - case configuredValueCreationFailed // = 18 - case incompatibleTargetRequested // = 19 - case UNRECOGNIZED(Int) - - public init() { - self = .analysisUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .analysisUnknown - case 1: self = .loadFailure - case 2: self = .genericLoadingPhaseFailure - case 3: self = .notAllTargetsAnalyzed - case 4: self = .cycle - case 5: self = .parameterizedTopLevelAspectInvalid - case 6: self = .aspectLabelSyntaxError - case 7: self = .aspectPrereqUnmet - case 8: self = .aspectNotFound - case 9: self = .actionConflict - case 10: self = .artifactPrefixConflict - case 11: self = .unexpectedAnalysisException - case 12: self = .targetsMissingEnvironments - case 13: self = .invalidEnvironment - case 14: self = .environmentMissingFromGroups - case 15: self = .execGroupMissing - case 16: self = .invalidExecutionPlatform - case 17: self = .aspectCreationFailed - case 18: self = .configuredValueCreationFailed - case 19: self = .incompatibleTargetRequested - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .analysisUnknown: return 0 - case .loadFailure: return 1 - case .genericLoadingPhaseFailure: return 2 - case .notAllTargetsAnalyzed: return 3 - case .cycle: return 4 - case .parameterizedTopLevelAspectInvalid: return 5 - case .aspectLabelSyntaxError: return 6 - case .aspectPrereqUnmet: return 7 - case .aspectNotFound: return 8 - case .actionConflict: return 9 - case .artifactPrefixConflict: return 10 - case .unexpectedAnalysisException: return 11 - case .targetsMissingEnvironments: return 12 - case .invalidEnvironment: return 13 - case .environmentMissingFromGroups: return 14 - case .execGroupMissing: return 15 - case .invalidExecutionPlatform: return 16 - case .aspectCreationFailed: return 17 - case .configuredValueCreationFailed: return 18 - case .incompatibleTargetRequested: return 19 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_Analysis.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_Analysis.Code] = [ - .analysisUnknown, - .loadFailure, - .genericLoadingPhaseFailure, - .notAllTargetsAnalyzed, - .cycle, - .parameterizedTopLevelAspectInvalid, - .aspectLabelSyntaxError, - .aspectPrereqUnmet, - .aspectNotFound, - .actionConflict, - .artifactPrefixConflict, - .unexpectedAnalysisException, - .targetsMissingEnvironments, - .invalidEnvironment, - .environmentMissingFromGroups, - .execGroupMissing, - .invalidExecutionPlatform, - .aspectCreationFailed, - .configuredValueCreationFailed, - .incompatibleTargetRequested, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_PackageLoading { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_PackageLoading.Code = .packageLoadingUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case packageLoadingUnknown // = 0 - case workspaceFileError // = 1 - case maxComputationStepsExceeded // = 2 - case buildFileMissing // = 3 - case repositoryMissing // = 4 - case persistentInconsistentFilesystemError // = 5 - case transientInconsistentFilesystemError // = 6 - case invalidName // = 7 - case evalGlobsSymlinkError // = 9 - case importStarlarkFileError // = 10 - case packageMissing // = 11 - case targetMissing // = 12 - case noSuchThing // = 13 - case globIoException // = 14 - case duplicateLabel // = 15 - case invalidPackageSpecification // = 16 - case syntaxError // = 17 - case environmentInDifferentPackage // = 18 - case defaultEnvironmentUndeclared // = 19 - case environmentInMultipleGroups // = 20 - case environmentDoesNotExist // = 21 - case environmentInvalid // = 22 - case environmentNotInGroup // = 23 - case packageNameInvalid // = 24 - case starlarkEvalError // = 25 - case licenseParseFailure // = 26 - case distributionsParseFailure // = 27 - case labelCrossesPackageBoundary // = 28 - case UNRECOGNIZED(Int) - - public init() { - self = .packageLoadingUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .packageLoadingUnknown - case 1: self = .workspaceFileError - case 2: self = .maxComputationStepsExceeded - case 3: self = .buildFileMissing - case 4: self = .repositoryMissing - case 5: self = .persistentInconsistentFilesystemError - case 6: self = .transientInconsistentFilesystemError - case 7: self = .invalidName - case 9: self = .evalGlobsSymlinkError - case 10: self = .importStarlarkFileError - case 11: self = .packageMissing - case 12: self = .targetMissing - case 13: self = .noSuchThing - case 14: self = .globIoException - case 15: self = .duplicateLabel - case 16: self = .invalidPackageSpecification - case 17: self = .syntaxError - case 18: self = .environmentInDifferentPackage - case 19: self = .defaultEnvironmentUndeclared - case 20: self = .environmentInMultipleGroups - case 21: self = .environmentDoesNotExist - case 22: self = .environmentInvalid - case 23: self = .environmentNotInGroup - case 24: self = .packageNameInvalid - case 25: self = .starlarkEvalError - case 26: self = .licenseParseFailure - case 27: self = .distributionsParseFailure - case 28: self = .labelCrossesPackageBoundary - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .packageLoadingUnknown: return 0 - case .workspaceFileError: return 1 - case .maxComputationStepsExceeded: return 2 - case .buildFileMissing: return 3 - case .repositoryMissing: return 4 - case .persistentInconsistentFilesystemError: return 5 - case .transientInconsistentFilesystemError: return 6 - case .invalidName: return 7 - case .evalGlobsSymlinkError: return 9 - case .importStarlarkFileError: return 10 - case .packageMissing: return 11 - case .targetMissing: return 12 - case .noSuchThing: return 13 - case .globIoException: return 14 - case .duplicateLabel: return 15 - case .invalidPackageSpecification: return 16 - case .syntaxError: return 17 - case .environmentInDifferentPackage: return 18 - case .defaultEnvironmentUndeclared: return 19 - case .environmentInMultipleGroups: return 20 - case .environmentDoesNotExist: return 21 - case .environmentInvalid: return 22 - case .environmentNotInGroup: return 23 - case .packageNameInvalid: return 24 - case .starlarkEvalError: return 25 - case .licenseParseFailure: return 26 - case .distributionsParseFailure: return 27 - case .labelCrossesPackageBoundary: return 28 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_PackageLoading.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_PackageLoading.Code] = [ - .packageLoadingUnknown, - .workspaceFileError, - .maxComputationStepsExceeded, - .buildFileMissing, - .repositoryMissing, - .persistentInconsistentFilesystemError, - .transientInconsistentFilesystemError, - .invalidName, - .evalGlobsSymlinkError, - .importStarlarkFileError, - .packageMissing, - .targetMissing, - .noSuchThing, - .globIoException, - .duplicateLabel, - .invalidPackageSpecification, - .syntaxError, - .environmentInDifferentPackage, - .defaultEnvironmentUndeclared, - .environmentInMultipleGroups, - .environmentDoesNotExist, - .environmentInvalid, - .environmentNotInGroup, - .packageNameInvalid, - .starlarkEvalError, - .licenseParseFailure, - .distributionsParseFailure, - .labelCrossesPackageBoundary, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_Toolchain { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_Toolchain.Code = .toolchainUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case toolchainUnknown // = 0 - case missingProvider // = 1 - case invalidConstraintValue // = 2 - case invalidPlatformValue // = 3 - case invalidToolchain // = 4 - case noMatchingExecutionPlatform // = 5 - case noMatchingToolchain // = 6 - case invalidToolchainType // = 7 - case UNRECOGNIZED(Int) - - public init() { - self = .toolchainUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .toolchainUnknown - case 1: self = .missingProvider - case 2: self = .invalidConstraintValue - case 3: self = .invalidPlatformValue - case 4: self = .invalidToolchain - case 5: self = .noMatchingExecutionPlatform - case 6: self = .noMatchingToolchain - case 7: self = .invalidToolchainType - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .toolchainUnknown: return 0 - case .missingProvider: return 1 - case .invalidConstraintValue: return 2 - case .invalidPlatformValue: return 3 - case .invalidToolchain: return 4 - case .noMatchingExecutionPlatform: return 5 - case .noMatchingToolchain: return 6 - case .invalidToolchainType: return 7 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_Toolchain.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_Toolchain.Code] = [ - .toolchainUnknown, - .missingProvider, - .invalidConstraintValue, - .invalidPlatformValue, - .invalidToolchain, - .noMatchingExecutionPlatform, - .noMatchingToolchain, - .invalidToolchainType, - ] -} - -#endif // swift(>=4.2) - -public struct FailureDetails_StarlarkLoading { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: FailureDetails_StarlarkLoading.Code = .starlarkLoadingUnknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum { - public typealias RawValue = Int - case starlarkLoadingUnknown // = 0 - case cycle // = 1 - case compileError // = 2 - case parseError // = 3 - case evalError // = 4 - case containingPackageNotFound // = 5 - case packageNotFound // = 6 - case ioError // = 7 - case labelCrossesPackageBoundary // = 8 - case builtinsError // = 9 - case UNRECOGNIZED(Int) - - public init() { - self = .starlarkLoadingUnknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .starlarkLoadingUnknown - case 1: self = .cycle - case 2: self = .compileError - case 3: self = .parseError - case 4: self = .evalError - case 5: self = .containingPackageNotFound - case 6: self = .packageNotFound - case 7: self = .ioError - case 8: self = .labelCrossesPackageBoundary - case 9: self = .builtinsError - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .starlarkLoadingUnknown: return 0 - case .cycle: return 1 - case .compileError: return 2 - case .parseError: return 3 - case .evalError: return 4 - case .containingPackageNotFound: return 5 - case .packageNotFound: return 6 - case .ioError: return 7 - case .labelCrossesPackageBoundary: return 8 - case .builtinsError: return 9 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension FailureDetails_StarlarkLoading.Code: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static var allCases: [FailureDetails_StarlarkLoading.Code] = [ - .starlarkLoadingUnknown, - .cycle, - .compileError, - .parseError, - .evalError, - .containingPackageNotFound, - .packageNotFound, - .ioError, - .labelCrossesPackageBoundary, - .builtinsError, - ] -} - -#endif // swift(>=4.2) - -// MARK: - Extension support defined in failure_details.proto. - -// MARK: - Extension Properties - -// Swift Extensions on the exteneded Messages to add easy access to the declared -// extension fields. The names are based on the extension field name from the proto -// declaration. To avoid naming collisions, the names are prefixed with the name of -// the scope where the extend directive occurs. - -extension SwiftProtobuf.Google_Protobuf_EnumValueOptions { - - public var FailureDetails_metadata: FailureDetails_FailureDetailMetadata { - get {return getExtensionValue(ext: FailureDetails_Extensions_metadata) ?? FailureDetails_FailureDetailMetadata()} - set {setExtensionValue(ext: FailureDetails_Extensions_metadata, value: newValue)} - } - /// Returns true if extension `FailureDetails_Extensions_metadata` - /// has been explicitly set. - public var hasFailureDetails_metadata: Bool { - return hasExtensionValue(ext: FailureDetails_Extensions_metadata) - } - /// Clears the value of extension `FailureDetails_Extensions_metadata`. - /// Subsequent reads from it will return its default value. - public mutating func clearFailureDetails_metadata() { - clearExtensionValue(ext: FailureDetails_Extensions_metadata) - } - -} - -// MARK: - File's ExtensionMap: FailureDetails_FailureDetails_Extensions - -/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by -/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed -/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create -/// a larger `SwiftProtobuf.SimpleExtensionMap`. -public let FailureDetails_FailureDetails_Extensions: SwiftProtobuf.SimpleExtensionMap = [ - FailureDetails_Extensions_metadata -] - -// Extension Objects - The only reason these might be needed is when manually -// constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_ -// accessors for the extension fields on the messages directly. - -public let FailureDetails_Extensions_metadata = SwiftProtobuf.MessageExtension, SwiftProtobuf.Google_Protobuf_EnumValueOptions>( - _protobuf_fieldNumber: 1078, - fieldName: "failure_details.metadata" -) - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "failure_details" - -extension FailureDetails_FailureDetailMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FailureDetailMetadata" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "exit_code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt32Field(value: &self.exitCode) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.exitCode != 0 { - try visitor.visitSingularUInt32Field(value: self.exitCode, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_FailureDetailMetadata, rhs: FailureDetails_FailureDetailMetadata) -> Bool { - if lhs.exitCode != rhs.exitCode {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_FailureDetail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FailureDetail" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "message"), - 101: .same(proto: "interrupted"), - 103: .standard(proto: "external_repository"), - 104: .standard(proto: "build_progress"), - 106: .standard(proto: "remote_options"), - 107: .standard(proto: "client_environment"), - 108: .same(proto: "crash"), - 110: .standard(proto: "symlink_forest"), - 114: .standard(proto: "package_options"), - 115: .standard(proto: "remote_execution"), - 116: .same(proto: "execution"), - 117: .same(proto: "workspaces"), - 118: .standard(proto: "crash_options"), - 119: .same(proto: "filesystem"), - 121: .standard(proto: "execution_options"), - 122: .same(proto: "command"), - 123: .same(proto: "spawn"), - 124: .standard(proto: "grpc_server"), - 125: .standard(proto: "canonicalize_flags"), - 126: .standard(proto: "build_configuration"), - 127: .standard(proto: "info_command"), - 129: .standard(proto: "memory_options"), - 130: .same(proto: "query"), - 132: .standard(proto: "local_execution"), - 134: .standard(proto: "action_cache"), - 135: .standard(proto: "fetch_command"), - 136: .standard(proto: "sync_command"), - 137: .same(proto: "sandbox"), - 139: .standard(proto: "include_scanning"), - 140: .standard(proto: "test_command"), - 141: .standard(proto: "action_query"), - 142: .standard(proto: "target_patterns"), - 144: .standard(proto: "clean_command"), - 145: .standard(proto: "config_command"), - 146: .standard(proto: "configurable_query"), - 147: .standard(proto: "dump_command"), - 148: .standard(proto: "help_command"), - 150: .standard(proto: "mobile_install"), - 151: .standard(proto: "profile_command"), - 152: .standard(proto: "run_command"), - 153: .standard(proto: "version_command"), - 154: .standard(proto: "print_action_command"), - 158: .standard(proto: "workspace_status"), - 159: .standard(proto: "java_compile"), - 160: .standard(proto: "action_rewinding"), - 161: .standard(proto: "cpp_compile"), - 162: .standard(proto: "starlark_action"), - 163: .standard(proto: "ninja_action"), - 164: .standard(proto: "dynamic_execution"), - 166: .standard(proto: "fail_action"), - 167: .standard(proto: "symlink_action"), - 168: .standard(proto: "cpp_link"), - 169: .standard(proto: "lto_action"), - 172: .standard(proto: "test_action"), - 173: .same(proto: "worker"), - 174: .same(proto: "analysis"), - 175: .standard(proto: "package_loading"), - 177: .same(proto: "toolchain"), - 179: .standard(proto: "starlark_loading"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.message) }() - case 101: try { - var v: FailureDetails_Interrupted? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .interrupted(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .interrupted(v) - } - }() - case 103: try { - var v: FailureDetails_ExternalRepository? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .externalRepository(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .externalRepository(v) - } - }() - case 104: try { - var v: FailureDetails_BuildProgress? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .buildProgress(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .buildProgress(v) - } - }() - case 106: try { - var v: FailureDetails_RemoteOptions? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .remoteOptions(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .remoteOptions(v) - } - }() - case 107: try { - var v: FailureDetails_ClientEnvironment? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .clientEnvironment(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .clientEnvironment(v) - } - }() - case 108: try { - var v: FailureDetails_Crash? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .crash(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .crash(v) - } - }() - case 110: try { - var v: FailureDetails_SymlinkForest? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .symlinkForest(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .symlinkForest(v) - } - }() - case 114: try { - var v: FailureDetails_PackageOptions? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .packageOptions(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .packageOptions(v) - } - }() - case 115: try { - var v: FailureDetails_RemoteExecution? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .remoteExecution(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .remoteExecution(v) - } - }() - case 116: try { - var v: FailureDetails_Execution? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .execution(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .execution(v) - } - }() - case 117: try { - var v: FailureDetails_Workspaces? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .workspaces(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .workspaces(v) - } - }() - case 118: try { - var v: FailureDetails_CrashOptions? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .crashOptions(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .crashOptions(v) - } - }() - case 119: try { - var v: FailureDetails_Filesystem? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .filesystem(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .filesystem(v) - } - }() - case 121: try { - var v: FailureDetails_ExecutionOptions? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .executionOptions(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .executionOptions(v) - } - }() - case 122: try { - var v: FailureDetails_Command? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .command(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .command(v) - } - }() - case 123: try { - var v: FailureDetails_Spawn? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .spawn(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .spawn(v) - } - }() - case 124: try { - var v: FailureDetails_GrpcServer? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .grpcServer(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .grpcServer(v) - } - }() - case 125: try { - var v: FailureDetails_CanonicalizeFlags? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .canonicalizeFlags(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .canonicalizeFlags(v) - } - }() - case 126: try { - var v: FailureDetails_BuildConfiguration? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .buildConfiguration(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .buildConfiguration(v) - } - }() - case 127: try { - var v: FailureDetails_InfoCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .infoCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .infoCommand(v) - } - }() - case 129: try { - var v: FailureDetails_MemoryOptions? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .memoryOptions(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .memoryOptions(v) - } - }() - case 130: try { - var v: FailureDetails_Query? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .query(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .query(v) - } - }() - case 132: try { - var v: FailureDetails_LocalExecution? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .localExecution(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .localExecution(v) - } - }() - case 134: try { - var v: FailureDetails_ActionCache? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .actionCache(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .actionCache(v) - } - }() - case 135: try { - var v: FailureDetails_FetchCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .fetchCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .fetchCommand(v) - } - }() - case 136: try { - var v: FailureDetails_SyncCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .syncCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .syncCommand(v) - } - }() - case 137: try { - var v: FailureDetails_Sandbox? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .sandbox(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .sandbox(v) - } - }() - case 139: try { - var v: FailureDetails_IncludeScanning? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .includeScanning(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .includeScanning(v) - } - }() - case 140: try { - var v: FailureDetails_TestCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .testCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .testCommand(v) - } - }() - case 141: try { - var v: FailureDetails_ActionQuery? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .actionQuery(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .actionQuery(v) - } - }() - case 142: try { - var v: FailureDetails_TargetPatterns? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .targetPatterns(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .targetPatterns(v) - } - }() - case 144: try { - var v: FailureDetails_CleanCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .cleanCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .cleanCommand(v) - } - }() - case 145: try { - var v: FailureDetails_ConfigCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .configCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .configCommand(v) - } - }() - case 146: try { - var v: FailureDetails_ConfigurableQuery? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .configurableQuery(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .configurableQuery(v) - } - }() - case 147: try { - var v: FailureDetails_DumpCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .dumpCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .dumpCommand(v) - } - }() - case 148: try { - var v: FailureDetails_HelpCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .helpCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .helpCommand(v) - } - }() - case 150: try { - var v: FailureDetails_MobileInstall? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .mobileInstall(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .mobileInstall(v) - } - }() - case 151: try { - var v: FailureDetails_ProfileCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .profileCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .profileCommand(v) - } - }() - case 152: try { - var v: FailureDetails_RunCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .runCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .runCommand(v) - } - }() - case 153: try { - var v: FailureDetails_VersionCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .versionCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .versionCommand(v) - } - }() - case 154: try { - var v: FailureDetails_PrintActionCommand? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .printActionCommand(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .printActionCommand(v) - } - }() - case 158: try { - var v: FailureDetails_WorkspaceStatus? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .workspaceStatus(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .workspaceStatus(v) - } - }() - case 159: try { - var v: FailureDetails_JavaCompile? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .javaCompile(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .javaCompile(v) - } - }() - case 160: try { - var v: FailureDetails_ActionRewinding? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .actionRewinding(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .actionRewinding(v) - } - }() - case 161: try { - var v: FailureDetails_CppCompile? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .cppCompile(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .cppCompile(v) - } - }() - case 162: try { - var v: FailureDetails_StarlarkAction? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .starlarkAction(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .starlarkAction(v) - } - }() - case 163: try { - var v: FailureDetails_NinjaAction? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .ninjaAction(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .ninjaAction(v) - } - }() - case 164: try { - var v: FailureDetails_DynamicExecution? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .dynamicExecution(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .dynamicExecution(v) - } - }() - case 166: try { - var v: FailureDetails_FailAction? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .failAction(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .failAction(v) - } - }() - case 167: try { - var v: FailureDetails_SymlinkAction? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .symlinkAction(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .symlinkAction(v) - } - }() - case 168: try { - var v: FailureDetails_CppLink? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .cppLink(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .cppLink(v) - } - }() - case 169: try { - var v: FailureDetails_LtoAction? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .ltoAction(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .ltoAction(v) - } - }() - case 172: try { - var v: FailureDetails_TestAction? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .testAction(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .testAction(v) - } - }() - case 173: try { - var v: FailureDetails_Worker? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .worker(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .worker(v) - } - }() - case 174: try { - var v: FailureDetails_Analysis? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .analysis(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .analysis(v) - } - }() - case 175: try { - var v: FailureDetails_PackageLoading? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .packageLoading(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .packageLoading(v) - } - }() - case 177: try { - var v: FailureDetails_Toolchain? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .toolchain(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .toolchain(v) - } - }() - case 179: try { - var v: FailureDetails_StarlarkLoading? - var hadOneofValue = false - if let current = self.category { - hadOneofValue = true - if case .starlarkLoading(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.category = .starlarkLoading(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.message.isEmpty { - try visitor.visitSingularStringField(value: self.message, fieldNumber: 1) - } - switch self.category { - case .interrupted?: try { - guard case .interrupted(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 101) - }() - case .externalRepository?: try { - guard case .externalRepository(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 103) - }() - case .buildProgress?: try { - guard case .buildProgress(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 104) - }() - case .remoteOptions?: try { - guard case .remoteOptions(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 106) - }() - case .clientEnvironment?: try { - guard case .clientEnvironment(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 107) - }() - case .crash?: try { - guard case .crash(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 108) - }() - case .symlinkForest?: try { - guard case .symlinkForest(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 110) - }() - case .packageOptions?: try { - guard case .packageOptions(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 114) - }() - case .remoteExecution?: try { - guard case .remoteExecution(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 115) - }() - case .execution?: try { - guard case .execution(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 116) - }() - case .workspaces?: try { - guard case .workspaces(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 117) - }() - case .crashOptions?: try { - guard case .crashOptions(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 118) - }() - case .filesystem?: try { - guard case .filesystem(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 119) - }() - case .executionOptions?: try { - guard case .executionOptions(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 121) - }() - case .command?: try { - guard case .command(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 122) - }() - case .spawn?: try { - guard case .spawn(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 123) - }() - case .grpcServer?: try { - guard case .grpcServer(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 124) - }() - case .canonicalizeFlags?: try { - guard case .canonicalizeFlags(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 125) - }() - case .buildConfiguration?: try { - guard case .buildConfiguration(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 126) - }() - case .infoCommand?: try { - guard case .infoCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 127) - }() - case .memoryOptions?: try { - guard case .memoryOptions(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 129) - }() - case .query?: try { - guard case .query(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 130) - }() - case .localExecution?: try { - guard case .localExecution(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 132) - }() - case .actionCache?: try { - guard case .actionCache(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 134) - }() - case .fetchCommand?: try { - guard case .fetchCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 135) - }() - case .syncCommand?: try { - guard case .syncCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 136) - }() - case .sandbox?: try { - guard case .sandbox(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 137) - }() - case .includeScanning?: try { - guard case .includeScanning(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 139) - }() - case .testCommand?: try { - guard case .testCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 140) - }() - case .actionQuery?: try { - guard case .actionQuery(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 141) - }() - case .targetPatterns?: try { - guard case .targetPatterns(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 142) - }() - case .cleanCommand?: try { - guard case .cleanCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 144) - }() - case .configCommand?: try { - guard case .configCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 145) - }() - case .configurableQuery?: try { - guard case .configurableQuery(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 146) - }() - case .dumpCommand?: try { - guard case .dumpCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 147) - }() - case .helpCommand?: try { - guard case .helpCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 148) - }() - case .mobileInstall?: try { - guard case .mobileInstall(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 150) - }() - case .profileCommand?: try { - guard case .profileCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 151) - }() - case .runCommand?: try { - guard case .runCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 152) - }() - case .versionCommand?: try { - guard case .versionCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 153) - }() - case .printActionCommand?: try { - guard case .printActionCommand(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 154) - }() - case .workspaceStatus?: try { - guard case .workspaceStatus(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 158) - }() - case .javaCompile?: try { - guard case .javaCompile(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 159) - }() - case .actionRewinding?: try { - guard case .actionRewinding(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 160) - }() - case .cppCompile?: try { - guard case .cppCompile(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 161) - }() - case .starlarkAction?: try { - guard case .starlarkAction(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 162) - }() - case .ninjaAction?: try { - guard case .ninjaAction(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 163) - }() - case .dynamicExecution?: try { - guard case .dynamicExecution(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 164) - }() - case .failAction?: try { - guard case .failAction(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 166) - }() - case .symlinkAction?: try { - guard case .symlinkAction(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 167) - }() - case .cppLink?: try { - guard case .cppLink(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 168) - }() - case .ltoAction?: try { - guard case .ltoAction(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 169) - }() - case .testAction?: try { - guard case .testAction(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 172) - }() - case .worker?: try { - guard case .worker(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 173) - }() - case .analysis?: try { - guard case .analysis(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 174) - }() - case .packageLoading?: try { - guard case .packageLoading(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 175) - }() - case .toolchain?: try { - guard case .toolchain(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 177) - }() - case .starlarkLoading?: try { - guard case .starlarkLoading(let v)? = self.category else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 179) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_FailureDetail, rhs: FailureDetails_FailureDetail) -> Bool { - if lhs.message != rhs.message {return false} - if lhs.category != rhs.category {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_Interrupted: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Interrupted" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .interruptedUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_Interrupted, rhs: FailureDetails_Interrupted) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_Interrupted.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "INTERRUPTED_UNKNOWN"), - 4: .same(proto: "DEPRECATED_BUILD"), - 5: .same(proto: "DEPRECATED_BUILD_COMPLETION"), - 6: .same(proto: "DEPRECATED_PACKAGE_LOADING_SYNC"), - 7: .same(proto: "DEPRECATED_EXECUTOR_COMPLETION"), - 8: .same(proto: "DEPRECATED_COMMAND_DISPATCH"), - 9: .same(proto: "DEPRECATED_INFO_ITEM"), - 10: .same(proto: "DEPRECATED_AFTER_QUERY"), - 17: .same(proto: "DEPRECATED_FETCH_COMMAND"), - 18: .same(proto: "DEPRECATED_SYNC_COMMAND"), - 20: .same(proto: "DEPRECATED_CLEAN_COMMAND"), - 21: .same(proto: "DEPRECATED_MOBILE_INSTALL_COMMAND"), - 22: .same(proto: "DEPRECATED_QUERY"), - 23: .same(proto: "DEPRECATED_RUN_COMMAND"), - 27: .same(proto: "DEPRECATED_OPTIONS_PARSING"), - 28: .same(proto: "INTERRUPTED"), - ] -} - -extension FailureDetails_Spawn: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Spawn" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - 2: .same(proto: "catastrophic"), - 3: .standard(proto: "spawn_exit_code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self.catastrophic) }() - case 3: try { try decoder.decodeSingularInt32Field(value: &self.spawnExitCode) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .spawnUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - if self.catastrophic != false { - try visitor.visitSingularBoolField(value: self.catastrophic, fieldNumber: 2) - } - if self.spawnExitCode != 0 { - try visitor.visitSingularInt32Field(value: self.spawnExitCode, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_Spawn, rhs: FailureDetails_Spawn) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.catastrophic != rhs.catastrophic {return false} - if lhs.spawnExitCode != rhs.spawnExitCode {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_Spawn.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SPAWN_UNKNOWN"), - 1: .same(proto: "NON_ZERO_EXIT"), - 2: .same(proto: "TIMEOUT"), - 3: .same(proto: "OUT_OF_MEMORY"), - 4: .same(proto: "EXECUTION_FAILED"), - 5: .same(proto: "EXECUTION_DENIED"), - 6: .same(proto: "REMOTE_CACHE_FAILED"), - 7: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), - 8: .same(proto: "EXEC_IO_EXCEPTION"), - 9: .same(proto: "INVALID_TIMEOUT"), - 10: .same(proto: "INVALID_REMOTE_EXECUTION_PROPERTIES"), - 11: .same(proto: "NO_USABLE_STRATEGY_FOUND"), - 12: .same(proto: "UNSPECIFIED_EXECUTION_FAILURE"), - ] -} - -extension FailureDetails_ExternalRepository: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ExternalRepository" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .externalRepositoryUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_ExternalRepository, rhs: FailureDetails_ExternalRepository) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_ExternalRepository.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "EXTERNAL_REPOSITORY_UNKNOWN"), - 1: .same(proto: "OVERRIDE_DISALLOWED_MANAGED_DIRECTORIES"), - 2: .same(proto: "BAD_DOWNLOADER_CONFIG"), - ] -} - -extension FailureDetails_BuildProgress: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BuildProgress" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .buildProgressUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_BuildProgress, rhs: FailureDetails_BuildProgress) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_BuildProgress.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "BUILD_PROGRESS_UNKNOWN"), - 3: .same(proto: "OUTPUT_INITIALIZATION"), - 4: .same(proto: "BES_RUNS_PER_TEST_LIMIT_UNSUPPORTED"), - 5: .same(proto: "BES_LOCAL_WRITE_ERROR"), - 6: .same(proto: "BES_INITIALIZATION_ERROR"), - 7: .same(proto: "BES_UPLOAD_TIMEOUT_ERROR"), - 8: .same(proto: "BES_FILE_WRITE_TIMEOUT"), - 9: .same(proto: "BES_FILE_WRITE_IO_ERROR"), - 10: .same(proto: "BES_FILE_WRITE_INTERRUPTED"), - 11: .same(proto: "BES_FILE_WRITE_CANCELED"), - 12: .same(proto: "BES_FILE_WRITE_UNKNOWN_ERROR"), - 13: .same(proto: "BES_UPLOAD_LOCAL_FILE_ERROR"), - 14: .same(proto: "BES_STREAM_NOT_RETRYING_FAILURE"), - 15: .same(proto: "BES_STREAM_COMPLETED_WITH_UNACK_EVENTS_ERROR"), - 16: .same(proto: "BES_STREAM_COMPLETED_WITH_UNSENT_EVENTS_ERROR"), - 17: .same(proto: "BES_UPLOAD_RETRY_LIMIT_EXCEEDED_FAILURE"), - ] -} - -extension FailureDetails_RemoteOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RemoteOptions" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .remoteOptionsUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_RemoteOptions, rhs: FailureDetails_RemoteOptions) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_RemoteOptions.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "REMOTE_OPTIONS_UNKNOWN"), - 1: .same(proto: "REMOTE_DEFAULT_EXEC_PROPERTIES_LOGIC_ERROR"), - 2: .same(proto: "CREDENTIALS_READ_FAILURE"), - 3: .same(proto: "CREDENTIALS_WRITE_FAILURE"), - 4: .same(proto: "DOWNLOADER_WITHOUT_GRPC_CACHE"), - 5: .same(proto: "EXECUTION_WITH_INVALID_CACHE"), - ] -} - -extension FailureDetails_ClientEnvironment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ClientEnvironment" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .clientEnvironmentUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_ClientEnvironment, rhs: FailureDetails_ClientEnvironment) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_ClientEnvironment.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CLIENT_ENVIRONMENT_UNKNOWN"), - 1: .same(proto: "CLIENT_CWD_MALFORMED"), - ] -} - -extension FailureDetails_Crash: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Crash" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - 2: .same(proto: "causes"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.causes) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .crashUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - if !self.causes.isEmpty { - try visitor.visitRepeatedMessageField(value: self.causes, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_Crash, rhs: FailureDetails_Crash) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.causes != rhs.causes {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_Crash.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CRASH_UNKNOWN"), - 1: .same(proto: "CRASH_OOM"), - ] -} - -extension FailureDetails_Throwable: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Throwable" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "throwable_class"), - 2: .same(proto: "message"), - 3: .standard(proto: "stack_trace"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.throwableClass) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.message) }() - case 3: try { try decoder.decodeRepeatedStringField(value: &self.stackTrace) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.throwableClass.isEmpty { - try visitor.visitSingularStringField(value: self.throwableClass, fieldNumber: 1) - } - if !self.message.isEmpty { - try visitor.visitSingularStringField(value: self.message, fieldNumber: 2) - } - if !self.stackTrace.isEmpty { - try visitor.visitRepeatedStringField(value: self.stackTrace, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_Throwable, rhs: FailureDetails_Throwable) -> Bool { - if lhs.throwableClass != rhs.throwableClass {return false} - if lhs.message != rhs.message {return false} - if lhs.stackTrace != rhs.stackTrace {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_SymlinkForest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SymlinkForest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .symlinkForestUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_SymlinkForest, rhs: FailureDetails_SymlinkForest) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_SymlinkForest.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SYMLINK_FOREST_UNKNOWN"), - 1: .same(proto: "TOPLEVEL_OUTDIR_PACKAGE_PATH_CONFLICT"), - 2: .same(proto: "TOPLEVEL_OUTDIR_USED_AS_SOURCE"), - 3: .same(proto: "CREATION_FAILED"), - ] -} - -extension FailureDetails_PackageOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PackageOptions" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .packageOptionsUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_PackageOptions, rhs: FailureDetails_PackageOptions) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_PackageOptions.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "PACKAGE_OPTIONS_UNKNOWN"), - 1: .same(proto: "PACKAGE_PATH_INVALID"), - ] -} - -extension FailureDetails_RemoteExecution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RemoteExecution" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .remoteExecutionUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_RemoteExecution, rhs: FailureDetails_RemoteExecution) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_RemoteExecution.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "REMOTE_EXECUTION_UNKNOWN"), - 1: .same(proto: "CAPABILITIES_QUERY_FAILURE"), - 2: .same(proto: "CREDENTIALS_INIT_FAILURE"), - 3: .same(proto: "CACHE_INIT_FAILURE"), - 4: .same(proto: "RPC_LOG_FAILURE"), - 5: .same(proto: "EXEC_CHANNEL_INIT_FAILURE"), - 6: .same(proto: "CACHE_CHANNEL_INIT_FAILURE"), - 7: .same(proto: "DOWNLOADER_CHANNEL_INIT_FAILURE"), - 8: .same(proto: "LOG_DIR_CLEANUP_FAILURE"), - 9: .same(proto: "CLIENT_SERVER_INCOMPATIBLE"), - 10: .same(proto: "DOWNLOADED_INPUTS_DELETION_FAILURE"), - 11: .same(proto: "REMOTE_DOWNLOAD_OUTPUTS_MINIMAL_WITHOUT_INMEMORY_DOTD"), - 12: .same(proto: "REMOTE_DOWNLOAD_OUTPUTS_MINIMAL_WITHOUT_INMEMORY_JDEPS"), - 13: .same(proto: "INCOMPLETE_OUTPUT_DOWNLOAD_CLEANUP_FAILURE"), - 14: .same(proto: "REMOTE_DEFAULT_PLATFORM_PROPERTIES_PARSE_FAILURE"), - 15: .same(proto: "ILLEGAL_OUTPUT"), - 16: .same(proto: "INVALID_EXEC_AND_PLATFORM_PROPERTIES"), - ] -} - -extension FailureDetails_Execution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Execution" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .executionUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_Execution, rhs: FailureDetails_Execution) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_Execution.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "EXECUTION_UNKNOWN"), - 1: .same(proto: "EXECUTION_LOG_INITIALIZATION_FAILURE"), - 2: .same(proto: "EXECUTION_LOG_WRITE_FAILURE"), - 3: .same(proto: "EXECROOT_CREATION_FAILURE"), - 4: .same(proto: "TEMP_ACTION_OUTPUT_DIRECTORY_DELETION_FAILURE"), - 5: .same(proto: "TEMP_ACTION_OUTPUT_DIRECTORY_CREATION_FAILURE"), - 6: .same(proto: "PERSISTENT_ACTION_OUTPUT_DIRECTORY_CREATION_FAILURE"), - 7: .same(proto: "LOCAL_OUTPUT_DIRECTORY_SYMLINK_FAILURE"), - 9: .same(proto: "LOCAL_TEMPLATE_EXPANSION_FAILURE"), - 10: .same(proto: "INPUT_DIRECTORY_CHECK_IO_EXCEPTION"), - 11: .same(proto: "EXTRA_ACTION_OUTPUT_CREATION_FAILURE"), - 12: .same(proto: "TEST_RUNNER_IO_EXCEPTION"), - 13: .same(proto: "FILE_WRITE_IO_EXCEPTION"), - 14: .same(proto: "TEST_OUT_ERR_IO_EXCEPTION"), - 15: .same(proto: "SYMLINK_TREE_MANIFEST_COPY_IO_EXCEPTION"), - 16: .same(proto: "SYMLINK_TREE_MANIFEST_LINK_IO_EXCEPTION"), - 17: .same(proto: "SYMLINK_TREE_CREATION_IO_EXCEPTION"), - 18: .same(proto: "SYMLINK_TREE_CREATION_COMMAND_EXCEPTION"), - 19: .same(proto: "ACTION_INPUT_READ_IO_EXCEPTION"), - 20: .same(proto: "ACTION_NOT_UP_TO_DATE"), - 21: .same(proto: "PSEUDO_ACTION_EXECUTION_PROHIBITED"), - 22: .same(proto: "DISCOVERED_INPUT_DOES_NOT_EXIST"), - 23: .same(proto: "ACTION_OUTPUTS_DELETION_FAILURE"), - 24: .same(proto: "ACTION_OUTPUTS_NOT_CREATED"), - 25: .same(proto: "ACTION_FINALIZATION_FAILURE"), - 26: .same(proto: "ACTION_INPUT_LOST"), - 27: .same(proto: "FILESYSTEM_CONTEXT_UPDATE_FAILURE"), - 28: .same(proto: "ACTION_OUTPUT_CLOSE_FAILURE"), - 29: .same(proto: "INPUT_DISCOVERY_IO_EXCEPTION"), - 30: .same(proto: "TREE_ARTIFACT_DIRECTORY_CREATION_FAILURE"), - 31: .same(proto: "ACTION_OUTPUT_DIRECTORY_CREATION_FAILURE"), - 32: .same(proto: "ACTION_FS_OUTPUT_DIRECTORY_CREATION_FAILURE"), - 33: .same(proto: "ACTION_FS_OUT_ERR_DIRECTORY_CREATION_FAILURE"), - 34: .same(proto: "NON_ACTION_EXECUTION_FAILURE"), - 35: .same(proto: "CYCLE"), - 36: .same(proto: "SOURCE_INPUT_MISSING"), - 37: .same(proto: "UNEXPECTED_EXCEPTION"), - 39: .same(proto: "SOURCE_INPUT_IO_EXCEPTION"), - ] -} - -extension FailureDetails_Workspaces: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Workspaces" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .workspacesUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_Workspaces, rhs: FailureDetails_Workspaces) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_Workspaces.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "WORKSPACES_UNKNOWN"), - 1: .same(proto: "WORKSPACES_LOG_INITIALIZATION_FAILURE"), - 2: .same(proto: "WORKSPACES_LOG_WRITE_FAILURE"), - 3: .same(proto: "ILLEGAL_WORKSPACE_FILE_SYMLINK_WITH_MANAGED_DIRECTORIES"), - 4: .same(proto: "WORKSPACE_FILE_READ_FAILURE_WITH_MANAGED_DIRECTORIES"), - ] -} - -extension FailureDetails_CrashOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CrashOptions" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .crashOptionsUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_CrashOptions, rhs: FailureDetails_CrashOptions) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_CrashOptions.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CRASH_OPTIONS_UNKNOWN"), - ] -} - -extension FailureDetails_Filesystem: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Filesystem" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .filesystemUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_Filesystem, rhs: FailureDetails_Filesystem) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_Filesystem.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "FILESYSTEM_UNKNOWN"), - 3: .same(proto: "EMBEDDED_BINARIES_ENUMERATION_FAILURE"), - 4: .same(proto: "SERVER_PID_TXT_FILE_READ_FAILURE"), - 5: .same(proto: "SERVER_FILE_WRITE_FAILURE"), - 6: .same(proto: "DEFAULT_DIGEST_HASH_FUNCTION_INVALID_VALUE"), - ] -} - -extension FailureDetails_ExecutionOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ExecutionOptions" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .executionOptionsUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_ExecutionOptions, rhs: FailureDetails_ExecutionOptions) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_ExecutionOptions.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "EXECUTION_OPTIONS_UNKNOWN"), - 3: .same(proto: "INVALID_STRATEGY"), - 4: .same(proto: "REQUESTED_STRATEGY_INCOMPATIBLE_WITH_SANDBOXING"), - 5: .same(proto: "DEPRECATED_LOCAL_RESOURCES_USED"), - 6: .same(proto: "INVALID_CYCLIC_DYNAMIC_STRATEGY"), - 7: .same(proto: "RESTRICTION_UNMATCHED_TO_ACTION_CONTEXT"), - 8: .same(proto: "REMOTE_FALLBACK_STRATEGY_NOT_ABSTRACT_SPAWN"), - 9: .same(proto: "STRATEGY_NOT_FOUND"), - 10: .same(proto: "DYNAMIC_STRATEGY_NOT_SANDBOXED"), - ] -} - -extension FailureDetails_Command: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Command" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .commandFailureUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_Command, rhs: FailureDetails_Command) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_Command.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "COMMAND_FAILURE_UNKNOWN"), - 1: .same(proto: "COMMAND_NOT_FOUND"), - 2: .same(proto: "ANOTHER_COMMAND_RUNNING"), - 3: .same(proto: "PREVIOUSLY_SHUTDOWN"), - 4: .same(proto: "STARLARK_CPU_PROFILE_FILE_INITIALIZATION_FAILURE"), - 5: .same(proto: "STARLARK_CPU_PROFILING_INITIALIZATION_FAILURE"), - 6: .same(proto: "STARLARK_CPU_PROFILE_FILE_WRITE_FAILURE"), - 7: .same(proto: "INVOCATION_POLICY_PARSE_FAILURE"), - 8: .same(proto: "INVOCATION_POLICY_INVALID"), - 9: .same(proto: "OPTIONS_PARSE_FAILURE"), - 10: .same(proto: "STARLARK_OPTIONS_PARSE_FAILURE"), - 11: .same(proto: "ARGUMENTS_NOT_RECOGNIZED"), - 12: .same(proto: "NOT_IN_WORKSPACE"), - 13: .same(proto: "SPACES_IN_WORKSPACE_PATH"), - 14: .same(proto: "IN_OUTPUT_DIRECTORY"), - ] -} - -extension FailureDetails_GrpcServer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GrpcServer" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .grpcServerUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_GrpcServer, rhs: FailureDetails_GrpcServer) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_GrpcServer.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "GRPC_SERVER_UNKNOWN"), - 1: .same(proto: "GRPC_SERVER_NOT_COMPILED_IN"), - 2: .same(proto: "SERVER_BIND_FAILURE"), - 3: .same(proto: "BAD_COOKIE"), - 4: .same(proto: "NO_CLIENT_DESCRIPTION"), - ] -} - -extension FailureDetails_CanonicalizeFlags: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CanonicalizeFlags" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .canonicalizeFlagsUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_CanonicalizeFlags, rhs: FailureDetails_CanonicalizeFlags) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_CanonicalizeFlags.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CANONICALIZE_FLAGS_UNKNOWN"), - 1: .same(proto: "FOR_COMMAND_INVALID"), - ] -} - -extension FailureDetails_BuildConfiguration: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BuildConfiguration" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .buildConfigurationUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_BuildConfiguration, rhs: FailureDetails_BuildConfiguration) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_BuildConfiguration.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "BUILD_CONFIGURATION_UNKNOWN"), - 1: .same(proto: "PLATFORM_MAPPING_EVALUATION_FAILURE"), - 2: .same(proto: "PLATFORM_MAPPINGS_FILE_IS_DIRECTORY"), - 3: .same(proto: "PLATFORM_MAPPINGS_FILE_NOT_FOUND"), - 4: .same(proto: "TOP_LEVEL_CONFIGURATION_CREATION_FAILURE"), - 5: .same(proto: "INVALID_CONFIGURATION"), - 6: .same(proto: "INVALID_BUILD_OPTIONS"), - 7: .same(proto: "MULTI_CPU_PREREQ_UNMET"), - 8: .same(proto: "HEURISTIC_INSTRUMENTATION_FILTER_INVALID"), - 9: .same(proto: "CYCLE"), - 10: .same(proto: "CONFLICTING_CONFIGURATIONS"), - 11: .same(proto: "INVALID_OUTPUT_DIRECTORY_MNEMONIC"), - ] -} - -extension FailureDetails_InfoCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".InfoCommand" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .infoCommandUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_InfoCommand, rhs: FailureDetails_InfoCommand) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_InfoCommand.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "INFO_COMMAND_UNKNOWN"), - 1: .same(proto: "TOO_MANY_KEYS"), - 2: .same(proto: "KEY_NOT_RECOGNIZED"), - 3: .same(proto: "INFO_BLOCK_WRITE_FAILURE"), - 4: .same(proto: "ALL_INFO_WRITE_FAILURE"), - ] -} - -extension FailureDetails_MemoryOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MemoryOptions" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .memoryOptionsUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_MemoryOptions, rhs: FailureDetails_MemoryOptions) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_MemoryOptions.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "MEMORY_OPTIONS_UNKNOWN"), - 1: .same(proto: "EXPERIMENTAL_OOM_MORE_EAGERLY_THRESHOLD_INVALID_VALUE"), - 2: .same(proto: "EXPERIMENTAL_OOM_MORE_EAGERLY_NO_TENURED_COLLECTORS_FOUND"), - ] -} - -extension FailureDetails_Query: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Query" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .queryUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_Query, rhs: FailureDetails_Query) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_Query.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "QUERY_UNKNOWN"), - 1: .same(proto: "QUERY_FILE_WITH_COMMAND_LINE_EXPRESSION"), - 2: .same(proto: "QUERY_FILE_READ_FAILURE"), - 3: .same(proto: "COMMAND_LINE_EXPRESSION_MISSING"), - 4: .same(proto: "OUTPUT_FORMAT_INVALID"), - 5: .same(proto: "GRAPHLESS_PREREQ_UNMET"), - 6: .same(proto: "QUERY_OUTPUT_WRITE_FAILURE"), - 13: .same(proto: "QUERY_STDOUT_FLUSH_FAILURE"), - 14: .same(proto: "ANALYSIS_QUERY_PREREQ_UNMET"), - 15: .same(proto: "QUERY_RESULTS_FLUSH_FAILURE"), - 16: .same(proto: "DEPRECATED_UNCLOSED_QUOTATION_EXPRESSION_ERROR"), - 17: .same(proto: "VARIABLE_NAME_INVALID"), - 18: .same(proto: "VARIABLE_UNDEFINED"), - 19: .same(proto: "BUILDFILES_AND_LOADFILES_CANNOT_USE_OUTPUT_LOCATION_ERROR"), - 20: .same(proto: "BUILD_FILE_ERROR"), - 21: .same(proto: "CYCLE"), - 22: .same(proto: "UNIQUE_SKYKEY_THRESHOLD_EXCEEDED"), - 23: .same(proto: "TARGET_NOT_IN_UNIVERSE_SCOPE"), - 24: .same(proto: "INVALID_FULL_UNIVERSE_EXPRESSION"), - 25: .same(proto: "UNIVERSE_SCOPE_LIMIT_EXCEEDED"), - 26: .same(proto: "INVALIDATION_LIMIT_EXCEEDED"), - 27: .same(proto: "OUTPUT_FORMAT_PREREQ_UNMET"), - 28: .same(proto: "ARGUMENTS_MISSING"), - 29: .same(proto: "RBUILDFILES_FUNCTION_REQUIRES_SKYQUERY"), - 30: .same(proto: "FULL_TARGETS_NOT_SUPPORTED"), - 31: .same(proto: "DEPRECATED_UNEXPECTED_TOKEN_ERROR"), - 32: .same(proto: "DEPRECATED_INTEGER_LITERAL_MISSING"), - 33: .same(proto: "DEPRECATED_INVALID_STARTING_CHARACTER_ERROR"), - 34: .same(proto: "DEPRECATED_PREMATURE_END_OF_INPUT_ERROR"), - 35: .same(proto: "SYNTAX_ERROR"), - 36: .same(proto: "OUTPUT_FORMATTER_IO_EXCEPTION"), - 37: .same(proto: "SKYQUERY_TRANSITIVE_TARGET_ERROR"), - 38: .same(proto: "SKYQUERY_TARGET_EXCEPTION"), - 39: .same(proto: "INVALID_LABEL_IN_TEST_SUITE"), - 40: .same(proto: "ILLEGAL_FLAG_COMBINATION"), - ] -} - -extension FailureDetails_LocalExecution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LocalExecution" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .localExecutionUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_LocalExecution, rhs: FailureDetails_LocalExecution) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_LocalExecution.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "LOCAL_EXECUTION_UNKNOWN"), - 1: .same(proto: "LOCKFREE_OUTPUT_PREREQ_UNMET"), - ] -} - -extension FailureDetails_ActionCache: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ActionCache" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .actionCacheUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_ActionCache, rhs: FailureDetails_ActionCache) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_ActionCache.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "ACTION_CACHE_UNKNOWN"), - 1: .same(proto: "INITIALIZATION_FAILURE"), - ] -} - -extension FailureDetails_FetchCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FetchCommand" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .fetchCommandUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_FetchCommand, rhs: FailureDetails_FetchCommand) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_FetchCommand.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "FETCH_COMMAND_UNKNOWN"), - 1: .same(proto: "EXPRESSION_MISSING"), - 2: .same(proto: "OPTIONS_INVALID"), - 3: .same(proto: "QUERY_PARSE_ERROR"), - 4: .same(proto: "QUERY_EVALUATION_ERROR"), - ] -} - -extension FailureDetails_SyncCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SyncCommand" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .syncCommandUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_SyncCommand, rhs: FailureDetails_SyncCommand) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_SyncCommand.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SYNC_COMMAND_UNKNOWN"), - 1: .same(proto: "PACKAGE_LOOKUP_ERROR"), - 2: .same(proto: "WORKSPACE_EVALUATION_ERROR"), - 3: .same(proto: "REPOSITORY_FETCH_ERRORS"), - 4: .same(proto: "REPOSITORY_NAME_INVALID"), - ] -} - -extension FailureDetails_Sandbox: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Sandbox" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .sandboxFailureUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_Sandbox, rhs: FailureDetails_Sandbox) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_Sandbox.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SANDBOX_FAILURE_UNKNOWN"), - 1: .same(proto: "INITIALIZATION_FAILURE"), - 2: .same(proto: "EXECUTION_IO_EXCEPTION"), - 3: .same(proto: "DOCKER_COMMAND_FAILURE"), - 4: .same(proto: "NO_DOCKER_IMAGE"), - 5: .same(proto: "DOCKER_IMAGE_PREPARATION_FAILURE"), - 6: .same(proto: "BIND_MOUNT_ANALYSIS_FAILURE"), - 7: .same(proto: "MOUNT_SOURCE_DOES_NOT_EXIST"), - 8: .same(proto: "MOUNT_SOURCE_TARGET_TYPE_MISMATCH"), - 9: .same(proto: "MOUNT_TARGET_DOES_NOT_EXIST"), - 10: .same(proto: "SUBPROCESS_START_FAILED"), - ] -} - -extension FailureDetails_IncludeScanning: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".IncludeScanning" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .includeScanningUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_IncludeScanning, rhs: FailureDetails_IncludeScanning) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_IncludeScanning.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "INCLUDE_SCANNING_UNKNOWN"), - 1: .same(proto: "INITIALIZE_INCLUDE_HINTS_ERROR"), - 2: .same(proto: "SCANNING_IO_EXCEPTION"), - 3: .same(proto: "INCLUDE_HINTS_FILE_NOT_IN_PACKAGE"), - 4: .same(proto: "INCLUDE_HINTS_READ_FAILURE"), - 5: .same(proto: "ILLEGAL_ABSOLUTE_PATH"), - 6: .same(proto: "PACKAGE_LOAD_FAILURE"), - ] -} - -extension FailureDetails_TestCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TestCommand" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .testCommandUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_TestCommand, rhs: FailureDetails_TestCommand) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_TestCommand.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "TEST_COMMAND_UNKNOWN"), - 1: .same(proto: "NO_TEST_TARGETS"), - 2: .same(proto: "TEST_WITH_NOANALYZE"), - 3: .same(proto: "TESTS_FAILED"), - ] -} - -extension FailureDetails_ActionQuery: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ActionQuery" +extension FailureDetails_FailureDetail: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".FailureDetail" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), + 1: .same(proto: "message"), + 101: .same(proto: "interrupted"), + 103: .standard(proto: "external_repository"), + 104: .standard(proto: "build_progress"), + 106: .standard(proto: "remote_options"), + 107: .standard(proto: "client_environment"), + 108: .same(proto: "crash"), + 110: .standard(proto: "symlink_forest"), + 114: .standard(proto: "package_options"), + 115: .standard(proto: "remote_execution"), + 116: .same(proto: "execution"), + 117: .same(proto: "workspaces"), + 118: .standard(proto: "crash_options"), + 119: .same(proto: "filesystem"), + 121: .standard(proto: "execution_options"), + 122: .same(proto: "command"), + 123: .same(proto: "spawn"), + 124: .standard(proto: "grpc_server"), + 125: .standard(proto: "canonicalize_flags"), + 126: .standard(proto: "build_configuration"), + 127: .standard(proto: "info_command"), + 129: .standard(proto: "memory_options"), + 130: .same(proto: "query"), + 132: .standard(proto: "local_execution"), ] - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .actionQueryUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_ActionQuery, rhs: FailureDetails_ActionQuery) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} + fileprivate class _StorageClass { + var _message: String = String() + var _category: FailureDetails_FailureDetail.OneOf_Category? -extension FailureDetails_ActionQuery.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "ACTION_QUERY_UNKNOWN"), - 1: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), - 2: .same(proto: "OUTPUT_FAILURE"), - 3: .same(proto: "COMMAND_LINE_EXPRESSION_MISSING"), - 4: .same(proto: "EXPRESSION_PARSE_FAILURE"), - 5: .same(proto: "SKYFRAME_STATE_WITH_COMMAND_LINE_EXPRESSION"), - 6: .same(proto: "INVALID_AQUERY_EXPRESSION"), - 7: .same(proto: "SKYFRAME_STATE_PREREQ_UNMET"), - 8: .same(proto: "AQUERY_OUTPUT_TOO_BIG"), - 9: .same(proto: "ILLEGAL_PATTERN_SYNTAX"), - 10: .same(proto: "INCORRECT_ARGUMENTS"), - 11: .same(proto: "TOP_LEVEL_TARGETS_WITH_SKYFRAME_STATE_NOT_SUPPORTED"), - 12: .same(proto: "SKYFRAME_STATE_AFTER_EXECUTION"), - ] -} + static let defaultInstance = _StorageClass() -extension FailureDetails_TargetPatterns: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TargetPatterns" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] + private init() {} - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } + init(copying source: _StorageClass) { + _message = source._message + _category = source._category } } - public func traverse(visitor: inout V) throws { - if self.code != .targetPatternsUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_TargetPatterns, rhs: FailureDetails_TargetPatterns) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + return _storage } -} - -extension FailureDetails_TargetPatterns.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "TARGET_PATTERNS_UNKNOWN"), - 1: .same(proto: "TARGET_PATTERN_FILE_WITH_COMMAND_LINE_PATTERN"), - 2: .same(proto: "TARGET_PATTERN_FILE_READ_FAILURE"), - 3: .same(proto: "TARGET_PATTERN_PARSE_FAILURE"), - 4: .same(proto: "PACKAGE_NOT_FOUND"), - 5: .same(proto: "TARGET_FORMAT_INVALID"), - 6: .same(proto: "ABSOLUTE_TARGET_PATTERN_INVALID"), - 7: .same(proto: "CANNOT_DETERMINE_TARGET_FROM_FILENAME"), - 8: .same(proto: "LABEL_SYNTAX_ERROR"), - 9: .same(proto: "TARGET_CANNOT_BE_EMPTY_STRING"), - 10: .same(proto: "PACKAGE_PART_CANNOT_END_IN_SLASH"), - 11: .same(proto: "CYCLE"), - 12: .same(proto: "CANNOT_PRELOAD_TARGET"), - 13: .same(proto: "TARGETS_MISSING"), - 14: .same(proto: "RECURSIVE_TARGET_PATTERNS_NOT_ALLOWED"), - 15: .same(proto: "UP_LEVEL_REFERENCES_NOT_ALLOWED"), - 16: .same(proto: "NEGATIVE_TARGET_PATTERN_NOT_ALLOWED"), - 17: .same(proto: "TARGET_MUST_BE_A_FILE"), - 18: .same(proto: "DEPENDENCY_NOT_FOUND"), - 19: .same(proto: "PACKAGE_NAME_INVALID"), - ] -} - -extension FailureDetails_CleanCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CleanCommand" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularStringField(value: &_storage._message) + case 101: + var v: FailureDetails_Interrupted? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .interrupted(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .interrupted(v)} + case 103: + var v: FailureDetails_ExternalRepository? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .externalRepository(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .externalRepository(v)} + case 104: + var v: FailureDetails_BuildProgress? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .buildProgress(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .buildProgress(v)} + case 106: + var v: FailureDetails_RemoteOptions? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .remoteOptions(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .remoteOptions(v)} + case 107: + var v: FailureDetails_ClientEnvironment? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .clientEnvironment(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .clientEnvironment(v)} + case 108: + var v: FailureDetails_Crash? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .crash(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .crash(v)} + case 110: + var v: FailureDetails_SymlinkForest? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .symlinkForest(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .symlinkForest(v)} + case 114: + var v: FailureDetails_PackageOptions? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .packageOptions(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .packageOptions(v)} + case 115: + var v: FailureDetails_RemoteExecution? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .remoteExecution(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .remoteExecution(v)} + case 116: + var v: FailureDetails_Execution? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .execution(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .execution(v)} + case 117: + var v: FailureDetails_Workspaces? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .workspaces(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .workspaces(v)} + case 118: + var v: FailureDetails_CrashOptions? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .crashOptions(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .crashOptions(v)} + case 119: + var v: FailureDetails_Filesystem? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .filesystem(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .filesystem(v)} + case 121: + var v: FailureDetails_ExecutionOptions? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .executionOptions(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .executionOptions(v)} + case 122: + var v: FailureDetails_Command? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .command(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .command(v)} + case 123: + var v: FailureDetails_Spawn? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .spawn(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .spawn(v)} + case 124: + var v: FailureDetails_GrpcServer? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .grpcServer(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .grpcServer(v)} + case 125: + var v: FailureDetails_CanonicalizeFlags? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .canonicalizeFlags(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .canonicalizeFlags(v)} + case 126: + var v: FailureDetails_BuildConfiguration? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .buildConfiguration(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .buildConfiguration(v)} + case 127: + var v: FailureDetails_InfoCommand? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .infoCommand(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .infoCommand(v)} + case 129: + var v: FailureDetails_MemoryOptions? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .memoryOptions(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .memoryOptions(v)} + case 130: + var v: FailureDetails_Query? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .query(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .query(v)} + case 132: + var v: FailureDetails_LocalExecution? + if let current = _storage._category { + try decoder.handleConflictingOneOf() + if case .localExecution(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._category = .localExecution(v)} + default: break + } } } } public func traverse(visitor: inout V) throws { - if self.code != .cleanCommandUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_CleanCommand, rhs: FailureDetails_CleanCommand) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_CleanCommand.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CLEAN_COMMAND_UNKNOWN"), - 1: .same(proto: "OUTPUT_SERVICE_CLEAN_FAILURE"), - 2: .same(proto: "ACTION_CACHE_CLEAN_FAILURE"), - 3: .same(proto: "OUT_ERR_CLOSE_FAILURE"), - 4: .same(proto: "OUTPUT_BASE_DELETE_FAILURE"), - 5: .same(proto: "OUTPUT_BASE_TEMP_MOVE_FAILURE"), - 6: .same(proto: "ASYNC_OUTPUT_BASE_DELETE_FAILURE"), - 7: .same(proto: "EXECROOT_DELETE_FAILURE"), - 8: .same(proto: "EXECROOT_TEMP_MOVE_FAILURE"), - 9: .same(proto: "ASYNC_EXECROOT_DELETE_FAILURE"), - 10: .same(proto: "ARGUMENTS_NOT_RECOGNIZED"), - ] -} - -extension FailureDetails_ConfigCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ConfigCommand" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._message.isEmpty { + try visitor.visitSingularStringField(value: _storage._message, fieldNumber: 1) + } + switch _storage._category { + case .interrupted(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 101) + case .externalRepository(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 103) + case .buildProgress(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 104) + case .remoteOptions(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 106) + case .clientEnvironment(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 107) + case .crash(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 108) + case .symlinkForest(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 110) + case .packageOptions(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 114) + case .remoteExecution(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 115) + case .execution(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 116) + case .workspaces(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 117) + case .crashOptions(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 118) + case .filesystem(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 119) + case .executionOptions(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 121) + case .command(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 122) + case .spawn(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 123) + case .grpcServer(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 124) + case .canonicalizeFlags(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 125) + case .buildConfiguration(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 126) + case .infoCommand(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 127) + case .memoryOptions(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 129) + case .query(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 130) + case .localExecution(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 132) + case nil: break } } - } - - public func traverse(visitor: inout V) throws { - if self.code != .configCommandUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_ConfigCommand, rhs: FailureDetails_ConfigCommand) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension FailureDetails_ConfigCommand.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CONFIG_COMMAND_UNKNOWN"), - 1: .same(proto: "TOO_MANY_CONFIG_IDS"), - 2: .same(proto: "CONFIGURATION_NOT_FOUND"), - ] -} - -extension FailureDetails_ConfigurableQuery: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ConfigurableQuery" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break + public static func ==(lhs: FailureDetails_FailureDetail, rhs: FailureDetails_FailureDetail) -> Bool { + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._message != rhs_storage._message {return false} + if _storage._category != rhs_storage._category {return false} + return true } + if !storagesAreEqual {return false} } - } - - public func traverse(visitor: inout V) throws { - if self.code != .configurableQueryUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: FailureDetails_ConfigurableQuery, rhs: FailureDetails_ConfigurableQuery) -> Bool { - if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_ConfigurableQuery.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CONFIGURABLE_QUERY_UNKNOWN"), - 1: .same(proto: "COMMAND_LINE_EXPRESSION_MISSING"), - 2: .same(proto: "EXPRESSION_PARSE_FAILURE"), - 3: .same(proto: "FILTERS_NOT_SUPPORTED"), - 4: .same(proto: "BUILDFILES_FUNCTION_NOT_SUPPORTED"), - 5: .same(proto: "SIBLINGS_FUNCTION_NOT_SUPPORTED"), - 6: .same(proto: "VISIBLE_FUNCTION_NOT_SUPPORTED"), - 7: .same(proto: "ATTRIBUTE_MISSING"), - 8: .same(proto: "INCORRECT_CONFIG_ARGUMENT_ERROR"), - 9: .same(proto: "TARGET_MISSING"), - 10: .same(proto: "STARLARK_SYNTAX_ERROR"), - 11: .same(proto: "STARLARK_EVAL_ERROR"), - 12: .same(proto: "FORMAT_FUNCTION_ERROR"), - ] -} - -extension FailureDetails_DumpCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DumpCommand" +extension FailureDetails_Interrupted: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Interrupted" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .dumpCommandUnknown { + if self.code != .interruptedUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_DumpCommand, rhs: FailureDetails_DumpCommand) -> Bool { + public static func ==(lhs: FailureDetails_Interrupted, rhs: FailureDetails_Interrupted) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_DumpCommand.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_Interrupted.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "DUMP_COMMAND_UNKNOWN"), - 1: .same(proto: "NO_OUTPUT_SPECIFIED"), - 2: .same(proto: "ACTION_CACHE_DUMP_FAILED"), - 3: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), - 4: .same(proto: "ACTION_GRAPH_DUMP_FAILED"), - 5: .same(proto: "STARLARK_HEAP_DUMP_FAILED"), + 0: .same(proto: "INTERRUPTED_UNKNOWN"), + 4: .same(proto: "BUILD"), + 5: .same(proto: "BUILD_COMPLETION"), + 6: .same(proto: "PACKAGE_LOADING_SYNC"), + 7: .same(proto: "EXECUTOR_COMPLETION"), + 8: .same(proto: "COMMAND_DISPATCH"), + 9: .same(proto: "INFO_ITEM"), + 10: .same(proto: "AFTER_QUERY"), ] } -extension FailureDetails_HelpCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".HelpCommand" +extension FailureDetails_Spawn: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Spawn" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), + 2: .same(proto: "catastrophic"), + 3: .standard(proto: "spawn_exit_code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 2: try decoder.decodeSingularBoolField(value: &self.catastrophic) + case 3: try decoder.decodeSingularInt32Field(value: &self.spawnExitCode) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .helpCommandUnknown { + if self.code != .spawnUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } + if self.catastrophic != false { + try visitor.visitSingularBoolField(value: self.catastrophic, fieldNumber: 2) + } + if self.spawnExitCode != 0 { + try visitor.visitSingularInt32Field(value: self.spawnExitCode, fieldNumber: 3) + } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_HelpCommand, rhs: FailureDetails_HelpCommand) -> Bool { + public static func ==(lhs: FailureDetails_Spawn, rhs: FailureDetails_Spawn) -> Bool { if lhs.code != rhs.code {return false} + if lhs.catastrophic != rhs.catastrophic {return false} + if lhs.spawnExitCode != rhs.spawnExitCode {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_HelpCommand.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_Spawn.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "HELP_COMMAND_UNKNOWN"), - 1: .same(proto: "MISSING_ARGUMENT"), - 2: .same(proto: "COMMAND_NOT_FOUND"), + 0: .same(proto: "SPAWN_UNKNOWN"), + 1: .same(proto: "NON_ZERO_EXIT"), + 2: .same(proto: "TIMEOUT"), + 3: .same(proto: "OUT_OF_MEMORY"), + 4: .same(proto: "EXECUTION_FAILED"), + 5: .same(proto: "EXECUTION_DENIED"), + 6: .same(proto: "REMOTE_CACHE_FAILED"), ] } -extension FailureDetails_MobileInstall: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MobileInstall" +extension FailureDetails_ExternalRepository: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ExternalRepository" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .mobileInstallUnknown { + if self.code != .externalRepositoryUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_MobileInstall, rhs: FailureDetails_MobileInstall) -> Bool { + public static func ==(lhs: FailureDetails_ExternalRepository, rhs: FailureDetails_ExternalRepository) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_MobileInstall.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_ExternalRepository.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "MOBILE_INSTALL_UNKNOWN"), - 1: .same(proto: "CLASSIC_UNSUPPORTED"), - 2: .same(proto: "NO_TARGET_SPECIFIED"), - 3: .same(proto: "MULTIPLE_TARGETS_SPECIFIED"), - 4: .same(proto: "TARGET_TYPE_INVALID"), - 5: .same(proto: "NON_ZERO_EXIT"), - 6: .same(proto: "ERROR_RUNNING_PROGRAM"), + 0: .same(proto: "EXTERNAL_REPOSITORY_UNKNOWN"), + 1: .same(proto: "OVERRIDE_DISALLOWED_MANAGED_DIRECTORIES"), ] } -extension FailureDetails_ProfileCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ProfileCommand" +extension FailureDetails_BuildProgress: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".BuildProgress" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .profileCommandUnknown { + if self.code != .buildProgressUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_ProfileCommand, rhs: FailureDetails_ProfileCommand) -> Bool { + public static func ==(lhs: FailureDetails_BuildProgress, rhs: FailureDetails_BuildProgress) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_ProfileCommand.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_BuildProgress.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "PROFILE_COMMAND_UNKNOWN"), - 1: .same(proto: "OLD_BINARY_FORMAT_UNSUPPORTED"), - 2: .same(proto: "FILE_READ_FAILURE"), + 0: .same(proto: "BUILD_PROGRESS_UNKNOWN"), + 3: .same(proto: "OUTPUT_INITIALIZATION"), + 4: .same(proto: "BES_RUNS_PER_TEST_LIMIT_UNSUPPORTED"), + 5: .same(proto: "BES_LOCAL_WRITE_ERROR"), + 6: .same(proto: "BES_INITIALIZATION_ERROR"), + 7: .same(proto: "BES_UPLOAD_TIMEOUT_ERROR"), + 8: .same(proto: "BES_FILE_WRITE_TIMEOUT"), + 9: .same(proto: "BES_FILE_WRITE_IO_ERROR"), + 10: .same(proto: "BES_FILE_WRITE_INTERRUPTED"), + 11: .same(proto: "BES_FILE_WRITE_CANCELED"), + 12: .same(proto: "BES_FILE_WRITE_UNKNOWN_ERROR"), + 13: .same(proto: "BES_UPLOAD_LOCAL_FILE_ERROR"), + 14: .same(proto: "BES_STREAM_NOT_RETRYING_FAILURE"), + 15: .same(proto: "BES_STREAM_COMPLETED_WITH_UNACK_EVENTS_ERROR"), + 16: .same(proto: "BES_STREAM_COMPLETED_WITH_UNSENT_EVENTS_ERROR"), + 17: .same(proto: "BES_UPLOAD_RETRY_LIMIT_EXCEEDED_FAILURE"), ] } -extension FailureDetails_RunCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RunCommand" +extension FailureDetails_RemoteOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".RemoteOptions" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .runCommandUnknown { + if self.code != .remoteOptionsUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_RunCommand, rhs: FailureDetails_RunCommand) -> Bool { + public static func ==(lhs: FailureDetails_RemoteOptions, rhs: FailureDetails_RemoteOptions) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_RunCommand.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_RemoteOptions.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "RUN_COMMAND_UNKNOWN"), - 1: .same(proto: "NO_TARGET_SPECIFIED"), - 2: .same(proto: "TOO_MANY_TARGETS_SPECIFIED"), - 3: .same(proto: "TARGET_NOT_EXECUTABLE"), - 4: .same(proto: "TARGET_BUILT_BUT_PATH_NOT_EXECUTABLE"), - 5: .same(proto: "TARGET_BUILT_BUT_PATH_VALIDATION_FAILED"), - 6: .same(proto: "RUN_UNDER_TARGET_NOT_BUILT"), - 7: .same(proto: "RUN_PREREQ_UNMET"), - 8: .same(proto: "TOO_MANY_TEST_SHARDS_OR_RUNS"), - 9: .same(proto: "TEST_ENVIRONMENT_SETUP_FAILURE"), - 10: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), - 11: .same(proto: "NO_SHELL_SPECIFIED"), - 12: .same(proto: "SCRIPT_WRITE_FAILURE"), - 13: .same(proto: "RUNFILES_DIRECTORIES_CREATION_FAILURE"), - 14: .same(proto: "RUNFILES_SYMLINKS_CREATION_FAILURE"), - 15: .same(proto: "TEST_ENVIRONMENT_SETUP_INTERRUPTED"), + 0: .same(proto: "REMOTE_OPTIONS_UNKNOWN"), + 1: .same(proto: "REMOTE_DEFAULT_EXEC_PROPERTIES_LOGIC_ERROR"), + 2: .same(proto: "CREDENTIALS_READ_FAILURE"), + 3: .same(proto: "CREDENTIALS_WRITE_FAILURE"), + 4: .same(proto: "DOWNLOADER_WITHOUT_GRPC_CACHE"), + 5: .same(proto: "EXECUTION_WITH_INVALID_CACHE"), ] } -extension FailureDetails_VersionCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VersionCommand" +extension FailureDetails_ClientEnvironment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ClientEnvironment" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .versionCommandUnknown { + if self.code != .clientEnvironmentUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_VersionCommand, rhs: FailureDetails_VersionCommand) -> Bool { + public static func ==(lhs: FailureDetails_ClientEnvironment, rhs: FailureDetails_ClientEnvironment) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_VersionCommand.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_ClientEnvironment.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "VERSION_COMMAND_UNKNOWN"), - 1: .same(proto: "NOT_AVAILABLE"), + 0: .same(proto: "CLIENT_ENVIRONMENT_UNKNOWN"), + 1: .same(proto: "CLIENT_CWD_MALFORMED"), ] } -extension FailureDetails_PrintActionCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PrintActionCommand" +extension FailureDetails_Crash: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Crash" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), + 2: .same(proto: "causes"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) + case 2: try decoder.decodeRepeatedMessageField(value: &self.causes) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .printActionCommandUnknown { + if self.code != .crashUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } + if !self.causes.isEmpty { + try visitor.visitRepeatedMessageField(value: self.causes, fieldNumber: 2) + } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_PrintActionCommand, rhs: FailureDetails_PrintActionCommand) -> Bool { + public static func ==(lhs: FailureDetails_Crash, rhs: FailureDetails_Crash) -> Bool { if lhs.code != rhs.code {return false} + if lhs.causes != rhs.causes {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_PrintActionCommand.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_Crash.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "PRINT_ACTION_COMMAND_UNKNOWN"), - 1: .same(proto: "TARGET_NOT_FOUND"), - 2: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), - 3: .same(proto: "TARGET_KIND_UNSUPPORTED"), - 4: .same(proto: "ACTIONS_NOT_FOUND"), + 0: .same(proto: "CRASH_UNKNOWN"), + 1: .same(proto: "CRASH_OOM"), ] } -extension FailureDetails_WorkspaceStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".WorkspaceStatus" +extension FailureDetails_Throwable: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Throwable" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "code"), + 1: .standard(proto: "throwable_class"), + 2: .same(proto: "message"), + 3: .standard(proto: "stack_trace"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularStringField(value: &self.throwableClass) + case 2: try decoder.decodeSingularStringField(value: &self.message) + case 3: try decoder.decodeRepeatedStringField(value: &self.stackTrace) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .workspaceStatusUnknown { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) + if !self.throwableClass.isEmpty { + try visitor.visitSingularStringField(value: self.throwableClass, fieldNumber: 1) + } + if !self.message.isEmpty { + try visitor.visitSingularStringField(value: self.message, fieldNumber: 2) + } + if !self.stackTrace.isEmpty { + try visitor.visitRepeatedStringField(value: self.stackTrace, fieldNumber: 3) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_WorkspaceStatus, rhs: FailureDetails_WorkspaceStatus) -> Bool { - if lhs.code != rhs.code {return false} + public static func ==(lhs: FailureDetails_Throwable, rhs: FailureDetails_Throwable) -> Bool { + if lhs.throwableClass != rhs.throwableClass {return false} + if lhs.message != rhs.message {return false} + if lhs.stackTrace != rhs.stackTrace {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_WorkspaceStatus.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "WORKSPACE_STATUS_UNKNOWN"), - 1: .same(proto: "NON_ZERO_EXIT"), - 2: .same(proto: "ABNORMAL_TERMINATION"), - 3: .same(proto: "EXEC_FAILED"), - 4: .same(proto: "PARSE_FAILURE"), - 5: .same(proto: "VALIDATION_FAILURE"), - 6: .same(proto: "CONTENT_UPDATE_IO_EXCEPTION"), - 7: .same(proto: "STDERR_IO_EXCEPTION"), - ] -} - -extension FailureDetails_JavaCompile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".JavaCompile" +extension FailureDetails_SymlinkForest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SymlinkForest" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .javaCompileUnknown { + if self.code != .symlinkForestUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_JavaCompile, rhs: FailureDetails_JavaCompile) -> Bool { + public static func ==(lhs: FailureDetails_SymlinkForest, rhs: FailureDetails_SymlinkForest) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_JavaCompile.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_SymlinkForest.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "JAVA_COMPILE_UNKNOWN"), - 1: .same(proto: "REDUCED_CLASSPATH_FAILURE"), - 2: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), - 3: .same(proto: "JDEPS_READ_IO_EXCEPTION"), - 4: .same(proto: "REDUCED_CLASSPATH_FALLBACK_CLEANUP_FAILURE"), + 0: .same(proto: "SYMLINK_FOREST_UNKNOWN"), + 1: .same(proto: "TOPLEVEL_OUTDIR_PACKAGE_PATH_CONFLICT"), + 2: .same(proto: "TOPLEVEL_OUTDIR_USED_AS_SOURCE"), ] } -extension FailureDetails_ActionRewinding: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ActionRewinding" +extension FailureDetails_PackageOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".PackageOptions" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .actionRewindingUnknown { + if self.code != .packageOptionsUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_ActionRewinding, rhs: FailureDetails_ActionRewinding) -> Bool { + public static func ==(lhs: FailureDetails_PackageOptions, rhs: FailureDetails_PackageOptions) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_ActionRewinding.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_PackageOptions.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "ACTION_REWINDING_UNKNOWN"), - 1: .same(proto: "LOST_INPUT_TOO_MANY_TIMES"), - 2: .same(proto: "LOST_INPUT_IS_SOURCE"), + 0: .same(proto: "PACKAGE_OPTIONS_UNKNOWN"), + 1: .same(proto: "PACKAGE_PATH_INVALID"), ] } -extension FailureDetails_CppCompile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CppCompile" +extension FailureDetails_RemoteExecution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".RemoteExecution" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .cppCompileUnknown { + if self.code != .remoteExecutionUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_CppCompile, rhs: FailureDetails_CppCompile) -> Bool { + public static func ==(lhs: FailureDetails_RemoteExecution, rhs: FailureDetails_RemoteExecution) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_CppCompile.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_RemoteExecution.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CPP_COMPILE_UNKNOWN"), - 1: .same(proto: "FIND_USED_HEADERS_IO_EXCEPTION"), - 2: .same(proto: "COPY_OUT_ERR_FAILURE"), - 3: .same(proto: "D_FILE_READ_FAILURE"), - 4: .same(proto: "COMMAND_GENERATION_FAILURE"), - 5: .same(proto: "MODULE_EXPANSION_TIMEOUT"), - 6: .same(proto: "INCLUDE_PATH_OUTSIDE_EXEC_ROOT"), - 7: .same(proto: "FAKE_COMMAND_GENERATION_FAILURE"), - 8: .same(proto: "UNDECLARED_INCLUSIONS"), - 9: .same(proto: "D_FILE_PARSE_FAILURE"), - 10: .same(proto: "COVERAGE_NOTES_CREATION_FAILURE"), - 11: .same(proto: "MODULE_EXPANSION_MISSING_DATA"), + 0: .same(proto: "REMOTE_EXECUTION_UNKNOWN"), + 1: .same(proto: "CAPABILITIES_QUERY_FAILURE"), + 2: .same(proto: "CREDENTIALS_INIT_FAILURE"), + 3: .same(proto: "CACHE_INIT_FAILURE"), + 4: .same(proto: "RPC_LOG_FAILURE"), + 5: .same(proto: "EXEC_CHANNEL_INIT_FAILURE"), + 6: .same(proto: "CACHE_CHANNEL_INIT_FAILURE"), + 7: .same(proto: "DOWNLOADER_CHANNEL_INIT_FAILURE"), + 8: .same(proto: "LOG_DIR_CLEANUP_FAILURE"), + 9: .same(proto: "CLIENT_SERVER_INCOMPATIBLE"), + 10: .same(proto: "DOWNLOADED_INPUTS_DELETION_FAILURE"), + 11: .same(proto: "REMOTE_DOWNLOAD_OUTPUTS_MINIMAL_WITHOUT_INMEMORY_DOTD"), + 12: .same(proto: "REMOTE_DOWNLOAD_OUTPUTS_MINIMAL_WITHOUT_INMEMORY_JDEPS"), ] } -extension FailureDetails_StarlarkAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StarlarkAction" +extension FailureDetails_Execution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Execution" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .starlarkActionUnknown { + if self.code != .executionUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_StarlarkAction, rhs: FailureDetails_StarlarkAction) -> Bool { + public static func ==(lhs: FailureDetails_Execution, rhs: FailureDetails_Execution) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_StarlarkAction.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_Execution.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "STARLARK_ACTION_UNKNOWN"), - 1: .same(proto: "UNUSED_INPUT_LIST_READ_FAILURE"), - 2: .same(proto: "UNUSED_INPUT_LIST_FILE_NOT_FOUND"), + 0: .same(proto: "EXECUTION_UNKNOWN"), + 1: .same(proto: "EXECUTION_LOG_INITIALIZATION_FAILURE"), + 2: .same(proto: "EXECUTION_LOG_WRITE_FAILURE"), ] } -extension FailureDetails_NinjaAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NinjaAction" +extension FailureDetails_Workspaces: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Workspaces" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .ninjaActionUnknown { + if self.code != .workspacesUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_NinjaAction, rhs: FailureDetails_NinjaAction) -> Bool { + public static func ==(lhs: FailureDetails_Workspaces, rhs: FailureDetails_Workspaces) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_NinjaAction.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_Workspaces.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "NINJA_ACTION_UNKNOWN"), - 1: .same(proto: "INVALID_DEPFILE_DECLARED_DEPENDENCY"), - 2: .same(proto: "D_FILE_PARSE_FAILURE"), + 0: .same(proto: "WORKSPACES_UNKNOWN"), + 1: .same(proto: "WORKSPACES_LOG_INITIALIZATION_FAILURE"), + 2: .same(proto: "WORKSPACES_LOG_WRITE_FAILURE"), + 3: .same(proto: "ILLEGAL_WORKSPACE_FILE_SYMLINK_WITH_MANAGED_DIRECTORIES"), + 4: .same(proto: "WORKSPACE_FILE_READ_FAILURE_WITH_MANAGED_DIRECTORIES"), ] } -extension FailureDetails_DynamicExecution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DynamicExecution" +extension FailureDetails_CrashOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".CrashOptions" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .dynamicExecutionUnknown { + if self.code != .crashOptionsUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_DynamicExecution, rhs: FailureDetails_DynamicExecution) -> Bool { + public static func ==(lhs: FailureDetails_CrashOptions, rhs: FailureDetails_CrashOptions) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_DynamicExecution.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_CrashOptions.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "DYNAMIC_EXECUTION_UNKNOWN"), - 1: .same(proto: "XCODE_RELATED_PREREQ_UNMET"), - 2: .same(proto: "ACTION_LOG_MOVE_FAILURE"), - 3: .same(proto: "RUN_FAILURE"), - 4: .same(proto: "NO_USABLE_STRATEGY_FOUND"), + 0: .same(proto: "CRASH_OPTIONS_UNKNOWN"), ] } -extension FailureDetails_FailAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FailAction" +extension FailureDetails_Filesystem: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Filesystem" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .failActionUnknown { + if self.code != .filesystemUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_FailAction, rhs: FailureDetails_FailAction) -> Bool { + public static func ==(lhs: FailureDetails_Filesystem, rhs: FailureDetails_Filesystem) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_FailAction.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_Filesystem.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "FAIL_ACTION_UNKNOWN"), - 1: .same(proto: "INTENTIONAL_FAILURE"), - 2: .same(proto: "INCORRECT_PYTHON_VERSION"), - 3: .same(proto: "PROGUARD_SPECS_MISSING"), - 4: .same(proto: "DYNAMIC_LINKING_NOT_SUPPORTED"), - 5: .same(proto: "SOURCE_FILES_MISSING"), - 6: .same(proto: "INCORRECT_TOOLCHAIN"), - 7: .same(proto: "FRAGMENT_CLASS_MISSING"), - 10: .same(proto: "CANT_BUILD_INCOMPATIBLE_TARGET"), + 0: .same(proto: "FILESYSTEM_UNKNOWN"), + 1: .same(proto: "DEFAULT_DIGEST_HASH_FUNCTION_CHANGED"), + 2: .same(proto: "DEFAULT_DIGEST_HASH_FUNCTION_NOT_SET"), + 3: .same(proto: "EMBEDDED_BINARIES_ENUMERATION_FAILURE"), + 4: .same(proto: "SERVER_PID_TXT_FILE_READ_FAILURE"), + 5: .same(proto: "SERVER_FILE_WRITE_FAILURE"), + 6: .same(proto: "DEFAULT_DIGEST_HASH_FUNCTION_INVALID_VALUE"), ] } -extension FailureDetails_SymlinkAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SymlinkAction" +extension FailureDetails_ExecutionOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ExecutionOptions" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .symlinkActionUnknown { + if self.code != .executionOptionsUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_SymlinkAction, rhs: FailureDetails_SymlinkAction) -> Bool { + public static func ==(lhs: FailureDetails_ExecutionOptions, rhs: FailureDetails_ExecutionOptions) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_SymlinkAction.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_ExecutionOptions.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SYMLINK_ACTION_UNKNOWN"), - 1: .same(proto: "EXECUTABLE_INPUT_NOT_FILE"), - 2: .same(proto: "EXECUTABLE_INPUT_IS_NOT"), - 3: .same(proto: "EXECUTABLE_INPUT_CHECK_IO_EXCEPTION"), - 4: .same(proto: "LINK_CREATION_IO_EXCEPTION"), - 5: .same(proto: "LINK_TOUCH_IO_EXCEPTION"), + 0: .same(proto: "EXECUTION_OPTIONS_UNKNOWN"), + 3: .same(proto: "INVALID_STRATEGY"), + 4: .same(proto: "REQUESTED_STRATEGY_INCOMPATIBLE_WITH_SANDBOXING"), ] } -extension FailureDetails_CppLink: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CppLink" +extension FailureDetails_Command: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Command" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .cppLinkUnknown { + if self.code != .commandFailureUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_CppLink, rhs: FailureDetails_CppLink) -> Bool { + public static func ==(lhs: FailureDetails_Command, rhs: FailureDetails_Command) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_CppLink.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_Command.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "CPP_LINK_UNKNOWN"), - 1: .same(proto: "COMMAND_GENERATION_FAILURE"), - 2: .same(proto: "FAKE_COMMAND_GENERATION_FAILURE"), + 0: .same(proto: "COMMAND_FAILURE_UNKNOWN"), + 1: .same(proto: "COMMAND_NOT_FOUND"), + 2: .same(proto: "ANOTHER_COMMAND_RUNNING"), + 3: .same(proto: "PREVIOUSLY_SHUTDOWN"), + 4: .same(proto: "STARLARK_CPU_PROFILE_FILE_INITIALIZATION_FAILURE"), + 5: .same(proto: "STARLARK_CPU_PROFILING_INITIALIZATION_FAILURE"), + 6: .same(proto: "STARLARK_CPU_PROFILE_FILE_WRITE_FAILURE"), + 7: .same(proto: "INVOCATION_POLICY_PARSE_FAILURE"), + 8: .same(proto: "INVOCATION_POLICY_INVALID"), + 9: .same(proto: "OPTIONS_PARSE_FAILURE"), + 10: .same(proto: "STARLARK_OPTIONS_PARSE_FAILURE"), + 11: .same(proto: "ARGUMENTS_NOT_RECOGNIZED"), ] } -extension FailureDetails_LtoAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LtoAction" +extension FailureDetails_GrpcServer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GrpcServer" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .ltoActionUnknown { + if self.code != .grpcServerUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_LtoAction, rhs: FailureDetails_LtoAction) -> Bool { + public static func ==(lhs: FailureDetails_GrpcServer, rhs: FailureDetails_GrpcServer) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_LtoAction.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_GrpcServer.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "LTO_ACTION_UNKNOWN"), - 1: .same(proto: "INVALID_ABSOLUTE_PATH_IN_IMPORTS"), - 2: .same(proto: "MISSING_BITCODE_FILES"), - 3: .same(proto: "IMPORTS_READ_IO_EXCEPTION"), + 0: .same(proto: "GRPC_SERVER_UNKNOWN"), + 1: .same(proto: "GRPC_SERVER_NOT_COMPILED_IN"), + 2: .same(proto: "SERVER_BIND_FAILURE"), + 3: .same(proto: "BAD_COOKIE"), + 4: .same(proto: "NO_CLIENT_DESCRIPTION"), ] } -extension FailureDetails_TestAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TestAction" +extension FailureDetails_CanonicalizeFlags: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".CanonicalizeFlags" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .testActionUnknown { + if self.code != .canonicalizeFlagsUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_TestAction, rhs: FailureDetails_TestAction) -> Bool { + public static func ==(lhs: FailureDetails_CanonicalizeFlags, rhs: FailureDetails_CanonicalizeFlags) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_TestAction.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_CanonicalizeFlags.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "TEST_ACTION_UNKNOWN"), - 1: .same(proto: "NO_KEEP_GOING_TEST_FAILURE"), - 2: .same(proto: "LOCAL_TEST_PREREQ_UNMET"), - 3: .same(proto: "COMMAND_LINE_EXPANSION_FAILURE"), - 4: .same(proto: "DUPLICATE_CPU_TAGS"), - 5: .same(proto: "INVALID_CPU_TAG"), + 0: .same(proto: "CANONICALIZE_FLAGS_UNKNOWN"), + 1: .same(proto: "FOR_COMMAND_INVALID"), ] } -extension FailureDetails_Worker: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Worker" +extension FailureDetails_BuildConfiguration: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".BuildConfiguration" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .workerUnknown { + if self.code != .buildConfigurationUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Worker, rhs: FailureDetails_Worker) -> Bool { + public static func ==(lhs: FailureDetails_BuildConfiguration, rhs: FailureDetails_BuildConfiguration) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Worker.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_BuildConfiguration.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "WORKER_UNKNOWN"), - 1: .same(proto: "MULTIPLEXER_INSTANCE_REMOVAL_FAILURE"), - 2: .same(proto: "MULTIPLEXER_DOES_NOT_EXIST"), - 3: .same(proto: "NO_TOOLS"), - 4: .same(proto: "NO_FLAGFILE"), - 5: .same(proto: "VIRTUAL_INPUT_MATERIALIZATION_FAILURE"), - 6: .same(proto: "BORROW_FAILURE"), - 7: .same(proto: "PREFETCH_FAILURE"), - 8: .same(proto: "PREPARE_FAILURE"), - 9: .same(proto: "REQUEST_FAILURE"), - 10: .same(proto: "PARSE_RESPONSE_FAILURE"), - 11: .same(proto: "NO_RESPONSE"), - 12: .same(proto: "FINISH_FAILURE"), + 0: .same(proto: "BUILD_CONFIGURATION_UNKNOWN"), + 1: .same(proto: "PLATFORM_MAPPING_EVALUATION_FAILURE"), ] } -extension FailureDetails_Analysis: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Analysis" +extension FailureDetails_InfoCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".InfoCommand" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .analysisUnknown { + if self.code != .infoCommandUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Analysis, rhs: FailureDetails_Analysis) -> Bool { + public static func ==(lhs: FailureDetails_InfoCommand, rhs: FailureDetails_InfoCommand) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Analysis.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_InfoCommand.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "ANALYSIS_UNKNOWN"), - 1: .same(proto: "LOAD_FAILURE"), - 2: .same(proto: "GENERIC_LOADING_PHASE_FAILURE"), - 3: .same(proto: "NOT_ALL_TARGETS_ANALYZED"), - 4: .same(proto: "CYCLE"), - 5: .same(proto: "PARAMETERIZED_TOP_LEVEL_ASPECT_INVALID"), - 6: .same(proto: "ASPECT_LABEL_SYNTAX_ERROR"), - 7: .same(proto: "ASPECT_PREREQ_UNMET"), - 8: .same(proto: "ASPECT_NOT_FOUND"), - 9: .same(proto: "ACTION_CONFLICT"), - 10: .same(proto: "ARTIFACT_PREFIX_CONFLICT"), - 11: .same(proto: "UNEXPECTED_ANALYSIS_EXCEPTION"), - 12: .same(proto: "TARGETS_MISSING_ENVIRONMENTS"), - 13: .same(proto: "INVALID_ENVIRONMENT"), - 14: .same(proto: "ENVIRONMENT_MISSING_FROM_GROUPS"), - 15: .same(proto: "EXEC_GROUP_MISSING"), - 16: .same(proto: "INVALID_EXECUTION_PLATFORM"), - 17: .same(proto: "ASPECT_CREATION_FAILED"), - 18: .same(proto: "CONFIGURED_VALUE_CREATION_FAILED"), - 19: .same(proto: "INCOMPATIBLE_TARGET_REQUESTED"), + 0: .same(proto: "INFO_COMMAND_UNKNOWN"), + 1: .same(proto: "TOO_MANY_KEYS"), + 2: .same(proto: "KEY_NOT_RECOGNIZED"), + 3: .same(proto: "INFO_BLOCK_WRITE_FAILURE"), + 4: .same(proto: "ALL_INFO_WRITE_FAILURE"), ] } -extension FailureDetails_PackageLoading: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PackageLoading" +extension FailureDetails_MemoryOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".MemoryOptions" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .packageLoadingUnknown { + if self.code != .memoryOptionsUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_PackageLoading, rhs: FailureDetails_PackageLoading) -> Bool { + public static func ==(lhs: FailureDetails_MemoryOptions, rhs: FailureDetails_MemoryOptions) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_PackageLoading.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_MemoryOptions.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "PACKAGE_LOADING_UNKNOWN"), - 1: .same(proto: "WORKSPACE_FILE_ERROR"), - 2: .same(proto: "MAX_COMPUTATION_STEPS_EXCEEDED"), - 3: .same(proto: "BUILD_FILE_MISSING"), - 4: .same(proto: "REPOSITORY_MISSING"), - 5: .same(proto: "PERSISTENT_INCONSISTENT_FILESYSTEM_ERROR"), - 6: .same(proto: "TRANSIENT_INCONSISTENT_FILESYSTEM_ERROR"), - 7: .same(proto: "INVALID_NAME"), - 9: .same(proto: "EVAL_GLOBS_SYMLINK_ERROR"), - 10: .same(proto: "IMPORT_STARLARK_FILE_ERROR"), - 11: .same(proto: "PACKAGE_MISSING"), - 12: .same(proto: "TARGET_MISSING"), - 13: .same(proto: "NO_SUCH_THING"), - 14: .same(proto: "GLOB_IO_EXCEPTION"), - 15: .same(proto: "DUPLICATE_LABEL"), - 16: .same(proto: "INVALID_PACKAGE_SPECIFICATION"), - 17: .same(proto: "SYNTAX_ERROR"), - 18: .same(proto: "ENVIRONMENT_IN_DIFFERENT_PACKAGE"), - 19: .same(proto: "DEFAULT_ENVIRONMENT_UNDECLARED"), - 20: .same(proto: "ENVIRONMENT_IN_MULTIPLE_GROUPS"), - 21: .same(proto: "ENVIRONMENT_DOES_NOT_EXIST"), - 22: .same(proto: "ENVIRONMENT_INVALID"), - 23: .same(proto: "ENVIRONMENT_NOT_IN_GROUP"), - 24: .same(proto: "PACKAGE_NAME_INVALID"), - 25: .same(proto: "STARLARK_EVAL_ERROR"), - 26: .same(proto: "LICENSE_PARSE_FAILURE"), - 27: .same(proto: "DISTRIBUTIONS_PARSE_FAILURE"), - 28: .same(proto: "LABEL_CROSSES_PACKAGE_BOUNDARY"), + 0: .same(proto: "MEMORY_OPTIONS_UNKNOWN"), + 1: .same(proto: "EXPERIMENTAL_OOM_MORE_EAGERLY_THRESHOLD_INVALID_VALUE"), ] } -extension FailureDetails_Toolchain: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Toolchain" +extension FailureDetails_Query: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Query" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .toolchainUnknown { + if self.code != .queryUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_Toolchain, rhs: FailureDetails_Toolchain) -> Bool { + public static func ==(lhs: FailureDetails_Query, rhs: FailureDetails_Query) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_Toolchain.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_Query.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "TOOLCHAIN_UNKNOWN"), - 1: .same(proto: "MISSING_PROVIDER"), - 2: .same(proto: "INVALID_CONSTRAINT_VALUE"), - 3: .same(proto: "INVALID_PLATFORM_VALUE"), - 4: .same(proto: "INVALID_TOOLCHAIN"), - 5: .same(proto: "NO_MATCHING_EXECUTION_PLATFORM"), - 6: .same(proto: "NO_MATCHING_TOOLCHAIN"), - 7: .same(proto: "INVALID_TOOLCHAIN_TYPE"), + 0: .same(proto: "QUERY_UNKNOWN"), + 1: .same(proto: "QUERY_FILE_WITH_COMMAND_LINE_EXPRESSION"), + 2: .same(proto: "QUERY_FILE_READ_FAILURE"), + 3: .same(proto: "COMMAND_LINE_EXPRESSION_MISSING"), + 4: .same(proto: "OUTPUT_FORMAT_INVALID"), + 5: .same(proto: "GRAPHLESS_PREREQ_UNMET"), + 6: .same(proto: "QUERY_OUTPUT_WRITE_FAILURE"), + 13: .same(proto: "QUERY_STDOUT_FLUSH_FAILURE"), + 14: .same(proto: "ANALYSIS_QUERY_PREREQ_UNMET"), ] } -extension FailureDetails_StarlarkLoading: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StarlarkLoading" +extension FailureDetails_LocalExecution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".LocalExecution" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "code"), ] public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() + case 1: try decoder.decodeSingularEnumField(value: &self.code) default: break } } } public func traverse(visitor: inout V) throws { - if self.code != .starlarkLoadingUnknown { + if self.code != .localExecutionUnknown { try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: FailureDetails_StarlarkLoading, rhs: FailureDetails_StarlarkLoading) -> Bool { + public static func ==(lhs: FailureDetails_LocalExecution, rhs: FailureDetails_LocalExecution) -> Bool { if lhs.code != rhs.code {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension FailureDetails_StarlarkLoading.Code: SwiftProtobuf._ProtoNameProviding { +extension FailureDetails_LocalExecution.Code: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "STARLARK_LOADING_UNKNOWN"), - 1: .same(proto: "CYCLE"), - 2: .same(proto: "COMPILE_ERROR"), - 3: .same(proto: "PARSE_ERROR"), - 4: .same(proto: "EVAL_ERROR"), - 5: .same(proto: "CONTAINING_PACKAGE_NOT_FOUND"), - 6: .same(proto: "PACKAGE_NOT_FOUND"), - 7: .same(proto: "IO_ERROR"), - 8: .same(proto: "LABEL_CROSSES_PACKAGE_BOUNDARY"), - 9: .same(proto: "BUILTINS_ERROR"), + 0: .same(proto: "LOCAL_EXECUTION_UNKNOWN"), + 1: .same(proto: "LOCKFREE_OUTPUT_PREREQ_UNMET"), ] } diff --git a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/invocation_policy.pb.swift b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/invocation_policy.pb.swift old mode 100644 new mode 100755 index 976e338..f1e6f2c --- a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/invocation_policy.pb.swift +++ b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/invocation_policy.pb.swift @@ -1,5 +1,4 @@ // DO NOT EDIT. -// swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: src/main/protobuf/invocation_policy.proto @@ -7,44 +6,24 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ -// Copyright 2015 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API +// Please ensure that your are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } -/// The --invocation_policy flag takes a base64-encoded binary-serialized or text -/// formatted InvocationPolicy message. public struct Blaze_InvocationPolicy_InvocationPolicy { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Order matters. - /// After expanding policies on expansion flags or flags with implicit - /// requirements, only the final policy on a specific flag will be enforced - /// onto the user's command line. public var flagPolicies: [Blaze_InvocationPolicy_FlagPolicy] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -52,72 +31,60 @@ public struct Blaze_InvocationPolicy_InvocationPolicy { public init() {} } -/// A policy for controlling the value of a flag. public struct Blaze_InvocationPolicy_FlagPolicy { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The name of the flag to enforce this policy on. - /// - /// Note that this should be the full name of the flag, not the abbreviated - /// name of the flag. If the user specifies the abbreviated name of a flag, - /// that flag will be matched using its full name. - /// - /// The "no" prefix will not be parsed, so for boolean flags, use - /// the flag's full name and explicitly set it to true or false. public var flagName: String { - get {return _flagName ?? String()} - set {_flagName = newValue} + get {return _storage._flagName ?? String()} + set {_uniqueStorage()._flagName = newValue} } /// Returns true if `flagName` has been explicitly set. - public var hasFlagName: Bool {return self._flagName != nil} + public var hasFlagName: Bool {return _storage._flagName != nil} /// Clears the value of `flagName`. Subsequent reads from it will return its default value. - public mutating func clearFlagName() {self._flagName = nil} + public mutating func clearFlagName() {_uniqueStorage()._flagName = nil} - /// If set, this flag policy is applied only if one of the given commands or a - /// command that inherits from one of the given commands is being run. For - /// instance, if "build" is one of the commands here, then this policy will - /// apply to any command that inherits from build, such as info, coverage, or - /// test. If empty, this flag policy is applied for all commands. This allows - /// the policy setter to add all policies to the proto without having to - /// determine which Bazel command the user is actually running. Additionally, - /// Bazel allows multiple flags to be defined by the same name, and the - /// specific flag definition is determined by the command. - public var commands: [String] = [] + public var commands: [String] { + get {return _storage._commands} + set {_uniqueStorage()._commands = newValue} + } - public var operation: Blaze_InvocationPolicy_FlagPolicy.OneOf_Operation? = nil + public var operation: OneOf_Operation? { + get {return _storage._operation} + set {_uniqueStorage()._operation = newValue} + } public var setValue: Blaze_InvocationPolicy_SetValue { get { - if case .setValue(let v)? = operation {return v} + if case .setValue(let v)? = _storage._operation {return v} return Blaze_InvocationPolicy_SetValue() } - set {operation = .setValue(newValue)} + set {_uniqueStorage()._operation = .setValue(newValue)} } public var useDefault: Blaze_InvocationPolicy_UseDefault { get { - if case .useDefault(let v)? = operation {return v} + if case .useDefault(let v)? = _storage._operation {return v} return Blaze_InvocationPolicy_UseDefault() } - set {operation = .useDefault(newValue)} + set {_uniqueStorage()._operation = .useDefault(newValue)} } public var disallowValues: Blaze_InvocationPolicy_DisallowValues { get { - if case .disallowValues(let v)? = operation {return v} + if case .disallowValues(let v)? = _storage._operation {return v} return Blaze_InvocationPolicy_DisallowValues() } - set {operation = .disallowValues(newValue)} + set {_uniqueStorage()._operation = .disallowValues(newValue)} } public var allowValues: Blaze_InvocationPolicy_AllowValues { get { - if case .allowValues(let v)? = operation {return v} + if case .allowValues(let v)? = _storage._operation {return v} return Blaze_InvocationPolicy_AllowValues() } - set {operation = .allowValues(newValue)} + set {_uniqueStorage()._operation = .allowValues(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -130,26 +97,11 @@ public struct Blaze_InvocationPolicy_FlagPolicy { #if !swift(>=4.1) public static func ==(lhs: Blaze_InvocationPolicy_FlagPolicy.OneOf_Operation, rhs: Blaze_InvocationPolicy_FlagPolicy.OneOf_Operation) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.setValue, .setValue): return { - guard case .setValue(let l) = lhs, case .setValue(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.useDefault, .useDefault): return { - guard case .useDefault(let l) = lhs, case .useDefault(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.disallowValues, .disallowValues): return { - guard case .disallowValues(let l) = lhs, case .disallowValues(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.allowValues, .allowValues): return { - guard case .allowValues(let l) = lhs, case .allowValues(let r) = rhs else { preconditionFailure() } - return l == r - }() + case (.setValue(let l), .setValue(let r)): return l == r + case (.useDefault(let l), .useDefault(let r)): return l == r + case (.disallowValues(let l), .disallowValues(let r)): return l == r + case (.allowValues(let l), .allowValues(let r)): return l == r default: return false } } @@ -158,7 +110,7 @@ public struct Blaze_InvocationPolicy_FlagPolicy { public init() {} - fileprivate var _flagName: String? = nil + fileprivate var _storage = _StorageClass.defaultInstance } public struct Blaze_InvocationPolicy_SetValue { @@ -166,49 +118,8 @@ public struct Blaze_InvocationPolicy_SetValue { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// Use this value for the specified flag, overriding any default or user-set - /// value (unless append is set to true for repeatable flags). - /// - /// This field is repeated for repeatable flags. It is an error to set - /// multiple values for a flag that is not actually a repeatable flag. - /// This requires at least 1 value, if even the empty string. - /// - /// If the flag allows multiple values, all of its values are replaced with the - /// value or values from the policy (i.e., no diffing or merging is performed), - /// unless the append field (see below) is set to true. - /// - /// Note that some flags are tricky. For example, some flags look like boolean - /// flags, but are actually Void expansion flags that expand into other flags. - /// The Bazel flag parser will accept "--void_flag=false", but because - /// the flag is Void, the "=false" is ignored. It can get even trickier, like - /// "--novoid_flag" which is also an expansion flag with the type Void whose - /// name is explicitly "novoid_flag" and which expands into other flags that - /// are the opposite of "--void_flag". For expansion flags, it's best to - /// explicitly override the flags they expand into. - /// - /// Other flags may be differently tricky: A flag could have a converter that - /// converts some string to a list of values, but that flag may not itself have - /// allowMultiple set to true. - /// - /// An example is "--test_tag_filters": this flag sets its converter to - /// CommaSeparatedOptionListConverter, but does not set allowMultiple to true. - /// So "--test_tag_filters=foo,bar" results in ["foo", "bar"], however - /// "--test_tag_filters=foo --test_tag_filters=bar" results in just ["bar"] - /// since the 2nd value overrides the 1st. - /// - /// Similarly, "--test_tag_filters=foo,bar --test_tag_filters=baz,qux" results - /// in ["baz", "qux"]. For flags like these, the policy should specify - /// "foo,bar" instead of separately specifying "foo" and "bar" so that the - /// converter is appropriately invoked. - /// - /// Note that the opposite is not necessarily - /// true: for a flag that specifies allowMultiple=true, "--flag=foo,bar" - /// may fail to parse or result in an unexpected value. public var flagValue: [String] = [] - /// Whether to allow this policy to be overridden by user-specified values. - /// When set, if the user specified a value for this flag, use the value - /// from the user, otherwise use the value specified in this policy. public var overridable: Bool { get {return _overridable ?? false} set {_overridable = newValue} @@ -218,10 +129,6 @@ public struct Blaze_InvocationPolicy_SetValue { /// Clears the value of `overridable`. Subsequent reads from it will return its default value. public mutating func clearOverridable() {self._overridable = nil} - /// If true, and if the flag named in the policy is a repeatable flag, then - /// the values listed in flag_value do not replace all the user-set or default - /// values of the flag, but instead append to them. If the flag is not - /// repeatable, then this has no effect. public var append: Bool { get {return _append ?? false} set {_append = newValue} @@ -239,17 +146,6 @@ public struct Blaze_InvocationPolicy_SetValue { fileprivate var _append: Bool? = nil } -/// Use the default value of the flag, as defined by Bazel (or equivalently, do -/// not allow the user to set this flag). -/// -/// Note on implementation: UseDefault sets the default by clearing the flag, -/// so that when the value is requested and no flag is found, the flag parser -/// returns the default. This is mostly relevant for expansion flags: it will -/// erase user values in *all* flags that the expansion flag expands to. Only -/// use this on expansion flags if this is acceptable behavior. Since the last -/// policy wins, later policies on this same flag will still remove the -/// expanded UseDefault, so there is a way around, but it's really best not to -/// use this on expansion flags at all. public struct Blaze_InvocationPolicy_UseDefault { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -265,81 +161,43 @@ public struct Blaze_InvocationPolicy_DisallowValues { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// It is an error for the user to use any of these values (that is, the Bazel - /// command will fail), unless new_value or use_default is set. - /// - /// For repeatable flags, if any one of the values in the flag matches a value - /// in the list of disallowed values, an error is thrown. - /// - /// Care must be taken for flags with complicated converters. For example, - /// it's possible for a repeated flag to be of type List>, so that - /// "--foo=a,b --foo=c,d" results in foo=[["a","b"], ["c", "d"]]. In this case, - /// it is not possible to disallow just "b", nor will ["b", "a"] match, nor - /// will ["b", "c"] (but ["a", "b"] will still match). - public var disallowedValues: [String] = [] - - public var replacementValue: Blaze_InvocationPolicy_DisallowValues.OneOf_ReplacementValue? = nil - - /// If set and if the value of the flag is disallowed (including the default - /// value of the flag if the user doesn't specify a value), use this value as - /// the value of the flag instead of raising an error. This does not apply to - /// repeatable flags and is ignored if the flag is a repeatable flag. + public var disallowedValues: [String] { + get {return _storage._disallowedValues} + set {_uniqueStorage()._disallowedValues = newValue} + } + + public var replacementValue: OneOf_ReplacementValue? { + get {return _storage._replacementValue} + set {_uniqueStorage()._replacementValue = newValue} + } + public var newValue: String { get { - if case .newValue(let v)? = replacementValue {return v} + if case .newValue(let v)? = _storage._replacementValue {return v} return String() } - set {replacementValue = .newValue(newValue)} + set {_uniqueStorage()._replacementValue = .newValue(newValue)} } - /// If set and if the value of the flag is disallowed, use the default value - /// of the flag instead of raising an error. Unlike new_value, this works for - /// repeatable flags, but note that the default value for repeatable flags is - /// always empty. - /// - /// Note that it is an error to disallow the default value of the flag and - /// to set use_default, unless the flag is a repeatable flag where the - /// default value is always the empty list. public var useDefault: Blaze_InvocationPolicy_UseDefault { get { - if case .useDefault(let v)? = replacementValue {return v} + if case .useDefault(let v)? = _storage._replacementValue {return v} return Blaze_InvocationPolicy_UseDefault() } - set {replacementValue = .useDefault(newValue)} + set {_uniqueStorage()._replacementValue = .useDefault(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_ReplacementValue: Equatable { - /// If set and if the value of the flag is disallowed (including the default - /// value of the flag if the user doesn't specify a value), use this value as - /// the value of the flag instead of raising an error. This does not apply to - /// repeatable flags and is ignored if the flag is a repeatable flag. case newValue(String) - /// If set and if the value of the flag is disallowed, use the default value - /// of the flag instead of raising an error. Unlike new_value, this works for - /// repeatable flags, but note that the default value for repeatable flags is - /// always empty. - /// - /// Note that it is an error to disallow the default value of the flag and - /// to set use_default, unless the flag is a repeatable flag where the - /// default value is always the empty list. case useDefault(Blaze_InvocationPolicy_UseDefault) #if !swift(>=4.1) public static func ==(lhs: Blaze_InvocationPolicy_DisallowValues.OneOf_ReplacementValue, rhs: Blaze_InvocationPolicy_DisallowValues.OneOf_ReplacementValue) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.newValue, .newValue): return { - guard case .newValue(let l) = lhs, case .newValue(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.useDefault, .useDefault): return { - guard case .useDefault(let l) = lhs, case .useDefault(let r) = rhs else { preconditionFailure() } - return l == r - }() + case (.newValue(let l), .newValue(let r)): return l == r + case (.useDefault(let l), .useDefault(let r)): return l == r default: return false } } @@ -347,6 +205,8 @@ public struct Blaze_InvocationPolicy_DisallowValues { } public init() {} + + fileprivate var _storage = _StorageClass.defaultInstance } public struct Blaze_InvocationPolicy_AllowValues { @@ -354,72 +214,43 @@ public struct Blaze_InvocationPolicy_AllowValues { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// It is an error for the user to use any value not in this list, unless - /// new_value or use_default is set. - public var allowedValues: [String] = [] + public var allowedValues: [String] { + get {return _storage._allowedValues} + set {_uniqueStorage()._allowedValues = newValue} + } - public var replacementValue: Blaze_InvocationPolicy_AllowValues.OneOf_ReplacementValue? = nil + public var replacementValue: OneOf_ReplacementValue? { + get {return _storage._replacementValue} + set {_uniqueStorage()._replacementValue = newValue} + } - /// If set and if the value of the flag is disallowed (including the default - /// value of the flag if the user doesn't specify a value), use this value as - /// the value of the flag instead of raising an error. This does not apply to - /// repeatable flags and is ignored if the flag is a repeatable flag. public var newValue: String { get { - if case .newValue(let v)? = replacementValue {return v} + if case .newValue(let v)? = _storage._replacementValue {return v} return String() } - set {replacementValue = .newValue(newValue)} + set {_uniqueStorage()._replacementValue = .newValue(newValue)} } - /// If set and if the value of the flag is disallowed, use the default value - /// of the flag instead of raising an error. Unlike new_value, this works for - /// repeatable flags, but note that the default value for repeatable flags is - /// always empty. - /// - /// Note that it is an error to disallow the default value of the flag and - /// to set use_default, unless the flag is a repeatable flag where the - /// default value is always the empty list. public var useDefault: Blaze_InvocationPolicy_UseDefault { get { - if case .useDefault(let v)? = replacementValue {return v} + if case .useDefault(let v)? = _storage._replacementValue {return v} return Blaze_InvocationPolicy_UseDefault() } - set {replacementValue = .useDefault(newValue)} + set {_uniqueStorage()._replacementValue = .useDefault(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_ReplacementValue: Equatable { - /// If set and if the value of the flag is disallowed (including the default - /// value of the flag if the user doesn't specify a value), use this value as - /// the value of the flag instead of raising an error. This does not apply to - /// repeatable flags and is ignored if the flag is a repeatable flag. case newValue(String) - /// If set and if the value of the flag is disallowed, use the default value - /// of the flag instead of raising an error. Unlike new_value, this works for - /// repeatable flags, but note that the default value for repeatable flags is - /// always empty. - /// - /// Note that it is an error to disallow the default value of the flag and - /// to set use_default, unless the flag is a repeatable flag where the - /// default value is always the empty list. case useDefault(Blaze_InvocationPolicy_UseDefault) #if !swift(>=4.1) public static func ==(lhs: Blaze_InvocationPolicy_AllowValues.OneOf_ReplacementValue, rhs: Blaze_InvocationPolicy_AllowValues.OneOf_ReplacementValue) -> Bool { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.newValue, .newValue): return { - guard case .newValue(let l) = lhs, case .newValue(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.useDefault, .useDefault): return { - guard case .useDefault(let l) = lhs, case .useDefault(let r) = rhs else { preconditionFailure() } - return l == r - }() + case (.newValue(let l), .newValue(let r)): return l == r + case (.useDefault(let l), .useDefault(let r)): return l == r default: return false } } @@ -427,6 +258,8 @@ public struct Blaze_InvocationPolicy_AllowValues { } public init() {} + + fileprivate var _storage = _StorageClass.defaultInstance } // MARK: - Code below here is support for the SwiftProtobuf runtime. @@ -441,11 +274,8 @@ extension Blaze_InvocationPolicy_InvocationPolicy: SwiftProtobuf.Message, SwiftP public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.flagPolicies) }() + case 1: try decoder.decodeRepeatedMessageField(value: &self.flagPolicies) default: break } } @@ -476,108 +306,109 @@ extension Blaze_InvocationPolicy_FlagPolicy: SwiftProtobuf.Message, SwiftProtobu 6: .standard(proto: "allow_values"), ] + fileprivate class _StorageClass { + var _flagName: String? = nil + var _commands: [String] = [] + var _operation: Blaze_InvocationPolicy_FlagPolicy.OneOf_Operation? + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _flagName = source._flagName + _commands = source._commands + _operation = source._operation + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self._flagName) }() - case 2: try { try decoder.decodeRepeatedStringField(value: &self.commands) }() - case 3: try { - var v: Blaze_InvocationPolicy_SetValue? - var hadOneofValue = false - if let current = self.operation { - hadOneofValue = true - if case .setValue(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.operation = .setValue(v) - } - }() - case 4: try { - var v: Blaze_InvocationPolicy_UseDefault? - var hadOneofValue = false - if let current = self.operation { - hadOneofValue = true - if case .useDefault(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.operation = .useDefault(v) - } - }() - case 5: try { - var v: Blaze_InvocationPolicy_DisallowValues? - var hadOneofValue = false - if let current = self.operation { - hadOneofValue = true - if case .disallowValues(let m) = current {v = m} + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeSingularStringField(value: &_storage._flagName) + case 2: try decoder.decodeRepeatedStringField(value: &_storage._commands) + case 3: + var v: Blaze_InvocationPolicy_SetValue? + if let current = _storage._operation { + try decoder.handleConflictingOneOf() + if case .setValue(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._operation = .setValue(v)} + case 4: + var v: Blaze_InvocationPolicy_UseDefault? + if let current = _storage._operation { + try decoder.handleConflictingOneOf() + if case .useDefault(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._operation = .useDefault(v)} + case 5: + var v: Blaze_InvocationPolicy_DisallowValues? + if let current = _storage._operation { + try decoder.handleConflictingOneOf() + if case .disallowValues(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._operation = .disallowValues(v)} + case 6: + var v: Blaze_InvocationPolicy_AllowValues? + if let current = _storage._operation { + try decoder.handleConflictingOneOf() + if case .allowValues(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._operation = .allowValues(v)} + default: break } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.operation = .disallowValues(v) - } - }() - case 6: try { - var v: Blaze_InvocationPolicy_AllowValues? - var hadOneofValue = false - if let current = self.operation { - hadOneofValue = true - if case .allowValues(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.operation = .allowValues(v) - } - }() - default: break } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._flagName { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } }() - if !self.commands.isEmpty { - try visitor.visitRepeatedStringField(value: self.commands, fieldNumber: 2) - } - switch self.operation { - case .setValue?: try { - guard case .setValue(let v)? = self.operation else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .useDefault?: try { - guard case .useDefault(let v)? = self.operation else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case .disallowValues?: try { - guard case .disallowValues(let v)? = self.operation else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - }() - case .allowValues?: try { - guard case .allowValues(let v)? = self.operation else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - }() - case nil: break + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if let v = _storage._flagName { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } + if !_storage._commands.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._commands, fieldNumber: 2) + } + switch _storage._operation { + case .setValue(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + case .useDefault(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + case .disallowValues(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + case .allowValues(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + case nil: break + } } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Blaze_InvocationPolicy_FlagPolicy, rhs: Blaze_InvocationPolicy_FlagPolicy) -> Bool { - if lhs._flagName != rhs._flagName {return false} - if lhs.commands != rhs.commands {return false} - if lhs.operation != rhs.operation {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._flagName != rhs_storage._flagName {return false} + if _storage._commands != rhs_storage._commands {return false} + if _storage._operation != rhs_storage._operation {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -593,32 +424,25 @@ extension Blaze_InvocationPolicy_SetValue: SwiftProtobuf.Message, SwiftProtobuf. public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.flagValue) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self._overridable) }() - case 3: try { try decoder.decodeSingularBoolField(value: &self._append) }() + case 1: try decoder.decodeRepeatedStringField(value: &self.flagValue) + case 2: try decoder.decodeSingularBoolField(value: &self._overridable) + case 3: try decoder.decodeSingularBoolField(value: &self._append) default: break } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 if !self.flagValue.isEmpty { try visitor.visitRepeatedStringField(value: self.flagValue, fieldNumber: 1) } - try { if let v = self._overridable { + if let v = self._overridable { try visitor.visitSingularBoolField(value: v, fieldNumber: 2) - } }() - try { if let v = self._append { + } + if let v = self._append { try visitor.visitSingularBoolField(value: v, fieldNumber: 3) - } }() + } try unknownFields.traverse(visitor: &visitor) } @@ -658,64 +482,79 @@ extension Blaze_InvocationPolicy_DisallowValues: SwiftProtobuf.Message, SwiftPro 4: .standard(proto: "use_default"), ] + fileprivate class _StorageClass { + var _disallowedValues: [String] = [] + var _replacementValue: Blaze_InvocationPolicy_DisallowValues.OneOf_ReplacementValue? + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _disallowedValues = source._disallowedValues + _replacementValue = source._replacementValue + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.disallowedValues) }() - case 3: try { - var v: String? - try decoder.decodeSingularStringField(value: &v) - if let v = v { - if self.replacementValue != nil {try decoder.handleConflictingOneOf()} - self.replacementValue = .newValue(v) - } - }() - case 4: try { - var v: Blaze_InvocationPolicy_UseDefault? - var hadOneofValue = false - if let current = self.replacementValue { - hadOneofValue = true - if case .useDefault(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.replacementValue = .useDefault(v) + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeRepeatedStringField(value: &_storage._disallowedValues) + case 3: + if _storage._replacementValue != nil {try decoder.handleConflictingOneOf()} + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v {_storage._replacementValue = .newValue(v)} + case 4: + var v: Blaze_InvocationPolicy_UseDefault? + if let current = _storage._replacementValue { + try decoder.handleConflictingOneOf() + if case .useDefault(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._replacementValue = .useDefault(v)} + default: break } - }() - default: break } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.disallowedValues.isEmpty { - try visitor.visitRepeatedStringField(value: self.disallowedValues, fieldNumber: 1) - } - switch self.replacementValue { - case .newValue?: try { - guard case .newValue(let v)? = self.replacementValue else { preconditionFailure() } - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - }() - case .useDefault?: try { - guard case .useDefault(let v)? = self.replacementValue else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case nil: break + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._disallowedValues.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._disallowedValues, fieldNumber: 1) + } + switch _storage._replacementValue { + case .newValue(let v)?: + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + case .useDefault(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + case nil: break + } } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Blaze_InvocationPolicy_DisallowValues, rhs: Blaze_InvocationPolicy_DisallowValues) -> Bool { - if lhs.disallowedValues != rhs.disallowedValues {return false} - if lhs.replacementValue != rhs.replacementValue {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._disallowedValues != rhs_storage._disallowedValues {return false} + if _storage._replacementValue != rhs_storage._replacementValue {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -729,64 +568,79 @@ extension Blaze_InvocationPolicy_AllowValues: SwiftProtobuf.Message, SwiftProtob 4: .standard(proto: "use_default"), ] + fileprivate class _StorageClass { + var _allowedValues: [String] = [] + var _replacementValue: Blaze_InvocationPolicy_AllowValues.OneOf_ReplacementValue? + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _allowedValues = source._allowedValues + _replacementValue = source._replacementValue + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.allowedValues) }() - case 3: try { - var v: String? - try decoder.decodeSingularStringField(value: &v) - if let v = v { - if self.replacementValue != nil {try decoder.handleConflictingOneOf()} - self.replacementValue = .newValue(v) - } - }() - case 4: try { - var v: Blaze_InvocationPolicy_UseDefault? - var hadOneofValue = false - if let current = self.replacementValue { - hadOneofValue = true - if case .useDefault(let m) = current {v = m} + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + switch fieldNumber { + case 1: try decoder.decodeRepeatedStringField(value: &_storage._allowedValues) + case 3: + if _storage._replacementValue != nil {try decoder.handleConflictingOneOf()} + var v: String? + try decoder.decodeSingularStringField(value: &v) + if let v = v {_storage._replacementValue = .newValue(v)} + case 4: + var v: Blaze_InvocationPolicy_UseDefault? + if let current = _storage._replacementValue { + try decoder.handleConflictingOneOf() + if case .useDefault(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v {_storage._replacementValue = .useDefault(v)} + default: break } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.replacementValue = .useDefault(v) - } - }() - default: break } } } public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.allowedValues.isEmpty { - try visitor.visitRepeatedStringField(value: self.allowedValues, fieldNumber: 1) - } - switch self.replacementValue { - case .newValue?: try { - guard case .newValue(let v)? = self.replacementValue else { preconditionFailure() } - try visitor.visitSingularStringField(value: v, fieldNumber: 3) - }() - case .useDefault?: try { - guard case .useDefault(let v)? = self.replacementValue else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case nil: break + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + if !_storage._allowedValues.isEmpty { + try visitor.visitRepeatedStringField(value: _storage._allowedValues, fieldNumber: 1) + } + switch _storage._replacementValue { + case .newValue(let v)?: + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + case .useDefault(let v)?: + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + case nil: break + } } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Blaze_InvocationPolicy_AllowValues, rhs: Blaze_InvocationPolicy_AllowValues) -> Bool { - if lhs.allowedValues != rhs.allowedValues {return false} - if lhs.replacementValue != rhs.replacementValue {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._allowedValues != rhs_storage._allowedValues {return false} + if _storage._replacementValue != rhs_storage._replacementValue {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/option_filters.pb.swift b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/option_filters.pb.swift old mode 100644 new mode 100755 index 2c14f3b..ce267d7 --- a/Examples/BazelXCBBuildService/BEP/src/main/protobuf/option_filters.pb.swift +++ b/Examples/BazelXCBBuildService/BEP/src/main/protobuf/option_filters.pb.swift @@ -1,5 +1,4 @@ // DO NOT EDIT. -// swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: src/main/protobuf/option_filters.proto @@ -7,41 +6,22 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ -/// Copyright 2017 The Bazel Authors. All rights reserved. -/// -/// Licensed under the Apache License, Version 2.0 (the "License"); -/// you may not use this file except in compliance with the License. -/// You may obtain a copy of the License at -/// -/// http://www.apache.org/licenses/LICENSE-2.0 -/// -/// Unless required by applicable law or agreed to in writing, software -/// distributed under the License is distributed on an "AS IS" BASIS, -/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -/// See the License for the specific language governing permissions and -/// limitations under the License. - import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API +// Please ensure that your are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } -/// Docs in java enum. public enum Options_OptionEffectTag: SwiftProtobuf.Enum { public typealias RawValue = Int - - /// This option's effect or intent is unknown. case unknown // = 0 - - /// This flag has literally no effect. case noOp // = 1 case losesIncrementalState // = 2 case changesInputs // = 3 @@ -131,7 +111,6 @@ extension Options_OptionEffectTag: CaseIterable { #endif // swift(>=4.2) -/// Docs in java enum. public enum Options_OptionMetadataTag: SwiftProtobuf.Enum { public typealias RawValue = Int case experimental // = 0 diff --git a/Examples/BazelXCBBuildService/Package.resolved b/Examples/BazelXCBBuildService/Package.resolved index 5eb8dcb..1700e65 100644 --- a/Examples/BazelXCBBuildService/Package.resolved +++ b/Examples/BazelXCBBuildService/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/apple/swift-log.git", "state": { "branch": null, - "revision": "5d66f7ba25daf4f94100e7022febf3c75e37a6c7", - "version": "1.4.2" + "revision": "74d7b91ceebc85daf387ebb206003f78813f71aa", + "version": "1.2.0" } }, { @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/apple/swift-nio.git", "state": { "branch": null, - "revision": "6aa9347d9bc5bbfe6a84983aec955c17ffea96ef", - "version": "2.33.0" + "revision": "c5fa0b456524cd73dc3ddbb263d4f46c20b86ca3", + "version": "2.17.0" } }, { diff --git a/Examples/BazelXCBBuildService/Package.swift b/Examples/BazelXCBBuildService/Package.swift index e52c3e3..956ca6d 100644 --- a/Examples/BazelXCBBuildService/Package.swift +++ b/Examples/BazelXCBBuildService/Package.swift @@ -13,8 +13,8 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/apple/swift-log.git", from: "1.4.2"), - .package(url: "https://github.com/apple/swift-nio.git", from: "2.33.0"), + .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"), + .package(url: "https://github.com/apple/swift-nio.git", from: "2.17.0"), .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.9.0"), // XCBBuildServiceProxy lives up two levels from here .package(path: "../../"), diff --git a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift index 40de7e2..1e9c678 100644 --- a/Examples/BazelXCBBuildService/Sources/RequestHandler.swift +++ b/Examples/BazelXCBBuildService/Sources/RequestHandler.swift @@ -144,11 +144,10 @@ final class RequestHandler: HybridXCBBuildServiceRequestHandler { let session = message.sessionHandle // Reset in case we decide not to build - sessionBazelBuilds[session]?.cancel() sessionBazelBuilds[session] = nil handleBazelTargets(session: session) { baseEnvironment, bazelTargets, xcodeBuildVersion in - logger.trace("Parsed targets for BazelXCBBuildService: \(bazelTargets.map { $1.name })") + logger.trace("Parsed targets for BazelXCBBuildService: \(bazelTargets)") var desiredTargets: [BazelBuild.Target] = [] for target in message.buildRequest.configuredTargets { diff --git a/Examples/WORKSPACE b/Examples/WORKSPACE index 9c79a55..dc967d2 100644 --- a/Examples/WORKSPACE +++ b/Examples/WORKSPACE @@ -6,20 +6,20 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_apple_support", - sha256 = "76df040ade90836ff5543888d64616e7ba6c3a7b33b916aa3a4b68f342d1b447", - url = "https://github.com/bazelbuild/apple_support/releases/download/0.11.0/apple_support.0.11.0.tar.gz", + sha256 = "36d60bce680446ab534b141c47f2aef6b9c598267ef3450b7d74b9d81e1fd6bd", + url = "https://github.com/bazelbuild/apple_support/releases/download/0.9.0/apple_support.0.9.0.tar.gz", ) http_archive( name = "build_bazel_rules_apple", - sha256 = "0052d452af7742c8f3a4e0929763388a66403de363775db7e90adecb2ba4944b", - url = "https://github.com/bazelbuild/rules_apple/releases/download/0.31.3/rules_apple.0.31.3.tar.gz", + sha256 = "55f4dc1c9bf21bb87442665f4618cff1f1343537a2bd89252078b987dcd9c382", + url = "https://github.com/bazelbuild/rules_apple/releases/download/0.20.0/rules_apple.0.20.0.tar.gz", ) http_archive( name = "build_bazel_rules_swift", - sha256 = "653e8756001616500b110fd156694de7899278bb7480aba22b2f156438a1d810", - url = "https://github.com/bazelbuild/rules_swift/releases/download/0.22.0/rules_swift.0.22.0.tar.gz", + sha256 = "d2f38c33dc82cf3160c59342203d31a030e53ebe8f4c7365add7a549223f9c62", + url = "https://github.com/bazelbuild/rules_swift/releases/download/0.15.0/rules_swift.0.15.0.tar.gz", ) load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") diff --git a/Package.swift b/Package.swift index 2a1650a..f7f4d69 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,7 @@ let package = Package( dependencies: [ // Make sure to update the versions used in the `repositories.bzl` file if you change them here .package(url: "https://github.com/apple/swift-log", .exact("1.4.2")), - .package(url: "https://github.com/apple/swift-nio", .exact("2.33.0")), + .package(url: "https://github.com/apple/swift-nio", .exact("2.30.0")), ], targets: [ .target( diff --git a/external/com_github_apple_swift_nio.BUILD b/external/com_github_apple_swift_nio.BUILD index 5bdefad..e87c71d 100644 --- a/external/com_github_apple_swift_nio.BUILD +++ b/external/com_github_apple_swift_nio.BUILD @@ -10,40 +10,6 @@ swift_library( ":CNIODarwin", ":CNIOLinux", ":NIOConcurrencyHelpers", - ":NIOCore", - ":NIOEmbedded", - ":NIOPosix", - ], -) - -swift_library( - name = "NIOEmbedded", - srcs = glob(["Sources/NIOEmbedded/**/*.swift"]), - deps = [ - ":_NIODataStructures", - ":NIOCore", - ], -) - -swift_library( - name = "_NIODataStructures", - srcs = glob(["Sources/_NIODataStructures/**/*.swift"]), - deps = [], -) - -swift_library( - name = "NIOPosix", - srcs = glob(["Sources/NIOPosix/**/*.swift"]), - deps = [ - ":NIOCore", - ], -) - -swift_library( - name = "NIOCore", - srcs = glob(["Sources/NIOCore/**/*.swift"]), - deps = [ - ":NIOConcurrencyHelpers", ], ) @@ -78,7 +44,6 @@ objc_library( "Sources/CNIODarwin/include/**/*.h", ]), includes = ["Sources/CNIODarwin/include"], - defines = ["__APPLE_USE_RFC_3542"], ) objc_library( diff --git a/repositories.bzl b/repositories.bzl index 8f72301..2a19e49 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -22,9 +22,9 @@ def xcbbuildserviceproxy_dependencies(): http_archive, build_file = "@com_github_target_xcbbuildserviceproxy//:external/com_github_apple_swift_nio.BUILD", name = "com_github_apple_swift_nio", - sha256 = "4a654952046a46ad8f09d359e6c02e7fa04ab09f492ae35f5d6d7c769f3f008a", - strip_prefix = "swift-nio-2.33.0", + sha256 = "40b115e77e8af3ffbe84be344c30c0964763e318e1d3dfe0a80da0e2ae17d614", + strip_prefix = "swift-nio-2.30.0", urls = [ - "https://github.com/apple/swift-nio/archive/2.33.0.tar.gz", + "https://github.com/apple/swift-nio/archive/2.30.0.tar.gz", ], )