gogo / protobuf

[Deprecated] Protocol Buffers for Go with Gadgets
Other
5.67k stars 807 forks source link

"M" path on Windows doesn't work when the output path isn't empty #570

Closed CodeSpartan closed 5 years ago

CodeSpartan commented 5 years ago

This works:

protoc -I="E:\Unity Projects\2DGame\Assets\Protocs\\" ^
    -I=%GOPATH%\src\github.com\gogo\protobuf\protobuf ^
    -I=%GOPATH%\src\github.com\grpc-ecosystem\grpc-gateway\third_party\googleapis ^
    -I=%GOBIN%\google\protobuf ^
    -I=%GOPATH%\src ^
    --gogofast_out=^
Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,^
plugins=grpc:.^
    darkera_messages.proto

This does not:

@echo on
protoc -I="E:\Unity Projects\2DGame\Assets\Protocs\\" ^
    -I=%GOPATH%\src\github.com\gogo\protobuf\protobuf ^
    -I=%GOPATH%\src\github.com\grpc-ecosystem\grpc-gateway\third_party\googleapis ^
    -I=%GOBIN%\google\protobuf ^
    -I=%GOPATH%\src ^
    --gogofast_out="C:\darkera_messages\\"^
Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,^
plugins=grpc:.^
    darkera_messages.proto

^ the only thing I changed is gogofast_out.

The console returns: \darkera_messages\Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc:./: No such file or directory.

Looks like the "C:" in "C:\darkera_messages\" gets chopped off, or something else gets mangled up.

johanbrandhorst commented 5 years ago
--gogofast_out="C:\darkera_messages\\"Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc:.

This does not look like a valid invocation to me. The output path should be after the plugins:

--gogofast_out=Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,plugins=grpc:"C:\darkera_messages\\"

The reason you're seeing the error you're seeing is because the first : is being interpreted as the separator between plugins and the output path.

johanbrandhorst commented 5 years ago

I'm gonna close this as user error, I will explain in the gophers slack if necessary.