On Thu, Dec 22, 2022 at 02:46:49PM +1300, Daniel Swarbrick wrote:
> Updating the 01-Use_go_generate.patch as follows results in a successful
> build (without needing to add golang-google-protobuf-dev as a dependency):
> 
> diff --git a/debian/patches/01-Use_go_generate.patch
> b/debian/patches/01-Use_go_generate.patch
> index cafa5e2..ffa83cf 100644
> --- a/debian/patches/01-Use_go_generate.patch
> +++ b/debian/patches/01-Use_go_generate.patch
> @@ -6,4 +6,4 @@ Description: Use go generate to avoid depending on special
> make rules in
>  @@ -0,0 +1,3 @@
>  +package io_prometheus_client
>  +
> -+//go:generate protoc --proto_path=../io/prometheus/client
> --go_out=paths=source_relative:. metrics.proto
> ++//go:generate protoc --proto_path=../io/prometheus/client 
> --go_out=paths=source_relative,Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp:.
> metrics.proto
> 
> However, the generated metrics.pb.go still uses *timestamppb.Timestamp for
> the timestamp fields, which will cause undesirable side-effects on
> downstream packages.
> 
> I am not aware of any way to influence protoc to use the old timestamp type.

Hmm, this works for me, the generated pb.go uses old timestamp type.
I have added above change and built the package, then checked the result.

Reply via email to