Skip to content
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

third_party/googleapis is missing from package #1065

Closed
ggilley opened this issue Oct 17, 2019 · 15 comments
Closed

third_party/googleapis is missing from package #1065

ggilley opened this issue Oct 17, 2019 · 15 comments

Comments

@ggilley
Copy link

ggilley commented Oct 17, 2019

I'm installing the latest packages. third_party/googleapis is missing from the package:

$ ls github.com/grpc-ecosystem/grpc-gateway/       
LICENSE.txt             internal                protoc-gen-swagger      runtime                 utilities

So I can't compile anything because it depends on those files existing:

protoc -I/usr/local/include -I. \
  -I$GOPATH/src \
  -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
  --ruby_out=. \
  path/to/your_service.proto
@johanbrandhorst
Copy link
Collaborator

Define "latest package" here? Is this in your vendor folder or something?

@ggilley
Copy link
Author

ggilley commented Oct 18, 2019

What I mean is, I follow the instructions:

go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/golang/protobuf/protoc-gen-go

And when I try to generate:

protoc -I/usr/local/include -I. \
  -I$GOPATH/src \
  -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
  --go_out=plugins=grpc:. \
  path/to/your_service.proto

The /grpc-gateway/third_party/googleapis files do not exist.

@johanbrandhorst
Copy link
Collaborator

Yes these files are not tracked by go since they are proto files. The recommendation is to manually include them in your repository. Alternatively you can use bazel which solves most of this.

@ggilley
Copy link
Author

ggilley commented Oct 20, 2019

Okay, then the instructions on the website need to be corrected. They don't mention this step at all and I wasted a bunch of time trying to figure out what I was doing wrong.

Plus, I think it's a silly decision since you can't use the grpc-gateway without them. Just makes everything harder for no reason.

@johanbrandhorst
Copy link
Collaborator

I'm sorry that the instructions were lacking in this case, would you be interested in contributing some better instructions to help the next person? I'd be happy to help you get a PR in.

As for this being a "silly decision", it's unfortunately out of our hands, there's no way to track proto files with go modules. Maybe you know a better way?

@ggilley
Copy link
Author

ggilley commented Oct 21, 2019

Okay, I didn't realize it was a technical limitation. I'll investigate.

@BelarminoClearbanc
Copy link

@johanbrandhorst
Copy link
Collaborator

This is a very go-centric solution, and it is far from a standard approach to versioning protobuf. Unless it becomes more widespread in the community we're unlikely to follow this model.

@BelarminoClearbanc
Copy link

👍

@aviddiviner
Copy link

I was able to resolve this by doing:
-I=$GOPATH/pkg/mod/github.com/grpc-ecosystem/grpc-gateway@v1.12.1/third_party/googleapis

That version number will change depending on what you have installed.

@fresonn
Copy link

fresonn commented Jul 20, 2020

I had the same problem
I liked this solution: https://www.youtube.com/watch?v=Zf9G2KzYs7w
He just copied from "github.com/grpc-ecosystem/grpc-gateway@v1.14.6/third_party/googleapis/"
cp -r google ~/your_project_path

Works fine for me!

@jextrevor
Copy link

this is an ugly solution, and is turning me away from working with protobuf/grpc in general

@elchappo
Copy link

I have to admit is really hard to work with this sort of changes, each time I want to use it I have to invest time to fix it first :( pretty disappointed

@johanbrandhorst
Copy link
Collaborator

johanbrandhorst commented May 12, 2021

Hi everyone. We recently updated the repository to use buf to manage the protobuf dependencies, which should make this much easier. Have you tried going through the README recently?

EDIT: Disclaimer: I work at buf.

lrascao added a commit to lrascao/gocryptotrader that referenced this issue Jul 22, 2021
Current generation of protobuf stubs is hard and there's open issues
around it:
   grpc-ecosystem/grpc-gateway#1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
lrascao added a commit to lrascao/gocryptotrader that referenced this issue Jul 23, 2021
Current generation of protobuf stubs is hard and there's open issues
around it:
   grpc-ecosystem/grpc-gateway#1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
lrascao added a commit to lrascao/gocryptotrader that referenced this issue Jul 26, 2021
Current generation of protobuf stubs is hard and there's open issues
around it:
   grpc-ecosystem/grpc-gateway#1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
lrascao added a commit to lrascao/gocryptotrader that referenced this issue Jul 26, 2021
Current generation of protobuf stubs is hard and there's open issues
around it:
   grpc-ecosystem/grpc-gateway#1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
lrascao added a commit to lrascao/gocryptotrader that referenced this issue Jul 27, 2021
Current generation of protobuf stubs is hard and there's open issues
around it:
   grpc-ecosystem/grpc-gateway#1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
lrascao added a commit to lrascao/gocryptotrader that referenced this issue Jul 27, 2021
Current generation of protobuf stubs is hard and there's open issues
around it:
   grpc-ecosystem/grpc-gateway#1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
lrascao added a commit to lrascao/gocryptotrader that referenced this issue Jul 27, 2021
Current generation of protobuf stubs is hard and there's open issues
around it:
   grpc-ecosystem/grpc-gateway#1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
lrascao added a commit to lrascao/gocryptotrader that referenced this issue Jul 27, 2021
Current generation of protobuf stubs is hard and there's open issues
around it:
   grpc-ecosystem/grpc-gateway#1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
lrascao added a commit to lrascao/gocryptotrader that referenced this issue Jul 27, 2021
Current generation of protobuf stubs is hard and there's open issues
around it:
   grpc-ecosystem/grpc-gateway#1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
lrascao added a commit to lrascao/gocryptotrader that referenced this issue Jul 27, 2021
Current generation of protobuf stubs is hard and there's open issues
around it:
   grpc-ecosystem/grpc-gateway#1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
thrasher- pushed a commit to thrasher-corp/gocryptotrader that referenced this issue Jul 28, 2021
Current generation of protobuf stubs is hard and there's open issues
around it:
   grpc-ecosystem/grpc-gateway#1065

grpc-gateway author and README suggest to use `buf` instead which
intends to be a simpler and more reliable method of protobuf stub
generation.
ahrtr added a commit to ahrtr/etcd that referenced this issue Sep 27, 2022
The third_party/googleapis has been removed from github.com/grpc-ecosystem/grpc-gateway/v2,
and the solution for now is to get them included in etcd repo directly. Please refer to
grpc-ecosystem/grpc-gateway#1065 (comment)

In the future, we may consider to manage the protobuf dependencies using
https://github.com/bufbuild/buf. Please see
grpc-ecosystem/grpc-gateway#1065 (comment).

Signed-off-by: Benjamin Wang <wachao@vmware.com>
ahrtr added a commit to ahrtr/etcd that referenced this issue Sep 27, 2022
The third_party/googleapis has been removed from github.com/grpc-ecosystem/grpc-gateway/v2,
and the solution for now is to get them included in etcd repo directly. Please refer to
grpc-ecosystem/grpc-gateway#1065 (comment)

In the future, we may consider to manage the protobuf dependencies using
https://github.com/bufbuild/buf. Please see
grpc-ecosystem/grpc-gateway#1065 (comment).

Signed-off-by: Benjamin Wang <wachao@vmware.com>
ahrtr added a commit to ahrtr/etcd that referenced this issue Sep 27, 2022
The third_party/googleapis has been removed from github.com/grpc-ecosystem/grpc-gateway/v2,
and the solution for now is to get them included in etcd repo directly. Please refer to
grpc-ecosystem/grpc-gateway#1065 (comment)

In the future, we may consider to manage the protobuf dependencies using
https://github.com/bufbuild/buf. Please see
grpc-ecosystem/grpc-gateway#1065 (comment).

Signed-off-by: Benjamin Wang <wachao@vmware.com>
ahrtr added a commit to ahrtr/etcd that referenced this issue Sep 27, 2022
The third_party/googleapis has been removed from github.com/grpc-ecosystem/grpc-gateway/v2,
and the solution for now is to get them included in etcd repo directly. Please refer to
grpc-ecosystem/grpc-gateway#1065 (comment)

In the future, we may consider to manage the protobuf dependencies using
https://github.com/bufbuild/buf. Please see
grpc-ecosystem/grpc-gateway#1065 (comment).

Added "./;" before all "option go_package". For example,
Changed
  "option go_package = "google.golang.org/genproto/googleapis/rpc/code;code";"
to
  "option go_package = "./;google.golang.org/genproto/googleapis/rpc/code;code";"

Refer to techschool/pcbook-go#3 (comment)

Signed-off-by: Benjamin Wang <wachao@vmware.com>
ahrtr added a commit to ahrtr/etcd that referenced this issue Sep 27, 2022
The third_party/googleapis has been removed from github.com/grpc-ecosystem/grpc-gateway/v2,
and the solution for now is to get them included in etcd repo directly. Please refer to
grpc-ecosystem/grpc-gateway#1065 (comment)

In the future, we may consider to manage the protobuf dependencies using
https://github.com/bufbuild/buf. Please see
grpc-ecosystem/grpc-gateway#1065 (comment).

Signed-off-by: Benjamin Wang <wachao@vmware.com>
@oxygenz6
Copy link

oxygenz6 commented Sep 19, 2023

Hi everyone. We recently updated the repository to use buf to manage the protobuf dependencies, which should make this much easier. Have you tried going through the README recently?

EDIT: Disclaimer: I work at buf.

Thanks to the unfair sanctions over people of Iran, buf, "an Open-source software", is restricted in our country and we can not use it! This is what sucks about the modern software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants