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

protocbuf package has pathing issues not present in official release #1715

Closed
djdv opened this issue Aug 9, 2019 · 2 comments
Closed

protocbuf package has pathing issues not present in official release #1715

djdv opened this issue Aug 9, 2019 · 2 comments

Comments

@djdv
Copy link

djdv commented Aug 9, 2019

I have package msys/protobuf-devel 3.7.1-1 installed and encountered some issues trying to use protoc within it.
I don't encounter this problem when using the official 3.7.1-1 release.

>mainline-protoc.exe --version
libprotoc 3.7.1
>mainline-protoc.exe --proto_path="C:\Users\Dominic\Projects\Go\src" --proto_path="." --gogofast_out=. rpc.proto

>msys2-protoc.exe --version
libprotoc 3.7.1
>msys2-protoc.exe --proto_path="C:\Users\Dominic\Projects\Go\src" --proto_path="." --gogofast_out=. rpc.proto
C: warning: directory does not exist.

This may also be an upstream issue, related to pre-processor directives that are set when building with mingw rather than MSVC. (didn't check fully but their source implies it's mingw aware)
There are later releases than 3.7.1 but I have not tried to build them within mingw to see if they still have the issue. (I don't encounter it on later official releases)

Specifically, I think this centres around The Unix list seperator being :, so when you pass in Windows paths that contain drive-spec components, it causes problems.
C:\users\wherever is parsed as [C, \users\wherever] since the proto_path parameter accepts a delimited list. On Windows as =path1;path2 and *nix as =path1:path2.

@Alexpux
Copy link
Member

Alexpux commented Aug 12, 2019

@djdv if you about MSYS version of protobuf then there are no issue because MSYS is like Cygwin and works with Unix paths. To work with Windows path you must pass it in form C:/my/path

@djdv
Copy link
Author

djdv commented Aug 12, 2019

Thanks Alexey.
I have tried replacing the \ with / but it has no effect.
protoc --proto_path="C:/Users/Dominic Della Valle/Projects/Go/src" --proto_path="." --gogofast_out=. rpc.proto

Using the Cygwin style path, it succeeds.
protoc --proto_path="/c/Users/Dominic Della Valle/Projects/Go/src" --proto_path="." --gogofast_out=. rpc.proto

I am a little confused about this because absolute Windows paths seem to work in all the other utilities from MSYS2 that I use. Even outside of MSYS2 shell (in cmd, invoked from make, etc.).

If Unix style is required, that is fine and this can be closed if it seems correct to you.

In our own make file, we will have to find out which version of protoc the user has installed and provide the right conventions accordingly.
If the MSYS protoc then Cygwin paths with : separator.
if mainline protoc then Windows paths with ; separator.

msys2-protoc --proto_path="/c/Users/Dominic Della Valle/Projects/Go/src:." --gogofast_out=. rpc.proto
and
mainline-protoc --proto_path="C:\Users\Dominic Della Valle\Projects\Go\src;." --gogofast_out=. rpc.proto

Regards~

@Alexpux Alexpux closed this as completed Aug 13, 2019
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