bufdev

Results 107 comments of bufdev

This is an interesting one - could we find 15-20 to chat? Send us an email [email protected] or message us on slack https://buf.build/links/slack, we should work through this together.

For what's it's worth, https://developers.google.com/protocol-buffers/docs/reference/proto3-spec isn't accurate, not even close actually heh.

https://github.com/pedgeio/goprotoctest/blob/8a33d656fca5bc15e6cb78414444cea41a8bd970/internal/goprotoctest/goprotoctest_test.go#L122 This is directly comparing the `FileDescriptorSet` for every subdirectory in https://github.com/envoyproxy/envoy/tree/master/api. `protoc` is called to produce a `FileDescriptorSet` on a per-directory basis, then https://github.com/jhump/goprotoc/blob/master/app/goprotoc/goprotoc.go#L34 is called with the same...

This isn't just a Golang struct diff or a JSON diff FYI, this means there was a difference in the byte representation of the FileDescriptorSets https://github.com/pedgeio/goprotoctest/blob/8a33d656fca5bc15e6cb78414444cea41a8bd970/internal/goprotoctest/goprotoctest_test.go#L638

I did some more testing, it's very weird: `protoc` produces a `FileDescriptorSet` that is of size 10 more than the one produced by `goprotoc`, however both the JSON and String...

This is comparing the two `FileDescriptorSets` directly, this isn't relying on what the specific Golang implementation says is equal. It's not differing in any field, the actual serialized size of...

It's actually more random than 10, this is difficult: ``` --- FAIL: TestEnvoyIncludeImports/envoy/api/v2/core (0.05s) require.go:1159: Error Trace: goprotoctest_test.go:640 goprotoctest_test.go:506 Error: Should be true Test: TestEnvoyIncludeImports/envoy/api/v2/core Messages: diff detected: protoc-goprotoc File.slice[9].MessageType.slice[9].XXX_sizecache:...

As I said and as I linked above, this is a byte comparison. https://github.com/pedgeio/goprotoctest/blob/8a33d656fca5bc15e6cb78414444cea41a8bd970/internal/goprotoctest/goprotoctest_test.go#L638

I also just did a raw byte comparison at the source (ie the direct output of `--descriptor_set_out`, no serialize/deserialize in the middle), and the serialized `FileDescriptorSets` are in fact different...

The `sizecache` field being different is as you said, it's just indicative that the sizes are different for various messages (which I have confirmed they are)