-
Notifications
You must be signed in to change notification settings - Fork 811
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
Dependency of dependency causing WARNINGS at compile time #207
Comments
Are you using If you are not using |
I'll give it a go, thanks for the quick reply! |
Are you using |
No, just |
Ok wow then I would really love to see the example gist how this breaks. |
I've made a gist here: https://gist.github.com/johanbrandhorst/c832922a289a757eac3156b5210e65ef Note that I couldn't recreate the folder structure entirely, but each proto file is in its own directory like so:
Curiously, I found that
was required in the top level file to get the message. |
Thanks this should fix it Populate was trying to find loops, but once you are in a different package you don't have to keep on trying to file loops. |
At the time of writing, CockroachDB (which does not use
I believe something is left of this bug. Would you mind reopening, @awalterschulze? |
Aren't you using the Timestamp here? https://github.com/cockroachdb/cockroach/pull/19722/files#diff-996f0d52c6028290020f308882fb8e70L50 |
That's |
( |
Would you mind changing log.Printf("protoc-gen-gogo: WARNING: failed finding publicly imported dependency for %v, used in %v", typeName, *g.file.Name) to a panic in protoc-gen-gogo/generator/generator.go And can you also print |
Sure! See below (the
|
Ok sorry, that was less useful than I thought. Maybe uncommenting these printfs would be more useful
in populate.go |
… On Sun, Nov 5, 2017 at 11:01 AM Walter Schulze ***@***.***> wrote:
Ok sorry, that was less useful than I thought.
Maybe uncommenting these printfs would be more useful
//fmt.Fprintf(os.Stderr, "loops %v %v\n", field.GetTypeName(), generator.CamelCaseSlice(message.TypeName()))
//fmt.Fprintf(os.Stderr, "loopTo %v\n", generator.CamelCaseSlice(loopTo.TypeName()))
in populate.go
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#207 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AE135BbIKvNhVMkpa7kus9IsJYfmWGIdks5szdvxgaJpZM4KMeUQ>
.
|
Its failing to find Timestamp that is declared in TxnMeta |
I am really struggling. |
Sure, here's a much-simplified example: diff --git a/pkga/aa.proto b/pkga/aa.proto
new file mode 100644
index 0000000..23bcd45
--- /dev/null
+++ b/pkga/aa.proto
@@ -0,0 +1,13 @@
+syntax = "proto3";
+package prototest.pkga;
+option go_package = "pkga";
+
+import "prototest/pkga/ab.proto";
+import "gogoproto/gogo.proto";
+
+message ProtoAA {
+ option (gogoproto.populate) = true;
+
+ ProtoAB ab = 1;
+}
+
diff --git a/pkga/ab.proto b/pkga/ab.proto
new file mode 100644
index 0000000..86c1cbc
--- /dev/null
+++ b/pkga/ab.proto
@@ -0,0 +1,11 @@
+syntax = "proto3";
+package prototest.pkga;
+option go_package = "pkga";
+
+import "prototest/pkgb/b.proto";
+import "gogoproto/gogo.proto";
+
+message ProtoAB {
+ prototest.pkgb.ProtoB b = 1;
+}
+
diff --git a/pkgb/b.proto b/pkgb/b.proto
new file mode 100644
index 0000000..972801b
--- /dev/null
+++ b/pkgb/b.proto
@@ -0,0 +1,9 @@
+syntax = "proto3";
+package prototest.pkgb;
+option go_package = "pkgb";
+
+import "gogoproto/gogo.proto";
+
+message ProtoB {
+}
+ Gist doesn't allow directories, so here's a Zip with the above files for your convenience: |
This turned out to be easy to fix! See #357. 🍻 |
Cool fix. Looking forward to merging it :) |
Pick up a fix for gogo/protobuf#207, which was causing spurious warnings when compiling protobufs.
This import is strictly unnecessary, but was provided as a workaround for gogo/protobuf#207, which is now fixed.
Still having issues with this... We are compiling TensorFlow protocol buffers which have nested dependencies. E.g. op_def imports attr_value which imports tensor. When running the following command in the framework directory, the build throws a long list of failure to import warnings. Repo: Command run in framework directory:
Resultant warnings:
Any insight on this would be greatly appreciated. @awalterschulze @benesch |
I am not close to a computer, so here are just some things I would look at
playing around with.
Try one specific file.proto at a time instead of *.proto
Try not putting all protos in the same folder with the same package name
Knowing which of these two causes the problem might help
…On Fri, 21 Dec 2018 at 21:24, Samuel B Sendelbach ***@***.***> wrote:
Still having issues with this...
We are compiling TensorFlow protocol buffers which have nested
dependencies. E.g. op_def
<https://github.com/tensortask/gotfpb/blob/master/core/framework/protos/op_def.proto>
imports attr_value
<https://github.com/tensortask/gotfpb/blob/master/core/framework/protos/attr_value.proto>
which imports tensor
<https://github.com/tensortask/gotfpb/blob/master/core/framework/protos/tensor.proto>
.
When running the following command in the framework directory
<https://github.com/tensortask/gotfpb/tree/master/core/framework>, the
build throws a long list of failure to import warnings.
Repo:
https://github.com/tensortask/gotfpb
Command run in framework directory:
protoc -I=$GOPATH/src -I=$GOPATH/src/github.com/gogo/protobuf/protobuf
-I=$GOPATH/src/github.com -I=protos
--gogofaster_out=Mgoogle/protobuf/any.proto=
github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types:gen
protos/*.proto
Resultant warnings:
...
...
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto.Dim, used in step_stats.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto, used in step_stats.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto, used in step_stats.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto.Dim, used in step_stats.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto.Dim, used in step_stats.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto.Dim, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto.Dim, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.ResourceHandleProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.ResourceHandleProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto.Dim, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto.Dim, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.ResourceHandleProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.ResourceHandleProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto.Dim, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto.Dim, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.ResourceHandleProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.ResourceHandleProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto.Dim, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.TensorShapeProto.Dim, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.ResourceHandleProto, used in summary.proto
2018/12/21 13:10:57 protoc-gen-gogo: WARNING: failed finding publicly imported dependency for .framework.ResourceHandleProto, used in summary.proto
...
...
Any insight on this would be greatly appreciated. @awalterschulze
<https://github.com/awalterschulze> @benesch <https://github.com/benesch>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#207 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvsLS6WmPLQ6W16QbQ_FB9DQcGKtKkxks5u7TVZgaJpZM4KMeUQ>
.
|
When using protoc-gen-gogo I see messages like this for depenencies of a dependency:
When explicitly importing the package in the affected protofile, this warning disappears, but obviously I then instead get the warning that there are unused imports. This seems to imply that there is a problem with the dependency-of-dependency resolution.
The text was updated successfully, but these errors were encountered: