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

make generate produces an error on centos #25

Closed
kadisi opened this issue Jul 28, 2018 · 2 comments
Closed

make generate produces an error on centos #25

kadisi opened this issue Jul 28, 2018 · 2 comments

Comments

@kadisi
Copy link

kadisi commented Jul 28, 2018

when i exec make generate in my centos , it comes:

# Generate gogo, gRPC-Gateway, swagger, go-validators output.
#
# -I declares import folders, in order of importance
# This is how proto resolves the protofile imports.
# It will check for the protofile relative to each of these
# folders and use the first one it finds.
#
# --gogo_out generates GoGo Protobuf output with gRPC plugin enabled.
# --grpc-gateway_out generates gRPC-Gateway output.
# --swagger_out generates an OpenAPI 2.0 specification for our gRPC-Gateway endpoints.
# --govalidators_out generates Go validation files for our messages types, if specified.
#
# The lines starting with Mgoogle/... are proto import replacements,
# which cause the generated file to import the specified packages
# instead of the go_package's declared by the imported protof files.
#
# $GOPATH/src is the output directory. It is relative to the GOPATH/src directory
# since we've specified a go_package option relative to that directory.
#
# proto/example.proto is the location of the protofile we use.
protoc \
		-I proto \
		-I vendor/github.com/grpc-ecosystem/grpc-gateway/ \
		-I vendor/github.com/gogo/googleapis/ \
		-I vendor/ \
		--gogo_out=plugins=grpc,\
Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,\
Mgoogle/api/annotations.proto=github.com/gogo/googleapis/google/api,\
Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types:\
$GOPATH/src/ \
		--grpc-gateway_out=\
Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,\
Mgoogle/api/annotations.proto=github.com/gogo/googleapis/google/api,\
Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types:\
$GOPATH/src/ \
		--swagger_out=third_party/OpenAPI/ \
		--govalidators_out=gogoimport=true,\
Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,\
Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,\
Mgoogle/api/annotations.proto=github.com/gogo/googleapis/google/api,\
Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types:\
$GOPATH/src \
		proto/example.proto
google/protobuf/empty.proto: File not found.
google/protobuf/timestamp.proto: File not found.
google/protobuf/duration.proto: File not found.
google/protobuf/field_mask.proto: File not found.
google/protobuf/descriptor.proto: File not found.
google/api/annotations.proto: Import "google/protobuf/descriptor.proto" was not found or had errors.
google/api/annotations.proto:28:8: "google.protobuf.MethodOptions" is not defined.
google/protobuf/any.proto: File not found.
protoc-gen-swagger/options/openapiv2.proto: Import "google/protobuf/any.proto" was not found or had errors.
protoc-gen-swagger/options/openapiv2.proto:131:3: "google.protobuf.Any" is not defined.
protoc-gen-swagger/options/annotations.proto: Import "protoc-gen-swagger/options/openapiv2.proto" was not found or had errors.
protoc-gen-swagger/options/annotations.proto: Import "google/protobuf/descriptor.proto" was not found or had errors.
protoc-gen-swagger/options/annotations.proto:10:8: "google.protobuf.FileOptions" is not defined.
protoc-gen-swagger/options/annotations.proto:17:8: "google.protobuf.MethodOptions" is not defined.
protoc-gen-swagger/options/annotations.proto:24:8: "google.protobuf.MessageOptions" is not defined.
protoc-gen-swagger/options/annotations.proto:31:8: "google.protobuf.ServiceOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: Import "google/protobuf/descriptor.proto" was not found or had errors.
github.com/gogo/protobuf/gogoproto/gogo.proto:38:8: "google.protobuf.EnumOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto:46:8: "google.protobuf.EnumValueOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto:50:8: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto:89:8: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto:123:8: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/mwitkow/go-proto-validators/validator.proto: Import "google/protobuf/descriptor.proto" was not found or had errors.
github.com/mwitkow/go-proto-validators/validator.proto:18:8: "google.protobuf.FieldOptions" is not defined.
example.proto: Import "google/protobuf/empty.proto" was not found or had errors.
example.proto: Import "google/protobuf/timestamp.proto" was not found or had errors.
example.proto: Import "google/protobuf/duration.proto" was not found or had errors.
example.proto: Import "google/protobuf/field_mask.proto" was not found or had errors.
example.proto: Import "google/api/annotations.proto" was not found or had errors.
example.proto: Import "protoc-gen-swagger/options/annotations.proto" was not found or had errors.
example.proto: Import "github.com/gogo/protobuf/gogoproto/gogo.proto" was not found or had errors.
example.proto: Import "github.com/mwitkow/go-proto-validators/validator.proto" was not found or had errors.
example.proto:82:5: "google.protobuf.Timestamp" is not defined.
example.proto:97:5: "google.protobuf.FieldMask" is not defined.
example.proto:102:5: "google.protobuf.Timestamp" is not defined.
example.proto:106:5: "google.protobuf.Duration" is not defined.
example.proto:43:32: "google.protobuf.Empty" is not defined.
make: *** [generate] Error 1

and exec make install is ok

make install

go install \
		./vendor/github.com/gogo/protobuf/protoc-gen-gogo \
		./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
		./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
		./vendor/github.com/mwitkow/go-proto-validators/protoc-gen-govalidators \
		./vendor/github.com/rakyll/statik

and when i exec make generate on my two mac, one is ok, but anther is failed.

@kadisi
Copy link
Author

kadisi commented Jul 28, 2018

oh, my mistake, my protoc is in /usr/local/bin, but lack of /usr/local/include/google/protobuf/ dir

@johanbrandhorst
Copy link
Member

These files should be included with a proper protoc installation, as I think you noticed. I will close this, please reopen if necessary.

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

2 participants