-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Use of @//
in bazelbuild/bazel/... makes it very hard to depend on Bazel from other repos
#4285
Comments
Sounds like we should just use |
Curious - I see that we ended up with |
It looks like the commit was rolled back for an unknown problem with one of the patch chunks. Lets discuss it on #4435. |
@jmillikin-stripe my question was why |
I think you're getting confused between "git repository" and "bazel repository". Try this experiment:
|
Ah. The reason is that
in |
I want to build a Docker container that will run the prototype Bazel Remote Worker. This seems like it should be very easy, by creating a
http_archive
repo rule importing Bazel itself, and then making@io_bazel//src/tools/remote_worker
) a dep of the image rule.Unfortunately, the use of
@//
in this repo makes that very difficult. When a rule depends on@//foo:bar
, Bazel will try to resolve//foo:bar
as a target in the top-level workspace. Since the Bazel source is an external, that fails.Luckily, Bazel's
WORKSPACE
declaresworkspace(name = "io_bazel")
. This means a global search-and-replace of@//
with@io_bazel//
in this repo should allow it to be depended on normally, no further changes needed. I verified this by patching bazel-0.8.1 (https://gist.github.com/jmillikin-stripe/f53e098622bed7fb70a90103c80fc2ee) to use@io_bazel//
, and was able to successfully build the remote worker as an external dep. This was the same output as building it frombazelbuild/bazel
, including correctly vendored dependencies.The text was updated successfully, but these errors were encountered: