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

Update Go quick-start once cmd/protoc-gen-go-grpc is at v1.0 #298

Closed
1 task done
chalin opened this issue Jun 19, 2020 · 14 comments · Fixed by #436
Closed
1 task done

Update Go quick-start once cmd/protoc-gen-go-grpc is at v1.0 #298

chalin opened this issue Jun 19, 2020 · 14 comments · Fixed by #436
Assignees
Labels
e1-hours Effort: < 8 hrs p1-high

Comments

@chalin
Copy link
Collaborator

chalin commented Jun 19, 2020

Context: grpc/grpc-go#3688 (comment). We've known that this was coming.

Awaiting next release. It seems like the next release will be 1.31 (with 1.30 being skipped)?

Related:

@chalin
Copy link
Collaborator Author

chalin commented Jun 23, 2020

@dfawley - I don't think that I can update the quick-start page yet, right? That is, we're still required to use github.com/golang/protobuf/protoc-gen-go@v1.3. (Also see the question given here: grpc/grpc-go#3453 (comment)). Otherwise, if there are updates that can be made to the quick-start page now, let me know what they are, thanks.

@chalin
Copy link
Collaborator Author

chalin commented Jun 23, 2020

In #304, the grpc_go_release_tag was updated:

-  grpc_go_release_tag: v1.30.0-dev.1
+  grpc_go_release_tag: v1.30.0

I'm going to revert this since the instructions aren't working otherwise.

@chalin chalin changed the title Update Go quick-start once the next official release lands Update Go quick-start once cmd/protoc-gen-go-grpc is included in next grpc-go release Jun 23, 2020
@chalin
Copy link
Collaborator Author

chalin commented Jun 23, 2020

So we're waiting on cmd/protoc-gen-go-grpc to be usable and released, if I understand the situation correctly; i.e., we're waiting on: grpc/grpc-go#3669 (for some more context, see grpc/grpc-go#3453).

chalin added a commit that referenced this issue Jun 23, 2020
The version is currently only used in the quick start, and the instructions only work with v1.30.0-dev.1. We can update the grpc-go version once #298 is resolved.
@chalin chalin changed the title Update Go quick-start once cmd/protoc-gen-go-grpc is included in next grpc-go release Update Go quick-start once cmd/protoc-gen-go-grpc is at v1.0 Jun 25, 2020
@BarberEngineering
Copy link

BarberEngineering commented Jul 10, 2020

If you found this from the quick start guide - here's the steps to get this working

Do the steps in the guide before this link then:

go to the generator folder in the dir you cloned from step 1

cd grpc-go/cmd/protoc-gen-go-grpc

Install protoc-gen-go-grpc

go install .

Now you can use the --go-grpc_out=. switch compiling your program and it will work

@chalin
Copy link
Collaborator Author

chalin commented Aug 10, 2020

Link to relevant discussion: grpc/grpc-go#3669 (comment)

@celesteking
Copy link

celesteking commented Sep 10, 2020

What if I don't want to clone the example repo and just want to proceed with grpc files generation assuming I've already got protobuf files generated (--go_out)?

update: was able to get it going with : cd $(go env GOPATH)/src/google.golang.org/grpc/cmd/protoc-gen-go-grpc && go install .

@celesteking
Copy link

https://grpc.io/docs/languages/go/quickstart/ needs updated with Service vs Server difference. I just don't get why grpc got released to pkg.go.dev without updating the tutorial.

@dfawley
Copy link
Member

dfawley commented Sep 10, 2020

protoc-gen-go-grpc has still not been released at v1.0. You should still be using the old codegen tool at github.com/golang/protobuf to produce grpc stubs (per the quick start instructions)

@ludichrislyts
Copy link

The only way I was able to get the QuickStart helloworld.proto to compile was to change the protoc commands to

protoc --go_out=Mgrpc/service_config/service_config.proto=/../../internal/proto/grpc_service_config:. --go-grpc_out=Mgrpc/service_config/service_config.proto=/../../internal/proto/grpc_service_config:. helloworld.proto

Basically provide the path to the config from the examples/helloworld folder and remove the source_relative flags. Those commands produced the pb.go files, but it put them in another weird 'helloworld' folder.
Before
image
After
image

I'm super new to this, not sure if I just missed some critical step or something.

@dfawley
Copy link
Member

dfawley commented Sep 11, 2020

Apologies for the misinformation in my comment yesterday. We are using the new codegen tool in the quickstart guides, but it has been changed since the instructions were released.

The quickstart guide instructs you to use a previous release of gRPC:

$ git clone -b v1.31.0 https://github.com/grpc/grpc-go

Make sure you are using this version, and are installing protoc-gen-go-grpc from within that tree.

@dfawley
Copy link
Member

dfawley commented Oct 2, 2020

protoc-gen-go-grpc has been released (finally! 🎉). You can get it now as follows:

go get google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.0

I don't believe any other changes should be required in the quick-start guide.

@tigerwill90
Copy link

Thank's for the update !

@chalin chalin self-assigned this Oct 2, 2020
@chalin chalin removed the blocked label Oct 2, 2020
@chalin
Copy link
Collaborator Author

chalin commented Oct 2, 2020

Thanks @dfawley, I'll try it out (I usually prefer walking through the entire thing), and then update the quick start by Monday.

@dfawley
Copy link
Member

dfawley commented Oct 2, 2020

go get for the module will install it, per the above command:

$ go get google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.0
go: downloading google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.0
go: downloading google.golang.org/grpc v1.30.0-dev.1
go: downloading google.golang.org/protobuf v1.23.0
$ ls -l $GOPATH/bin/protoc-gen-go-grpc
...

We have a multi-module repo which can be confusing. The github release page (also linked above) shows the tag for the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e1-hours Effort: < 8 hrs p1-high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants