From a23752908fd7a3924acb5db9e4b68cd877d07ae6 Mon Sep 17 00:00:00 2001
From: Li Feng
Date: Tue, 13 Aug 2024 10:57:52 +1000
Subject: [PATCH] downgrade swift protobuf to 1.26
---
bzl/deps.bzl | 4 ++--
support-lib/swift/DJProtobuf.swift | 4 ++--
test-suite/handwritten-src/swift/ProtoTest.swift | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/bzl/deps.bzl b/bzl/deps.bzl
index 35889a85..722fb3d2 100644
--- a/bzl/deps.bzl
+++ b/bzl/deps.bzl
@@ -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(
diff --git a/support-lib/swift/DJProtobuf.swift b/support-lib/swift/DJProtobuf.swift
index 40ef1994..7019512a 100644
--- a/support-lib/swift/DJProtobuf.swift
+++ b/support-lib/swift/DJProtobuf.swift
@@ -8,13 +8,13 @@ public enum ProtobufMarshaller: 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)
}
}
diff --git a/test-suite/handwritten-src/swift/ProtoTest.swift b/test-suite/handwritten-src/swift/ProtoTest.swift
index 4270fa56..e0b57021 100644
--- a/test-suite/handwritten-src/swift/ProtoTest.swift
+++ b/test-suite/handwritten-src/swift/ProtoTest.swift
@@ -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)
}