profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/tbkka/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

tbkka/llvm-project 0

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Note: the repository does not accept github pull requests at this moment. Please submit your patches at http://reviews.llvm.org.

tbkka/protobuf 0

Protocol Buffers - Google's data interchange format

tbkka/swift 0

The Swift Programming Language

tbkka/swift-corelibs-foundation 0

The Foundation Project, providing core utilities, internationalization, and OS independence

tbkka/swift-llbuild 0

A low-level build system, used by Xcode and the Swift Package Manager

tbkka/swift-protobuf 0

Plugin and runtime library for using protobuf with Swift

issue closedapple/swift-protobuf

rpc service custom method options are not parsed ?

Before opening a new issue, please double check the past issues (both open and closed ones) to see if your problem has been discussed before and already contains an answer/solution. Likewise, check the FAQ in the Documentation folder for some common things - https://github.com/apple/swift-protobuf/blob/master/Documentation/FAQ.md

Please be sure to include:

  • what OS you are developing on (Linux or macOS, including the version) MacOS

  • for macOS, what version of Xcode you are using (xcodebuild -version), for Linux, what version of Swift (swift --version) Xcode 12.4 Build version 12D4e

  • what version of Swift is your code set to compile with (i.e. from project settings, etc.) Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) Target: x86_64-apple-darwin20.3.0

  • what branch/tag of SwiftProtobuf you are using (1.0.0, etc.)

1.16.0

  • if you are getting compile errors, please be sure include all errors/warnings, sometimes the error before the one you are stuck on is important.

  • lastly, if it all possible, provide a snippet of .proto and/or source that shows the problem. when I use

let option = MessageExtension<OptionalExtensionField<ProtobufString>, SwiftProtobuf.Google_Protobuf_MethodOptions>.init(_protobuf_fieldNumber: 50505, fieldName: "serializer")
let value = methodDescriptor.proto.options.getExtensionValue(ext: option)

to get the value of the option, I get nil.

// file 1

syntax = "proto2";

package a.b.c;

service example_service {

rpc some_api (some_request) returns (some_response) {
    option (api.serializer) = "json";
  }
}

// file2

syntax = "proto2";

package api;

import "google/protobuf/descriptor.proto";

extend google.protobuf.MethodOptions {
  optional string serializer = 50505;
}

Thank you!

closed time in 7 hours

chenwu054

issue openedapple/swift-protobuf

rpc service custom method options are not parsed ?

Before opening a new issue, please double check the past issues (both open and closed ones) to see if your problem has been discussed before and already contains an answer/solution. Likewise, check the FAQ in the Documentation folder for some common things - https://github.com/apple/swift-protobuf/blob/master/Documentation/FAQ.md

Please be sure to include:

  • what OS you are developing on (Linux or macOS, including the version) MacOS

  • for macOS, what version of Xcode you are using (xcodebuild -version), for Linux, what version of Swift (swift --version) Xcode 12.4 Build version 12D4e

  • what version of Swift is your code set to compile with (i.e. from project settings, etc.) Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) Target: x86_64-apple-darwin20.3.0

  • what branch/tag of SwiftProtobuf you are using (1.0.0, etc.)

  • if you are getting compile errors, please be sure include all errors/warnings, sometimes the error before the one you are stuck on is important.

  • lastly, if it all possible, provide a snippet of .proto and/or source that shows the problem. // file 1 syntax = "proto2"; package a.b.c; service example_service { rpc some_api (some_request) returns (some_response) { option (api.serializer) = "json"; } } // file2 syntax = "proto2"; package api; import "google/protobuf/descriptor.proto"; extend google.protobuf.MethodOptions { optional string serializer = 50505; }

Thank you!

created time in 10 hours

issue commentapple/swift-protobuf

Recommendations for test helpers to compare outputs?

Thanks for the info! Should I keep this open as a feature request?

MrMage

comment created time in 21 hours

issue commentapple/swift-protobuf

Recommendations for test helpers to compare outputs?

We don't currently have any api for recursively comparing messages.

The Visitor interface isn't really going to work for this since it gets called by the message as it walks the field, so it wouldn't be able to walk two messages in parallel to compare things. You might be able to build something for it, but you'd have to build up some sorta journal from the walk, and then walk the second message and try to compare against the journal.

MrMage

comment created time in a day

issue openedapple/swift-protobuf

Recommendations for test helpers to compare outputs?

In my tests, I often compare the (protobuf message) output of a function with an expected result created via e.g. Message.with { }. However, XCTAssertEqual will output the full string representation of both messages in case of a mismatch, which makes it hard to spot the difference.

Do you have any recommendations on e.g. only outputting the fields that are different? I had a cursory look at this project, but am unsure whether implementing PBTestVisitor is the recommended approach.

created time in a day

push eventapple/swift-protobuf

Thomas Van Lenten

commit sha aa436511a05aa48c6042bbc5d3f4440083b97f6f

Update protos from protocol_buffers/protobuf. Using commit bc45f92262a8e0e6e1ab7302c72a380eb0346f8e

view details

Thomas Van Lenten

commit sha fefa1cdf89e811dfcfa121be86ba4a6a52933f0f

Regenerate the files.

view details

push time in 2 days

PR merged apple/swift-protobuf

Update proto files
+2289 -645

0 comment

19 changed files

thomasvl

pr closed time in 2 days

PR opened apple/swift-protobuf

Update proto files
+2289 -645

0 comment

19 changed files

pr created time in 2 days

push eventapple/swift-protobuf

Thomas Van Lenten

commit sha fbd702d6ed730620a946f667f1f0338d5be4ec8e

Update the generated_swift_names files.

view details

push time in 2 days

push eventapple/swift-protobuf

Thomas Van Lenten

commit sha e571bd9644869775ee4b58aacdf6a9580ee5a19d

Allow proto3_optional for extensions. The discussion for this comes from: https://github.com/protocolbuffers/protobuf/issues/8234#issuecomment-774224376

view details

push time in 2 days

PR merged apple/swift-protobuf

Allow proto3_optional for extensions.

The discussion for this comes from: https://github.com/protocolbuffers/protobuf/issues/8234#issuecomment-774224376

+7 -2

0 comment

1 changed file

thomasvl

pr closed time in 2 days

PR opened apple/swift-protobuf

Update the generated_swift_names files.
+10084 -9676

0 comment

12 changed files

pr created time in 2 days

PR opened apple/swift-protobuf

Allow proto3_optional for extensions.

The discussion for this comes from: https://github.com/protocolbuffers/protobuf/issues/8234#issuecomment-774224376

+7 -2

0 comment

1 changed file

pr created time in 2 days

push eventapple/swift-protobuf

Cory Benfield

commit sha 4f9d97261e9b53615f5ce7599c9ced460c52370f

Add modify operation to ExtensionFieldValueSet. During decoding, modifications are frequently made to the extension values in ExtensionFieldValueSet. In particular for repeated extensions, these modifications include modifications to copy-on-write data types. Because the _modify accessor hasn't been standardised yet, ExtensionFieldValueSet implements get/set only, forcing a modification of existing data to be done by a get/set pair. This will always emit a copy-on-write operation. The result of the above is that decoding repeated extensions is a quadratic operation, making it diabolically slow. oss-fuzz caught this behaviour. This patch adds a non-API modify function to ExtensionFieldValueSet and uses it on all decoding paths. This code simply encapsulates a somewhat delicate function invocation that manages to convince the Swift compiler to use Dictionary's _modify accessor for the underlying operation. The result is that the oss-fuzz sample runtime decreases from 140s to 5s on my machine. This patch will likely have miscellaneous performance improvements across the board. It adds the oss-fuzz case for regression purposes as well.

view details

push time in 2 days

PR merged apple/swift-protobuf

Add modify operation to ExtensionFieldValueSet.

During decoding, modifications are frequently made to the extension values in ExtensionFieldValueSet. In particular for repeated extensions, these modifications include modifications to copy-on-write data types. Because the _modify accessor hasn't been standardised yet, ExtensionFieldValueSet implements get/set only, forcing a modification of existing data to be done by a get/set pair. This will always emit a copy-on-write operation.

The result of the above is that decoding repeated extensions is a quadratic operation, making it diabolically slow. oss-fuzz caught this behaviour.

This patch adds a non-API modify function to ExtensionFieldValueSet and uses it on all decoding paths. This code simply encapsulates a somewhat delicate function invocation that manages to convince the Swift compiler to use Dictionary's _modify accessor for the underlying operation. The result is that the oss-fuzz sample runtime decreases from 140s to 5s on my machine.

This patch will likely have miscellaneous performance improvements across the board. It adds the oss-fuzz case for regression purposes as well.

