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

mumble_proto.pro: fix protoc invocation for out-of-tree builds #2830

Merged

Conversation

davidebeatrici
Copy link
Member

This fixes the error:

File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).

@davidebeatrici davidebeatrici added the build Everything related to compiling/building the code label Feb 8, 2017
@mkrautz
Copy link
Contributor

mkrautz commented Feb 8, 2017

I'm curious... can you paste the full command that protoc invokes, before, and after this change?

I wonder why it's necessary when cross building?

@davidebeatrici
Copy link
Member Author

Before: protoc --cpp_out=. -I. -I.. ..\..\..\mumble\src\Mumble.proto
After: protoc --cpp_out=. -I. -I.. -I..\..\..\mumble\src ..\..\..\mumble\src\Mumble.proto

The error didn't appear when cross building, but when using Qt Creator.

@mkrautz
Copy link
Contributor

mkrautz commented Feb 9, 2017

Please add a note to the commit summary explaining that this fixes the problem for out-of-tree builds using Qt Creator.

Copy link
Contributor

@mkrautz mkrautz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs clarification in commit message and summary.

mumble_proto.pro: fix protoc invocation for out-of-tree builds.

This fixes the invocation of protoc in mumble_proto.pro to be compatible with out-of-tree builds. For example, this is how Qt Creator builds Mumble by default.

It fixes the error:
<insert the error like you have now>

@mkrautz
Copy link
Contributor

mkrautz commented Feb 9, 2017

Please explain why it fails for out-of-tree builds. You don't need the invocation in there -- that was just for me, because I was confused as to how this was related to cross-compiling. (And, as it turned out -- it wasn't).

Something like:

mumble_proto.pro: fix protoc invocation for out-of-tree builds

This fixes the invocation of protoc in mumble_proto.pro to be compatible with out-of-tree builds. For example, this is how Qt Creator builds Mumble by default.

For out-of-tree builds, our include path flags to protoc aren't sufficient. This is because protoc requires that the .proto file it is building is part of the include path. To fix this for out-of-tree builds, we add the absolute path to the directory that contains the .proto file.

This allows protoc to work for out-of-tree builds.

For reference, the error we got (before this commit) from protoc in out-of-tree builds was:
"File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think)."

This fixes the invocation of protoc in mumble_proto.pro to be compatible with out-of-tree builds. For example, this is how Qt Creator builds Mumble by default.

For out-of-tree builds, our include path flags to protoc aren't sufficient. This is because protoc requires that the .proto file it is building is part of the include path. To fix this for out-of-tree builds, we add the absolute path to the directory that contains the .proto file.

This allows protoc to work for out-of-tree builds.

For reference, the error we got (before this commit) from protoc in out-of-tree builds was:
"File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think)."
@mkrautz mkrautz changed the title mumble_proto.pro: Fix path mumble_proto.pro: fix protoc invocation for out-of-tree builds Feb 9, 2017
@mkrautz mkrautz merged commit 3315e01 into mumble-voip:master Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Everything related to compiling/building the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants