[
https://issues.apache.org/jira/browse/BEAM-13939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17494273#comment-17494273
]
Robert Burke commented on BEAM-13939:
-------------------------------------
We'd be delighted to fix it if you know how to do that! I've looked a few times
with no luck, but that has been several months now.
https://github.com/lostluck/beam/blob/master/sdks/go/pkg/beam/model/gen.go has
the go-generate lines, and we are due for another re-run anyway.
Ideally since we no longer have gogradle to deal with, and have module support
we can make a gradle command for the non-go SDK users to run when they're
adding new things to the proto.
I recall running into this before, but I also have no idea how to force longer
paths to be used from the proto compiler. Things I often think would work,
inevitably don't.
The previous attempts did this:
https://github.com/apache/beam/pull/13115/files#diff-ad3846f561a94d3b6fa45f7d0e65fafc92f8696a8f936c4b8b0a2d85fb402fd2
And with the switch to modules, this:
https://github.com/lostluck/beam/commit/49dca2ca7c615c4168b6ca7aa0938c066bcfb7e0#diff-ad3846f561a94d3b6fa45f7d0e65fafc92f8696a8f936c4b8b0a2d85fb402fd2
The SDK internal use of proto had the even more general name of "v1" which
needed adjustment too.
https://github.com/apache/beam/blame/master/sdks/go/pkg/beam/core/runtime/graphx/v1/gen.go
> Go SDK: Protobuf namespace conflict
> -----------------------------------
>
> Key: BEAM-13939
> URL: https://issues.apache.org/jira/browse/BEAM-13939
> Project: Beam
> Issue Type: Improvement
> Components: beam-model, sdk-go
> Affects Versions: 2.36.0
> Reporter: Milan Patel
> Priority: P2
> Labels: easyfix
> Attachments: demobug.zip
>
>
> The Go SDK generated grpc protobufs are not namespaced with enough
> granularity. If a user has another external dependency with the same protobuf
> file registered with the proto runtime, their compiled binary will panic at
> runtime pointing the user to this [doc
> page|https://developers.google.com/protocol-buffers/docs/reference/go/faq#fix-namespace-conflict].
>
> In the interim, following the instructions to add either ldflags to the
> compiler or an environment var to the binary works, but this is an unideal
> solution since only one of the duplicate proto specifications will be
> accessible from a [global
> registry|https://pkg.go.dev/google.golang.org/[email protected]/reflect/protoregistry].
>
> Ask: Regenerate the go protos such that descriptors like
> [these|https://github.com/apache/beam/blob/84353a7c973d3acaaa56d81c265dce7193a56be5/sdks/go/pkg/beam/model/pipeline_v1/metrics.pb.go#L797-L811]
> are outputted with filenames that are more granular, such as a filename that
> includes the directory structure of the repository.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)