+32 -35

1 comment

5 changed files

Lukasa

pr closed time in 2 days

pull request commentapple/swift-protobuf

Add modify operation to ExtensionFieldValueSet.

Going ahead and merging, hopefully oss-fuzz will see this today and update accordingly.

Lukasa

comment created time in 2 days

PR opened apple/swift-protobuf

Add modify operation to ExtensionFieldValueSet.

During decoding, modifications are frequently made to the extension values in ExtensionFieldValueSet. In particular for repeated extensions, these modifications include modifications to copy-on-write data types. Because the _modify accessor hasn't been standardised yet, ExtensionFieldValueSet implements get/set only, forcing a modification of existing data to be done by a get/set pair. This will always emit a copy-on-write operation.

The result of the above is that decoding repeated extensions is a quadratic operation, making it diabolically slow. oss-fuzz caught this behaviour.

This patch adds a non-API modify function to ExtensionFieldValueSet and uses it on all decoding paths. This code simply encapsulates a somewhat delicate function invocation that manages to convince the Swift compiler to use Dictionary's _modify accessor for the underlying operation. The result is that the oss-fuzz sample runtime decreases from 140s to 5s on my machine.

This patch will likely have miscellaneous performance improvements across the board. It adds the oss-fuzz case for regression purposes as well.

+32 -35

0 comment

5 changed files

pr created time in 2 days

push eventapple/swift-protobuf

Thomas Van Lenten

commit sha 3a4b54d617ee953a82fbf04405d5d8cf9083f416

Don't walk off the end of the buffer during a unicode bytes decode. Preflight the check instead of checking during the loop (which wasn't advancing).

view details

push time in 3 days

PR merged apple/swift-protobuf

Reviewers
Don't walk off the end of the buffer during a unicode bytes decode.

Preflight the check instead of checking during the loop (which wasn't advancing).

+9 -3

0 comment

3 changed files

thomasvl

pr closed time in 3 days

PR opened apple/swift-protobuf

Reviewers
Don't walk off the end of the buffer during a unicode bytes decode.

Preflight the check instead of checking during the loop (which wasn't advancing).

+9 -3

0 comment

3 changed files

pr created time in 3 days

push eventapple/swift-protobuf

Thomas Van Lenten

commit sha 3811784a98e3d9a33d99c6db4e923fefb532d671

Only trigger conflicting oneof if a value is decoded. This lets things like JSON that can have `null` as the value not count as setting the field and thus not causing the conflict per the new conformance test. Fixes #1133

view details

Thomas Van Lenten

commit sha 7c36b52ca9ad4cb83696c929c7e9ccb610e80561

Update the generated files.

view details

Thomas Van Lenten

commit sha 324f4cbfdf4c11335547696f2f271bae388b0390

Update the generated_swift_names_ files.

view details

push time in 3 days

issue closedapple/swift-protobuf

New conformance test failure

Looks like upstream got a new conformance test around oneofs fields and setting them to null that is failing.

Required.Proto3.JsonInput.OneofFieldNullSecond.JsonOutput
Required.Proto3.JsonInput.OneofFieldNullSecond.ProtobufOutput

closed time in 3 days

thomasvl

pull request commentapple/swift-protobuf

Change oneof enforcement to allow null

Nice! Much simpler than I expected.

Yea, I look a peek thinking I was going to need to track some state in the decoder, but realized a small reordering should be able to do it.

thomasvl

comment created time in 3 days

issue commentapple/swift-protobuf

New conformance test failure

That didn't end up being as bad as I thought, I think that PR does things correctly.

thomasvl

comment created time in 6 days

PR opened apple/swift-protobuf

Reviewers
Change oneof enforcement to allow null
+10460 -9087

0 comment

65 changed files

pr created time in 6 days

issue commentapple/swift-protobuf

New conformance test failure

Ugh, the checks seems to say json can have multiple oneof fields if only one is a non null value. Our current oneof enforcement for json won't work for that.

thomasvl

comment created time in 6 days

issue commentapple/swift-protobuf

New conformance test failure

The new test is in https://github.com/protocolbuffers/protobuf/pull/8502

thomasvl

comment created time in 6 days

push eventapple/swift-protobuf

Thomas Van Lenten

commit sha e4a534ba0691840632a5a6c26aebc3cc7183951b

Document the currently expected failures

view details

push time in 6 days