bazel-lib icon indicating copy to clipboard operation
bazel-lib copied to clipboard

Rename io_bazel_rules_go to rules_go?

Open Vertexwahn opened this issue 1 year ago • 3 comments

Can we rename io_bazel_rules_go to rules_go? I have currently a project that uses rules_go and when using aspect_bazel_lib I have conflict. aspect_bazel_lib expects io_bazel_rules_go and my project expects rules_go

Vertexwahn avatar Dec 05 '24 18:12 Vertexwahn

I believe this is not possible because we still have e2e tests to verify bazel-lib works for WORKSPACE users. See the failures on the attached PR where I tried it.

From https://github.com/bazel-contrib/rules_go/blob/master/docs/go/core/bzlmod.md:

If you have WORKSPACE dependencies that reference rules_go and/or Gazelle, you can still use the legacy repository names for the two repositories:

@fmeum will know for sure.

alexeagle avatar Dec 06 '24 17:12 alexeagle

If your project uses WORKSPACE, pretty much any dependency will expect rules_go's repo to be called io_bazel_rules_go.

If you use Bzlmod, the repo_name that aspect_bazel_lib uses internally shouldn't matter.

What is the error you are seeing?

fmeum avatar Dec 06 '24 17:12 fmeum

Error is ERROR: no such package '@@io_bazel_rules_go//go': The repository '@@io_bazel_rules_go' could not be resolved: Repository '@@io_bazel_rules_go' is not defined https://github.com/bazel-contrib/bazel-lib/actions/runs/12202661633/job/34043875001

Which is expected because we test that bazel-lib works with --noenable_bzlmod

alexeagle avatar Dec 10 '24 01:12 alexeagle

I don't think we should do anything here. It would break WORKSPACE users and Bzlmod users already have the freedom to pick their own repo_names.

fmeum avatar Aug 30 '25 07:08 fmeum