Grpc-gateway: Problem with *.proto as "no buildable Go source files"

Created on 27 Mar 2017  路  6Comments  路  Source: grpc-ecosystem/grpc-gateway

This repository compilation I call from compilation github.com\lightningnetwork\lnd. When I download all depended reposotories, it appear error:

d:\code\go\src\github.com\lightningnetwork\lnd>go build
lnrpc\rpc.pb.go:93:8: no buildable Go source files in d:\code\go\src\github.com\grpc-ecosystem\grpc-gateway\third_party\googleapis\google\api

I read README.md of this repository. There is about protobuf installation on Linux. I try compiling on Windows, have download protoc-3.2.0-win32.zip and put protoc.exe to %PATH% directory (for exmaple Go directory), next I do:

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

without errors but still I can't compile due to *.proto

Most helpful comment

@tmc @c4milo Sorry, I don't understand why this is "fixed" by lightningnetwork/lnd#169 nor where it's fixed in #340

The issue is that the folder

github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api

no longer contains the generated http.pb.go and annotations.pb.go so when, for example, including annotations into a .proto file, the error occurs:

no buildable Go source files in .../github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api

All 6 comments

@borneq thanks for your issue report. It appears lnd uses an outdated protoc invocation. I've opened https://github.com/lightningnetwork/lnd/pull/169 to solve this problem.

This has been fixed upstream.

@tmc I'm having this same issue with master branch and libprotoc 3.2.0.

Manually commenting the following line, in the generated code, fixed it.

import _ "github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api"

I fixed it based on lightningnetwork/lnd#169 Thanks!

@tmc @c4milo Sorry, I don't understand why this is "fixed" by lightningnetwork/lnd#169 nor where it's fixed in #340

The issue is that the folder

github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api

no longer contains the generated http.pb.go and annotations.pb.go so when, for example, including annotations into a .proto file, the error occurs:

no buildable Go source files in .../github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api

@nicerobot You are probably using the old go_out option, if you follow this fix https://github.com/philips/grpc-gateway-example/pull/15 and regenerate the files, it should work.

Was this page helpful?
0 / 5 - 0 ratings