Question 1:
According to the BUILD instructions, one needs to define both @com_google_protobuf_cc and @com_google_protobuf like this:
http_archive(
name = "com_google_protobuf",
urls = ["https://github.com/google/protobuf/archive/b4b0e304be5a68de3d0ee1af9b286f958750f5e4.zip"],
strip_prefix = "protobuf-b4b0e304be5a68de3d0ee1af9b286f958750f5e4",
sha256 = "ff771a662fb6bd4d3cc209bcccedef3e93980a49f71df1e987f6afa3bcdcba3a",
)
# cc_proto_library rules implicitly depend on @com_google_protobuf_cc//:cc_toolchain,
# which is the C++ proto runtime (base classes and common utilities).
http_archive(
name = "com_google_protobuf_cc",
urls = ["https://github.com/google/protobuf/archive/b4b0e304be5a68de3d0ee1af9b286f958750f5e4.zip"],
strip_prefix = "protobuf-b4b0e304be5a68de3d0ee1af9b286f958750f5e4",
sha256 = "ff771a662fb6bd4d3cc209bcccedef3e93980a49f71df1e987f6afa3bcdcba3a",
)
Maybe I'm mistaken, but isn't this making two copies of the protobuf repo? Why couldn't the toolchain dependency simply be @com_google_protobuf//:cc_toolchain?
Question 2:
What if I don't want to use the protobuf from the http_archive but rather a local/vendored one that resides under //third_pary/protobuf? Using new_local_repository in this case is unsatisfactory since people cloning the repo would need to update the path for their system.
Why aren't Bazel proto rules assuming protobuf to be an external repo (e.g. //external:protobuf). That way, both the http_archive and local BUILD approaches would work.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/a2f0955a-c63c-4002-a837-a45125bad05b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.