-
-
Notifications
You must be signed in to change notification settings - Fork 669
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
Wrong importpath for //go/tools/bazel #1333
Comments
bazel-contrib/bazel-gazelle#132 will provide a way to deal with this. Gazelle already scans WORKSPACE for We can't change the For now, I'd recommend marking the |
Who's depending on that target? Wouldn't they all run into the same issues
as I?
…On Fri, Feb 16, 2018, 10:51 Jay Conrod ***@***.***> wrote:
bazel-contrib/bazel-gazelle#132
<bazel-contrib/bazel-gazelle#132> will provide a
way to deal with this. Gazelle already scans WORKSPACE for go_repository
rules in order to build a mapping between repository names and import
paths. There's not yet a way to tell it about repositories declared with
other rules or declared inside macros.
We can't change the importpath of this library, since that would break
anyone depending on it with the current path.
For now, I'd recommend marking the deps list that contains that import
with a # keep comment. That will prevent Gazelle from modifying that
attribute.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1333 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB5_YTBf8pYV5T9gH5OdgbikqFPt0sNlks5tVaPqgaJpZM4SIbFe>
.
|
I'm not sure who's depending on it, but I'd rather not break them. I think the problem is that Gazelle is putting the wrong label in deps, so it should be fixed in Gazelle instead. |
Adding a dependency doesn't seem to work: Go file:
BUILD.bazel file:
Error:
|
Ah! Got it. I should change the import to |
In https://github.com/bazelbuild/rules_go/blob/master/go/tools/bazel/BUILD.bazel,
The problem is that if I import this package in my code as
github.com/bazelbuild/...
, Gazelle creates a dependency to@com_github_bazelbuild_rules_go//go/tools/bazel
which doesn't exist because the repository's name isio_bazel_rules_go
(and changing it is hard, because everyone uses this name, including Gazelle and Buildozer).However, if I import it as
bazel.io/rules_go/go/tools/bazel
, Gazelle doesn't generate any dependency at all (separate bug?) and Bazel complains about a "missing strict dependencies". Adding a manual dependency on@io_bazel_rules_go//go/tools/bazel
still fails the build with the same strict deps violation, presumably because of theimportpath
here.It seems logical to change the
importpath
, though I don't know who it affects.Also, is there a workaround I can use in the meanwhile, other than vendor https://github.com/bazelbuild/rules_go/blob/master/go/tools/bazel/bazel.go?
The text was updated successfully, but these errors were encountered: