0

I'm finding that protoc doesn't seem to find things which are on the proto_path despite them being present:

$ protoc --proto_path=protobufs/protobufs \
    --go_out=plugins=grpc:/home/me/go/src somefolder/enums.proto
somefolder/enums.proto: No such file or directory
$ ls protobufs/protobufs/somefolder/enums.proto 
protobufs/protobufs/somefolder/enums.proto

Why might this happen? It doesn't seem to happen to others. I'm using Ubuntu 18.04, and protoc --version says libprotoc 3.0.0.

sil
  • 1,769
  • 1
  • 18
  • 34

1 Answers1

2

Can you try this command?

protoc --proto_path=protobufs/protobufs \
    --go_out=plugins=grpc:/home/me/go/src \
    protobufs/protobufs/somefolder/enums.proto 

The proto_path argument is used to tell protoc where should it look for import proto files.

Lidi Zheng
  • 1,801
  • 8
  • 13
  • Ah. That works. So it seems like my command above doesn't work and never should have done, so I need to find out why it works for everyone else! Thank you! – sil Jan 24 '19 at 20:12