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.
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
will generate a C++ header that contains
while we have been explicitly asked to use includes starting with
uprotocol
in up-cpp: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 thev1/
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:
so that protoc can generate the correct paths in output sources in the first place.