-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since dev
merge, code no longer compiles, lots of strange changes
#427
Comments
Yes this was a HUGE change. See https://github.com/golang/protobuf/releases/tag/v1.1.0 Could you please provide a small example that reproduces your grpc problems? Do the fileDescriptor renames bother you in the following diffs as well? The import aliases could probably be fixed, but it is always hard, for some reason. The XXX fields are unfortunate, but something that golang/protobuf deemed necessary. I don't think we ever had XXX_Marshal methods, so I don't know how they are reappearing? Again thanks for reporting. |
Thanks Walter. It looks like my tests still work, so the functionality difference is minimal if not zero. The renaming of things such as The main issue is the addition of the additional @@ -338,14 +571,38 @@ func (m *GetAllRouteClustersRequest) GetAssociationsToExpand() string {
}
type GetAllRouteClustersResponse struct {
- RouteCluster []*RouteCluster `protobuf:"bytes,1,rep,name=route_cluster,json=routeCluster" json:"route_cluster,omitempty"`
+ RouteCluster []*RouteCluster `protobuf:"bytes,1,rep,name=route_cluster,json=routeCluster" json:"route_cluster,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_sizecache int32 `json:"-"`
}
func (m *GetAllRouteClustersResponse) Reset() { *m = GetAllRouteClustersResponse{} }
func (*GetAllRouteClustersResponse) ProtoMessage() {}
func (*GetAllRouteClustersResponse) Descriptor() ([]byte, []int) {
- return fileDescriptorCluster, []int{9}
+ return fileDescriptor_cluster_c98421a8c26a96a1, []int{9}
}
+func (m *GetAllRouteClustersResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *GetAllRouteClustersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ b = b[:cap(b)]
+ n, err := m.MarshalTo(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+}
+func (dst *GetAllRouteClustersResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_GetAllRouteClustersResponse.Merge(dst, src)
+}
+func (m *GetAllRouteClustersResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *GetAllRouteClustersResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_GetAllRouteClustersResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_GetAllRouteClustersResponse proto.InternalMessageInfo I can live with these as the interface seems to be consistent, it's just noise in the documentation. I've added a Thanks again for looking into this! |
I would love to get rid of your I am also not a fan of the XXX methods, these come from golang/protobuf. I would advise to complain to them, because it is a bit outside of my power to get rid of these. Or maybe I made the wrong decision to stay close to the golang/protobuf implementation in the first place :( |
proto.zip % protoc \
-I=. \
-I="$GOPATH/src/github.com/gogo/protobuf/protobuf" \
-I="$GOPATH/src" \
--gogoslick_out=\
Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,\
Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,\
import_path=test_stuff,\
plugins=grpc:\
. \
proto/audit.proto That will generate the |
I have same issue. My generated files now have broken imports
They are not used in file - code contains short aliases like
|
… This is more consistant with golang/protobuf. fix gogo#427
I am also having the same issue; took me a while to realise this was related to the new version that was pushed since 2 days ago. |
Running into same issue with the GPC and context imports |
Does anyone know how to pull the previous version with |
@bt maybe this helps: git clone https://github.com/gogo/protobuf $GOPATH/src/github.com/gogo/protobuf
cd $GOPATH/src/github.com/gogo/protobuf && git checkout v1.0.0 && go install ./... |
@taras-zak Ah didn't know I could do it that way, thank you! |
…the vars in grpc * consistent import naming between the import declaration and the vars. This is more consistant with golang/protobuf. * moved issue427 test to the 'testall' make target to avoid grpc/context dependency
Could everyone check whether master fixes the problem? |
Works for me! |
yup looks good thanks! |
Release pushed https://github.com/gogo/protobuf/releases/tag/v1.1.1 |
Can I close this issue? Maybe the rest of the issues should each have their own separate issue? |
@awalterschulze I can confirm everything compiles without error now. The following new fields / methods are still exposed:
I can open a new issue if you want me to -- they don't affect the functionality as far as I can tell, it's just noise in Happy to close the issue if you are! |
The XXX methods is something you should probably take up with golang/protobuf. The XXX fields are something that might be removable. XXX_NoUnkeyedLiteral is easy to remove, but XXX_sizecache will be a little tougher. This I see more as a feature request than a bug though, if that makes sense. So if you want structs without XXX fields, I would ask that you rather create a new issue that references this one. I would want to gather a few users, in that issue, that need this feature before going ahead to implement it though, but I can think of some good reasons, even though I am not a user anymore. |
I Hope closing this makes sense. |
Thanks @awalterschulze, very much appreciated. Given |
Yes removing other fields would be another feature, like removing XXX_unrecognized. It is not xxx_sizecache, since reflect cannot access private fields and the proto library needs to access this field. The XXX methods are also called from the proto library and that is why they need to be exported as well. |
Over the weekend, it would appear that much of the generated code no longer compiles, almost all of which is related to the packages
golang.org/x/net/context
(I'm using Go 1.10.3) orgoogle.golang.org/grpc
not being used:If I run
goimports -w
on the generated files it does fix these errors, but there appear to be a large number of strange changes. for instance:fileDescriptor
names moved from (e.g.)fileDescriptorCluster
tofileDescriptor_cluster_c98421a8c26a96a1
(making diffs a lot less readable)import strings "strings"
andimport reflect "reflect"
etc -- do these really need to be aliased?import sortkeys "github.com/gogo/protobuf/sortkeys"
is nowimport github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
-- is that deliberate?gogofaster
orgogoslick
there are now a lot ofXXX_
prefixed exported variables in structs, such asXXX_sizecache
andXXX_NoUnkeyedLiteral
, and the re-appearance of methods such asXXX_Unmarshal
,XXX_Marshal
,XXX_Merge
,XXX_Size
,XXX_DiscardUnknown
etc.I can't pinpoint where these issues began within the dev merge, but something is definitely substantially different compared to Friday. Should I be following some particular branch for a stable version?
The text was updated successfully, but these errors were encountered: