Definition of @six conflicts between google/protobuf and rules_docker in same bazel workspace #367
Comments
I figured out a workaround: Make a local copy of the google/protobuf/BUILD file from the same commit as you're importing, and modify the
|
Same issue when attempting to build containers in a repository that has a tensorflow dependency (which is also providing that bind for |
I think this issue is more on bazel's dependency management side rather than this repo. Maybe open / reference an issue with bazel? |
This prevents container_image from working with repos that depend on envoy's build as well. cc @mattmoor |
@erain Yes, but fixes to Bazel flow like molasses. @dekkagaijin can you work with @erain to change the name of the |
Will look into this after fixing the CIs. |
@mattmoor yeah I can help manage it. We're migrating |
Hi @dekkagaijin , do you want to try to send a PR to google/containerregistry to fix your issue and let us know if you need help on our side? |
This is a really awful load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# depending on your version of sed, you need either -i '' or just -i.
SED_CMD = "sed -i '' " + " ".join(["-e '%s'" % e for e in [
's~name = "six"~name = "six_hacked"~',
's~"@six//:six"~"@six_hacked//:six_hacked"~',
's~\"@six\"~\"@six_hacked\"~',
's~if "six" not in excludes~if "six_hacked" not in excludes~',]])
http_archive(
name = "containerregistry",
url = "https://github.com/google/containerregistry/archive/v0.0.25.tar.gz",
sha256 = "64886684c60bb6f19f73b0e802cdbbf051d10c3803cd11e9ab06d7da8d011ce4",
strip_prefix = "containerregistry-0.0.25",
patch_cmds = [SED_CMD + " def.bzl BUILD.bazel"],
)
http_archive(
name = "io_bazel_rules_docker",
sha256 = "6dede2c65ce86289969b907f343a1382d33c14fbce5e30dd17bb59bb55bb6593",
strip_prefix = "rules_docker-0.4.0",
urls = ["https://github.com/bazelbuild/rules_docker/archive/v0.4.0.tar.gz"],
patch_cmds = [SED_CMD+ " container/container.bzl"],
)
# ....
# in my case:
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_pull",
_container_repositories = "repositories",
)
_container_repositories()
load(
"@io_bazel_rules_docker//cc:image.bzl",
_cc_image_repos = "repositories",
)
_cc_image_repos() |
is this still an issue? please reopen if so. |
I still see this when using protobuf and other google packages such as a google-cloud. |
Do these issues occur with rules_docker, or just protobuf with google-cloud. If the latter, there's probably little we can do in this repo to fix, if the former, can you provide repro instructions? |
Any issue for fixing this on Bazel? I'd like to follow that. |
The reference to @ six in this repo has been moved out of repositories.bzl and into WORKSPACE (meaning its currently a test only dependency). You should not be seeing this error coming from an incompatibility with rules_docker anymore. Not sure if there are any upstream issues related to fixing this issue for protobuf or other repos that might also be failing similarly, but not something we are keeping an eye out for in this repo. |
@nlopezgi You're right. I just updated to v0.12.1 and the problem got hidden. Thanks! |
I'm trying to use rules_docker with a project that also uses python protobufs rules from github.com/google/protobuf.
In order to have correct
//external:six
target used by https://github.com/google/protobuf/blob/master/BUILD#L715 I have this in my WORKSPACE:However, this is not compatible with
containerregistry
and fails with this error:I haven't been able to find a way for these two to coexist. Some related issues:
The text was updated successfully, but these errors were encountered: