Commit 16eaa0f
fix(proto): generate yarpc stubs with v2 codec to match V2 messages
The committed *.pb.yarpc.go stubs were produced by the legacy
protoc-gen-yarpc-go, which wires yarpc's gogo-based protobuf codec
(github.com/gogo/protobuf). The sibling *.pb.go messages, however, are
generated by protoc-gen-go (google.golang.org/protobuf V2 runtime, with
the protoimpl `state`/`sizeCache`/`unknownFields` fields). The two halves
disagree: the gogo codec assumes gogo-style structs, but is handed V2
ones.
This is dormant in this repo because the example servers run the
V2-native grpc-go stub; the yarpc stubs are unused here. But when the
yarpc procedures are consumed elsewhere (e.g. a yarpc monorepo), the gogo
codec's reflection unmarshaler panics on the first untagged V2 field:
protobuf tag not enough fields in LandRequest.state:
(gogo's encode side tolerates V2 structs by skipping untagged fields, but
the decode side parses every field's protobuf tag and panics — so the
server inbound / client response path breaks.)
Switch the Makefile proto target to protoc-gen-yarpc-go-v2 and regenerate.
The v2 generator emits an API-compatible stub (same NewFx*YARPCProcedures
symbols) whose codec uses the google.golang.org/protobuf V2 runtime,
agreeing with the V2 messages. The codec is per-procedure, so these
procedures interoperate with gogo-based services in the same process; the
wire bytes are identical. gazelle drops the gogo dep and adds
encoding/protobuf/v2; no go.mod/MODULE.bazel change is required.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent f17c76f commit 16eaa0f
9 files changed
Lines changed: 128 additions & 160 deletions
File tree
- stovepipe
- gateway/protopb
- orchestrator/protopb
- submitqueue
- gateway/protopb
- orchestrator/protopb
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
| 344 | + | |
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
| 348 | + | |
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
| 356 | + | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
25 | 23 | | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
25 | 23 | | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments