The dependencies that begin with // refer to packages within tendermint, and That only other targets within tendermint can depend on blockchain.įinally, each dependency is explicitly listed. The import path tells us how another project can import it in Go, and the The target’s name is blockchain, and it builds a library from the Go Importpath = "/tendermint/tendermint/internal/blockchain/v2" ,ĭeps =, ) Instead of using that default, I include a Gazelle directive in the root BUILD file Since tendermint already has those files.īy default, Gazelle makes go_proto_library and proto_library pb.go files generated by the protocol buffer compiler, It’s probably easier to use the existing. However, according to the rules_go documentation, Here we’ve run into a dependency problem about using the proto_library rule for The gazelle:prefix directive tells Gazelle how other Go projects can importĮRROR: /tendermint/third_party/proto/gogoproto/BUILD.bazel:5:14: no such package : The repository could not be resolved and referenced by '//third_party/proto/gogoproto:gogoproto_proto'ĮRROR: /tendermint/third_party/proto/gogoproto/BUILD.bazel:5:14: every rule of type proto_library implicitly depends upon the target but this target could not be found because of: no such package : The repository could not be resolvedĮRROR: Analysis of target '//third_party/proto/gogoproto:gogoproto_proto' failed build aborted: Analysis failed The root BUILD file contains a Gazelle target, so that we can use Bazel Let’s write a BUILD file in the root directory. Gazelle generates Bazel BUILD files, so that I don’t have to write them all myself,Īnd updates the Bazel files after changes are done to Go source files.Įven though there aren’t any Go sources to build in the root directory, The first line of the WORKSPACE file gives the project a name,Īnd the rest loads the dependencies on rules_go and Gazelle. Go_register_toolchains (version = "1.16.5" ) Load (, "go_register_toolchains", "go_rules_dependencies" ) Workspace (name = "com_github_tendermint_tendermint" )
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |