You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifically, compile-proto-file allows unqualified lookup of imported names, which seems to be nonstandard, but fails to find qualified names unless they start at the top package component. It should look up both qualified and unqualified names relative to the current package, its parent package, and so forth, on up to the root--except for names that start with a period, which are always relative to the root (that is, absolute).
Name resolution in
compile-proto-file
deviates from that ofprotoc
and from this portion of the specification:https://developers.google.com/protocol-buffers/docs/proto3#packages_and_name_resolution
Specifically,
compile-proto-file
allows unqualified lookup of imported names, which seems to be nonstandard, but fails to find qualified names unless they start at the top package component. It should look up both qualified and unqualified names relative to the current package, its parent package, and so forth, on up to the root--except for names that start with a period, which are always relative to the root (that is, absolute).Consider the following two test inputs:
protoc
acceptstest2.proto
, but rejects it if we remove thesub1.
qualification from the reference toMessage1
.By contrast,
compile-proto-file
rejectstest2.proto
:But if we remove the
sub1
qualification then thencompile-proto-file
succeeds--even thoughprotoc
would fail in that case.If we expand qualification to
test.sub1.Message1
or the absolute path.test.sub1.Message1
then bothcompile-proto-file
andprotoc
accept the input.The text was updated successfully, but these errors were encountered: