-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing import paths so generated headers work
The protobuf compiler uses the concept of a "canonical" path when generating source files. This is the base point where it searches for import files. It _expects_ that path will match the base path for searching for headers, too. The end result is that import "v1/ustatus.proto" will generate a C++ header that contains #include "v1/ustatus.pb.h" while we have been explicitly asked to use includes starting with `uprotocol` in up-cpp: #include "uprotocol/v1/ustatus.pb.h" We were able to work around this with some tricks when the import paths were file names only (e.g. `import ustatus.proto`). However, the proto files have moved under the `v1/` directory as of #141. Based on my reading of the protoc documentation and several stack overflow postings, it seems the intended way for .proto files to be written in this scenario is to import the full canonical path as intended for the output files: import "uprotocol/v1/ustatus.proto" so that protoc can generate the correct paths in output sources in the first place.
- Loading branch information
Showing
5 changed files
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b9d142e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woo :) had opened an issue for this but then closed it since I had a workaround. Now I don't need the workaround, thanks!