Skip to content

Commit

Permalink
downgrade swift protobuf to 1.26
Browse files Browse the repository at this point in the history
  • Loading branch information
li-feng-sc committed Aug 13, 2024
1 parent 252271d commit a237529
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bzl/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ def djinni_deps():
url = "https://github.com/bazelbuild/rules_jvm_external/archive/{}.zip".format(rules_jvm_external_tag),
sha256 = "62133c125bf4109dfd9d2af64830208356ce4ef8b165a6ef15bbff7460b35c3a",
)
swiftprotobuf_version = "1.27.0"
swiftprotobuf_version = "1.26.0"
maybe(
name = "apple_swift_protobuf",
repo_rule = http_archive,
url = "https://github.com/apple/swift-protobuf/archive/refs/tags/{}.tar.gz".format(swiftprotobuf_version),
strip_prefix = "swift-protobuf-{}".format(swiftprotobuf_version),
sha256 = "387ab60f4814e76ed3ae689690c658cf6dab1bc1c6ed67d6c14c33de9daed4d2",
sha256 = "25224376205a54bb719fe7d97aeb9d8f5219c7ef668f426a5dab2da7db992842",
build_file_content = """
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
swift_library(
Expand Down
4 changes: 2 additions & 2 deletions support-lib/swift/DJProtobuf.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ public enum ProtobufMarshaller<T: SwiftProtobuf.Message>: Marshaller {
let range = djinni.swift.getBinaryRange(v)
if (range.size > 0) {
let bin = Data(bytesNoCopy:UnsafeMutableRawPointer(mutating: range.bytes), count:range.size, deallocator:.none)
return try! T(serializedBytes: bin)
return try! T(serializedData: bin)
} else {
return T()
}
}
static public func toCpp(_ s: SwiftType) -> djinni.swift.AnyValue {
let bin: Data = try! s.serializedBytes()
let bin: Data = try! s.serializedData()
return BinaryMarshaller.toCpp(bin)
}
}
2 changes: 1 addition & 1 deletion test-suite/handwritten-src/swift/ProtoTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class ProtoTest: XCTestCase {

func testZeroSizeNativeToSwift() throws {
let proto = try ProtoTests_statics.stringsToProto([])
let serialized: Data = try proto.serializedBytes()
let serialized: Data = try proto.serializedData()
XCTAssertEqual(serialized.count, 0)
}

Expand Down

0 comments on commit a237529

Please sign in to comment.