New issue
Advanced search Search tips

Issue 814865 link

Starred by 0 users

Issue metadata

Status: Untriaged
Owner: ----
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Can't specify path of proto files when using common-mk/protoc.gypi

Project Member Reported by renyi@chromium.org, Feb 22 2018

Issue description

When compiling the proto files, the command line in protoc.gypi strips out the path of the proto file and leaves only the file name and enforces it to be directly under <(proto_in_dir).

It is a good chance that we may have different proto with same names but in different library. Because of the abovementioned reason, we specify the <(proto_in_dir) to be the directory having theses files. But this may lead to a runtime error when a target is linked with 2 proto files from different library but having the same file name. In the context of protobuf-3.3.0, the generated *.pb.cc has a file descriptor led by the file name. When the executable runs, it first load these file descriptors and index them using the file name. Even if two pb.cc files come from different library and with totally different definition, the binary exit with an CHECK failure.

One workaround could be that we change protoc.gypi to make it accept an optional path under </(proto_in_dir). However still don't have an idea why protobuf-3.3.0 has this restriction and runtime error behavior.
 

Sign in to add a comment