英文:
How to use `bazel cquery` to find out who brings an external dependency?
问题
我的bazel
构建失败,出现以下错误:
link: package conflict error: github.com/golang/protobuf/ptypes/timestamp: multiple copies of package passed to linker:
@io_bazel_rules_go//proto/wkt:timestamp_go_proto
@com_github_golang_protobuf//ptypes/timestamp:timestamp
Set "importmap" to different paths or use 'bazel cquery' to ensure only one
package with this path is linked.
在错误消息中,我看到use 'bazel cquery' to ensure only one package
,我如何使用bazel cquery
找出是谁引入/使用了@com_github_golang_protobuf//ptypes/timestamp:timestamp
?
英文:
My bazel
build fails with the following error
link: package conflict error: github.com/golang/protobuf/ptypes/timestamp: multiple copies of package passed to linker:
@io_bazel_rules_go//proto/wkt:timestamp_go_proto
@com_github_golang_protobuf//ptypes/timestamp:timestamp
Set "importmap" to different paths or use 'bazel cquery' to ensure only one
package with this path is linked.
In the error message, I see use 'bazel cquery' to ensure only one package
, how can I find out who brings/uses @com_github_golang_protobuf//ptypes/timestamp:timestamp
using bazel cquery
?
答案1
得分: 1
找到了查询
bazel cquery "somepath(//..., @com_github_golang_protobuf//ptypes/timestamp:timestamp)"
英文:
Found the query
bazel cquery "somepath(//..., @com_github_golang_protobuf//ptypes/timestamp:timestamp)"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论