grpc-ecosystem / polyglot

A universal grpc command line client
BSD 3-Clause "New" or "Revised" License
530 stars 59 forks source link

--proto_path error since 1.6.0 #110

Open mrt181 opened 6 years ago

mrt181 commented 6 years ago

I updated today to 2.0.0 and since version 1.6.0 I get this error for this command

 java -jar polyglot.jar --proto_discovery_root=build/extracted-include-protos/main call --endpoint=wn000280:18181 --full_method='api.v1.DataService/ListInstruments' <<< '{"parent":"references/instruments"}'
C:\cygwin64\home\mrt181\sourcecode\api-service\build\extracted-include-protos\main\google\protobuf\struct.proto: Input is shadowed in the --proto_path by "C:/cygwin64/tmp/polyglot-well-known-types1930180195804578592/google/protobuf/struct.proto".  Either use the latter file as your input or reorder the --proto_path so that the former file's location comes first.

I can fix this by deleting this directory: C:\cygwin64\home\mrt181\sourcecode\api-service\build\extracted-include-protos\main\google

because polyglot includes it in the polyglot-well-known-types. But that directory is regenerated by my build jobs.

So I tried to run this instead:

 java -jar polyglot.jar --proto_discovery_root=build/extracted-include-protos/main/api call --endpoint=wn000280:18181 --full_method='api.v1.DataService/ListInstruments' <<< '{"parent":"references/instruments"}'

to only use my protos and the well-known ones but this gives me this error:

api/trading/v1/type/instrument.proto: File not found.
trading/v1/response/list_instruments_response.proto: Import "api/trading/v1/type/instrument.proto" was not found or had errors.
trading/v1/response/list_instruments_response.proto:11:14: "Instrument" is not defined.

list_instruments_response.proto has this import

import "api/trading/v1/type/instrument.proto";

How can I exclude the usage of the well-known-types? I pull them in myself because I need those

mgolovatiy-atconsulting-ru commented 5 years ago

+1 Have the same error