[Bug 1828230] Re: FTBFS due to too new golang-goprotobuf-dev
Mathew Hodson
mathew.hodson at gmail.com
Sat May 25 16:11:16 UTC 2019
** Tags added: ftbfs
** Changed in: golang-google-grpc (Ubuntu)
Importance: Undecided => Medium
--
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1828230
Title:
FTBFS due to too new golang-goprotobuf-dev
Status in golang-google-grpc package in Ubuntu:
New
Bug description:
Disco updated golang-goprotobuf-dev to version 1.2.0-1. The protoc-
gen-go binary included with it generates grpc code that requires
google.golang.org/grpc version 1.8.0 or newer.
Disco and eoan contain golang-google-grpc-dev version 1.6.0-3. Since
the source includes code that is regenerated during building it fails
to build from source.
(This also means that any developers using golang-goprotobuf-dev and
golang-google-grpc-dev from disco or eoan are unable to build their
generated code, but fixing the FTBFS also fixes their problems.)
As a little background explanation, google.golang.org/grpc introduced
two new API methods in 1.8.0: ClientConn.Invoke and
ClientConn.NewStream, deprecating grpc.Invoke and
grpc.NewClientStream, respectively: https://github.com/grpc/grpc-
go/commit/a5986a5c88227370a9c0a82e5277167229c034cd
github.com/golang/protobuf dropped use of the deprecated functions in
generated grpc code in favor of the new ones in 1.2.0:
https://github.com/golang/protobuf/commit/7c4add53b497798e7fd7b204f28e41ab409bdbb7
Additionally, github.com/golang/protobuf disallows use of unkeyed
struct literals since version 1.1.0:
https://github.com/golang/protobuf/commit/8cc9e46429bfb16289d40d30b2ee3f4923b47345
#diff-8c603013608023320d5242916c4ea03bR1973. This causes some examples
in this package to fail to compile. This was fixed upstream in version
1.10.0: https://github.com/grpc/grpc-
go/commit/82e9f61ddde02833789fdca2123b576151db8654
The attached debdiff fixes the first issue by adding wrapper functions
which match the signature of the new API and call the old API
internally. The second issue is fixed by pulling the upstream patch to
remove use of unkeyed struct literals.
[Test Case]
golang-google-grpc-dev fails to build from source on disco and eoan.
See https://launchpad.net/ubuntu/+source/golang-google-
grpc/1.6.0-3ubuntu0.19.04.1/+build/16729837 (although that build
included a proposed patch, the same failure occurs without it).
An alternative, minimal test case:
1. sudo apt install golang-google-grpc-dev
2. Copy simple.proto from the bug attachments to an empty directory.
3. protoc simple.proto --go_out=plugins=grpc:.
4. GOPATH=/usr/share/gocode/ go build simple.pb.go
Expected output:
Nothing
Actual output:
# command-line-arguments
./simple.pb.go:86:13: c.cc.Invoke undefined (type *grpc.ClientConn has no field or method Invoke)
./simple.pb.go:94:21: c.cc.NewStream undefined (type *grpc.ClientConn has no field or method NewStream)
[Regression Potential]
The added wrapper functions emulate an API no yet available in 1.6.0
by calling an older one internally. It is possible that this can
result in unexpected behavior when invoking the wrapper functions.
However this regression is not very likely, since the functionality
behind the two API-s is exactly the same even to this day: the
deprecated API calls the new one internally.
The second fix of using keyed struct literals has no regression
potential. It removes ambiguity by explicitly marking which value
should be assigned to which field and is required by new versions of
goprotobuf.
Release: Ubuntu 19.04
Release: Ubuntu 19.10 (development branch)
Package: golang-google-grpc 1.6.0-3
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/golang-google-grpc/+bug/1828230/+subscriptions
More information about the Ubuntu-sponsors
mailing list