Implement a new code generator that utilizes google.golang.org/protobuf#91
Implement a new code generator that utilizes google.golang.org/protobuf#91kzys wants to merge 5 commits intocontainerd:mainfrom
Conversation
86d82f7 to
bb30fa5
Compare
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
44de7e4 to
a2db96b
Compare
protobuild is currently not compatible with the latest protoc. Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
Codecov Report
@@ Coverage Diff @@
## main #91 +/- ##
==========================================
+ Coverage 70.75% 73.48% +2.73%
==========================================
Files 11 12 +1
Lines 612 728 +116
==========================================
+ Hits 433 535 +102
- Misses 142 155 +13
- Partials 37 38 +1
Continue to review full report at Codecov.
|
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
| var proto encoding.Codec | ||
|
|
||
| func init() { | ||
| proto = &vtcodec{vt:&vtproto.Codec{}} |
There was a problem hiding this comment.
The vtcodec type is needed to invoke vtprotobuf's marshal/unmarshal code.
| if protoimpl.UnsafeEnabled && x != nil { | ||
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | ||
| if ms.LoadMessageInfo() == nil { | ||
| ms.StoreMessageInfo(mi) |
There was a problem hiding this comment.
I am not sure it matters for ttrpc's use case, but are we going to be taking a performance regression?
There was a problem hiding this comment.
I'm not really sure how that is used. Let me take a look next week.
| func soz(x uint64) (n int) { | ||
| return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) | ||
| } | ||
| func (m *Method1Request) UnmarshalVT(dAtA []byte) error { |
There was a problem hiding this comment.
Ah, I see. VT has their own separate interface and methods for using unrolled marshal/unmarshal.
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -euxo pipefail |
There was a problem hiding this comment.
I know this is temporary, but we might want to start with protobuild support to get it working with modules. The technique will require a copy of the import set, but I am not sure how that will work with --import_path going away.
|
Resolving. I'm going to spin out small easy-to-merge PRs instead. The first PR is #96. |
A PoC for #92.