-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protoc
not resolving arguments using include paths
#353
Comments
I can reproduce. A note - generally We'll do some investigation, thanks. |
This is a more complicated problem than it first seems - note that
Like most things involving mainline We're working on it. |
I wonder if anyone actually relies on duplicate / ambiguous cases like that. Maybe just me, but I'd almost prefer an error if the same input filename could be resolved to two different files? |
I'd prefer an error for all of this tbh, hence why The reason why we outlaw i.e.
// pkg/a/a.proto
syntax = "proto3";
package a;
message Foo {}
// lib/b/b.proto
syntax = "proto3";
package b;
// import based on -I .
import "pkg/a/a.proto";
message Bar {
a.Foo foo = 1;
}
// lib/c/c.proto
syntax = "proto3";
package c;
// import based on -I pkg
import "a/a.proto";
message Bar {
a.Foo foo = 1;
} Then:
This happens a ton, which is why we enforce https://docs.buf.build/build-configuration#root-requirements |
We have now deleted |
Given some directory layout under the current working directory like
pkg/a/a.proto
andlib/b/b.proto
, this protobufprotoc
invocation succeeds:protoc --go_out=tmp -I pkg -I lib a/a.proto
. Note that the argument "a/a.proto" is not a path to a file in current working directory and is relying on being resolved using-I pkg
.The corresponding
buf protoc
invocation looks like it is not using the-I pkg
to resolve its arguments:buf protoc --go_out=tmp -I pkg -I lib a/a.proto
returnsThe text was updated successfully, but these errors were encountered: