Skip to content

Commit

Permalink
Update protobuf for tensorboard that with the newer swift-protobuf.
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliu committed Nov 14, 2024
1 parent d44aeaf commit 3aa53ba
Show file tree
Hide file tree
Showing 34 changed files with 421 additions and 543 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ new_git_repository(
new_git_repository(
name = "SwiftProtobuf",
build_file = "swift-protobuf.BUILD",
commit = "7cbb5279dd7e997c8f0f5537e46d4513be894ff1",
commit = "d57a5aecf24a25b32ec4a74be2f5d0a995a47c4b",
remote = "https://github.com/apple/swift-protobuf.git",
shallow_since = "1658527939 -0700",
shallow_since = "1720448759 -0400",
)

new_git_repository(
Expand Down
4 changes: 2 additions & 2 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ def s4nnc_extra_deps():
new_git_repository,
name = "SwiftProtobuf",
build_file = "@s4nnc//:external/swift-protobuf.BUILD",
commit = "7cbb5279dd7e997c8f0f5537e46d4513be894ff1",
commit = "d57a5aecf24a25b32ec4a74be2f5d0a995a47c4b",
remote = "https://github.com/apple/swift-protobuf.git",
shallow_since = "1658527939 -0700",
shallow_since = "1720448759 -0400",
)

_maybe(
Expand Down
10 changes: 3 additions & 7 deletions tensorboard/proto-generated/allocation_description.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import SwiftProtobuf
// 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 _3: SwiftProtobuf.ProtobufAPIVersion_3 {}
typealias Version = _3
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}

struct Tensorboard_AllocationDescription {
struct Tensorboard_AllocationDescription: Sendable {
// 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.
Expand Down Expand Up @@ -48,10 +48,6 @@ struct Tensorboard_AllocationDescription {
init() {}
}

#if swift(>=5.5) && canImport(_Concurrency)
extension Tensorboard_AllocationDescription: @unchecked Sendable {}
#endif // swift(>=5.5) && canImport(_Concurrency)

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "tensorboard"
Expand Down
26 changes: 9 additions & 17 deletions tensorboard/proto-generated/api_def.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import SwiftProtobuf
// 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 _3: SwiftProtobuf.ProtobufAPIVersion_3 {}
typealias Version = _3
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}

/// Used to specify and override the default API & behavior in the
Expand All @@ -39,7 +39,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
/// you can change the semantics of existing code. These changes may
/// need to wait until a major release of TensorFlow to avoid breaking
/// our compatibility promises.
struct Tensorboard_ApiDef {
struct Tensorboard_ApiDef: Sendable {
// 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.
Expand Down Expand Up @@ -86,7 +86,7 @@ struct Tensorboard_ApiDef {

var unknownFields = SwiftProtobuf.UnknownStorage()

enum Visibility: SwiftProtobuf.Enum {
enum Visibility: SwiftProtobuf.Enum, Swift.CaseIterable {
typealias RawValue = Int

/// Normally this is "VISIBLE" unless you are inheriting a
Expand Down Expand Up @@ -130,7 +130,7 @@ struct Tensorboard_ApiDef {
}

// The compiler won't synthesize support with the UNRECOGNIZED case.
static var allCases: [Tensorboard_ApiDef.Visibility] = [
static let allCases: [Tensorboard_ApiDef.Visibility] = [
.defaultVisibility,
.visible,
.skip,
Expand All @@ -143,7 +143,7 @@ struct Tensorboard_ApiDef {
/// inherited endpoints. The first endpoint should be the
/// "canonical" endpoint, and should not be deprecated (unless all
/// endpoints are deprecated).
struct Endpoint {
struct Endpoint: Sendable {
// 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.
Expand All @@ -168,7 +168,7 @@ struct Tensorboard_ApiDef {
init() {}
}

struct Arg {
struct Arg: Sendable {
// 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.
Expand All @@ -193,7 +193,7 @@ struct Tensorboard_ApiDef {
/// Description of the graph-construction-time configuration of this
/// Op. That is to say, this describes the attr fields that will
/// be specified in the NodeDef.
struct Attr {
struct Attr: Sendable {
// 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.
Expand Down Expand Up @@ -232,7 +232,7 @@ struct Tensorboard_ApiDef {
init() {}
}

struct Tensorboard_ApiDefs {
struct Tensorboard_ApiDefs: Sendable {
// 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.
Expand All @@ -244,14 +244,6 @@ struct Tensorboard_ApiDefs {
init() {}
}

#if swift(>=5.5) && canImport(_Concurrency)
extension Tensorboard_ApiDef: @unchecked Sendable {}
extension Tensorboard_ApiDef.Endpoint: @unchecked Sendable {}
extension Tensorboard_ApiDef.Arg: @unchecked Sendable {}
extension Tensorboard_ApiDef.Attr: @unchecked Sendable {}
extension Tensorboard_ApiDefs: @unchecked Sendable {}
#endif // swift(>=5.5) && canImport(_Concurrency)

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "tensorboard"
Expand Down
19 changes: 6 additions & 13 deletions tensorboard/proto-generated/attr_value.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import SwiftProtobuf
// 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 _3: SwiftProtobuf.ProtobufAPIVersion_3 {}
typealias Version = _3
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}

/// Protocol buffer representing the value for an attr used to configure an Op.
/// Comment indicates the corresponding attr type. Only the field matching the
/// attr type may be filled.
struct Tensorboard_AttrValue {
struct Tensorboard_AttrValue: @unchecked Sendable {
// 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.
Expand Down Expand Up @@ -131,7 +131,7 @@ struct Tensorboard_AttrValue {

var unknownFields = SwiftProtobuf.UnknownStorage()

enum OneOf_Value: Equatable {
enum OneOf_Value: Equatable, @unchecked Sendable {
/// "string"
case s(Data)
/// "int"
Expand Down Expand Up @@ -165,7 +165,7 @@ struct Tensorboard_AttrValue {
}

/// DISABLED.IfChange
struct ListValue {
struct ListValue: @unchecked Sendable {
// 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.
Expand Down Expand Up @@ -204,7 +204,7 @@ struct Tensorboard_AttrValue {

/// A list of attr names and their values. The whole list is attached
/// with a string name. E.g., MatMul[T=float].
struct Tensorboard_NameAttrList {
struct Tensorboard_NameAttrList: Sendable {
// 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.
Expand All @@ -218,13 +218,6 @@ struct Tensorboard_NameAttrList {
init() {}
}

#if swift(>=5.5) && canImport(_Concurrency)
extension Tensorboard_AttrValue: @unchecked Sendable {}
extension Tensorboard_AttrValue.OneOf_Value: @unchecked Sendable {}
extension Tensorboard_AttrValue.ListValue: @unchecked Sendable {}
extension Tensorboard_NameAttrList: @unchecked Sendable {}
#endif // swift(>=5.5) && canImport(_Concurrency)

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "tensorboard"
Expand Down
13 changes: 4 additions & 9 deletions tensorboard/proto-generated/cluster.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ import SwiftProtobuf
// 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 _3: SwiftProtobuf.ProtobufAPIVersion_3 {}
typealias Version = _3
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}

/// Defines a single job in a TensorFlow cluster.
struct Tensorboard_JobDef {
struct Tensorboard_JobDef: Sendable {
// 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.
Expand All @@ -57,7 +57,7 @@ struct Tensorboard_JobDef {
}

/// Defines a TensorFlow cluster as a set of jobs.
struct Tensorboard_ClusterDef {
struct Tensorboard_ClusterDef: Sendable {
// 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.
Expand All @@ -70,11 +70,6 @@ struct Tensorboard_ClusterDef {
init() {}
}

#if swift(>=5.5) && canImport(_Concurrency)
extension Tensorboard_JobDef: @unchecked Sendable {}
extension Tensorboard_ClusterDef: @unchecked Sendable {}
#endif // swift(>=5.5) && canImport(_Concurrency)

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "tensorboard"
Expand Down
Loading

0 comments on commit 3aa53ba

Please sign in to comment.