Closed lukasmalkmus closed 5 years ago
This should already work. What error are you seeing?
To test this, I copied and renamed the protoc-gen-gogo
plugin binary in my $GOPATH
to be protoc-gen-gogo-backup
. I was able to generate files with the following config:
plugins:
- name: gogo
type: gogo
flags: plugins=grpc
output: ../../gen/proto/go
path: ../go/bin/protoc-gen-gogo-backup
exec: "../../bin/protoc-gen-go": stat ../../bin/protoc-gen-go: no such file or directory
But the executable is definitely there.
To extend my example above, take this projects structure:
.
├── Makefile
├── api
│ └── v1
│ ├── authentication.proto
│ └── prototool.yaml
├── bin
│ ├── protoc-gen-go
│ └── prototool
└── internal
└── proto
└── v1
└── authentication.pb.go
If I run prototool generate
in the api/v1
folder, I get the error mentioned above. Although you can clearly see and ls ../../bin/protoc-gen-go
verifies: The binary is there.
Ah, I was wrong. My bad! Running prototool generate
from the api/v1 folder
works perfectly fine. I did it from the root of the project: prototool generate api/v1
. Without looking at the code, I guess the plugins.output
is relative to the protos source location while the plugins.path
is evaluated from prototools working directory.
Sorry for the false report.
No worries. Glad you worked it out.
It would be great to have relative path support for
protoc-
binaries: https://github.com/uber/prototool/blob/4a300a9b2a55c7693516746ca22e72c9d00e7d26/etc/config/example/prototool.yaml#L159I'm in need for this because a project installs its tools into a project local
bin
folder living in the root of the project while theprototool.yaml
lives inapi/v1
. To use an absolute path isn't possible (multiple people with different location of the project on disc, CI, etc.)So what I want to basically do is: