Skip to content
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

gazelle infers wrong external from import path #606

Closed
jmhodges opened this issue Jul 5, 2017 · 5 comments
Closed

gazelle infers wrong external from import path #606

jmhodges opened this issue Jul 5, 2017 · 5 comments

Comments

@jmhodges
Copy link
Contributor

jmhodges commented Jul 5, 2017

I depend on the go code in rules_webtesting to do some testing. It's import path in Go is "github.com/bazelbuild/rules_webtesting/go/webtest".

However, it's bazel external name that rules_webtesting sets as its workspace (and so the repository is named in my WORKSPACE) is io_bazel_rules_webtesting.

Gazelle, when run on this code, will add or change the go_test's deps to depend on "@com_github_bazelbuild_rules_webtesting//go/webtest:go_default_library" instead of the correct @io_bazel_rules_webtesting//go/webtest:go_default_library. If the correct dep was already present, it will be rewritten to the incorrect one.

@jmhodges
Copy link
Contributor Author

jmhodges commented Jul 5, 2017

(I tested this with the new bazel run :gazelle trick using the new gazelle skylark function)

@ianthehat
Copy link
Contributor

We really need workspace aliases so we can maintain backwards compatibility with the io_bazel names but switch all our uses to the normal expected forms.
Also, having the import->label map be intelligent/remembered rather than simple name transformation would also fix this.

@jmhodges
Copy link
Contributor Author

jmhodges commented Oct 5, 2017

Is there an import to label map now? Saw some changes that seem to be related

@jayconrod
Copy link
Contributor

Not yet, but soon. #859 is a proposal for this.

@jayconrod
Copy link
Contributor

Closing old Gazelle issues. I've migrated this to bazelbuild/bazel-gazelle#12 and bazelbuild/bazel-gazelle#13. Let me know if I've left anything out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants