Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ensure that the protoc root import path is examined first. #4129
While using this feature I noticed that protoc can sometimes get confused by the other proto_path entries when doing imports from the repo root of
The easy fix is to make sure the root is the first thing to be searched for the imports. The other option was to assume that if you're importing from the root anywhere then you have to everywhere, and not even use the source roots as proto_paths. But that seemed more extreme than was called for.
Simply move the root to the front of the list of proto paths to add to the cmd line.
Protoc doesn't get confused any more. I modified the test case to exercise the issue.
Gotta say, pretty confused by the changes to protoc, as they seem to make it harder to do the right thing. Oh well!