blob: 447ca59980952aba644b78f8f26ee2143eac63e0 [file] [edit]
diff --git a/MODULE.bazel b/MODULE.bazel
index 820be22d..312e58e2 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -1,5 +1,5 @@
module(
- name = "io_bazel_rules_go",
+ name = "rules_go",
version = "0.33.0",
compatibility_level = 0,
toolchains_to_register = [
diff --git a/go/platform/crosstool.bzl b/go/platform/crosstool.bzl
index 2e758720..0528048c 100644
--- a/go/platform/crosstool.bzl
+++ b/go/platform/crosstool.bzl
@@ -54,5 +54,5 @@ def platform_from_crosstool(crosstool_top, cpu):
for matcher in matchers:
platform = matcher(crosstool_top, cpu)
if platform:
- return "@io_bazel_rules_go//go/toolchain:{}".format(platform)
+ return "@rules_go//go/toolchain:{}".format(platform)
return None
diff --git a/go/private/go_toolchain.bzl b/go/private/go_toolchain.bzl
index 9a364815..2eb6349d 100644
--- a/go/private/go_toolchain.bzl
+++ b/go/private/go_toolchain.bzl
@@ -25,7 +25,7 @@ load("//go/private/actions:link.bzl", "emit_link")
load("//go/private/actions:pack.bzl", "emit_pack")
load("//go/private/actions:stdlib.bzl", "emit_stdlib")
-GO_TOOLCHAIN = "@io_bazel_rules_go//go:toolchain"
+GO_TOOLCHAIN = "@rules_go//go:toolchain"
def _go_toolchain_impl(ctx):
sdk = ctx.attr.sdk[GoSDK]
@@ -115,8 +115,8 @@ def declare_toolchains(host, sdk, builder, sdk_version_setting):
impl_name = toolchain_name + "-impl"
cgo_constraints = (
- "@io_bazel_rules_go//go/toolchain:cgo_off",
- "@io_bazel_rules_go//go/toolchain:cgo_on",
+ "@rules_go//go/toolchain:cgo_off",
+ "@rules_go//go/toolchain:cgo_on",
)
constraints = [c for c in p.constraints if c not in cgo_constraints]
@@ -135,8 +135,8 @@ def declare_toolchains(host, sdk, builder, sdk_version_setting):
name = toolchain_name,
toolchain_type = GO_TOOLCHAIN,
exec_compatible_with = [
- "@io_bazel_rules_go//go/toolchain:" + host_goos,
- "@io_bazel_rules_go//go/toolchain:" + host_goarch,
+ "@rules_go//go/toolchain:" + host_goos,
+ "@rules_go//go/toolchain:" + host_goarch,
],
target_compatible_with = constraints,
target_settings = [sdk_version_setting],
diff --git a/go/private/nogo.bzl b/go/private/nogo.bzl
index 1d3491bb..efb4594f 100644
--- a/go/private/nogo.bzl
+++ b/go/private/nogo.bzl
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-DEFAULT_NOGO = "@io_bazel_rules_go//:default_nogo"
+DEFAULT_NOGO = "@rules_go//:default_nogo"
def _go_register_nogo_impl(ctx):
ctx.template(
diff --git a/go/private/platforms.bzl b/go/private/platforms.bzl
index 21a62e90..b31cae1a 100644
--- a/go/private/platforms.bzl
+++ b/go/private/platforms.bzl
@@ -141,7 +141,7 @@ CGO_GOOS_GOARCH = {
def _generate_constraints(names, bazel_constraints):
return {
- name: bazel_constraints.get(name, "@io_bazel_rules_go//go/toolchain:" + name)
+ name: bazel_constraints.get(name, "@rules_go//go/toolchain:" + name)
for name in names
}
@@ -159,7 +159,7 @@ def _generate_platforms():
name = goos + "_" + goarch,
goos = goos,
goarch = goarch,
- constraints = constraints + ["@io_bazel_rules_go//go/toolchain:cgo_off"],
+ constraints = constraints + ["@rules_go//go/toolchain:cgo_off"],
cgo = False,
))
if (goos, goarch) in CGO_GOOS_GOARCH:
@@ -170,7 +170,7 @@ def _generate_platforms():
name = goos + "_" + goarch + "_cgo",
goos = goos,
goarch = goarch,
- constraints = constraints + ["@io_bazel_rules_go//go/toolchain:cgo_on"] + mingw,
+ constraints = constraints + ["@rules_go//go/toolchain:cgo_on"] + mingw,
cgo = True,
))
diff --git a/go/private/rules/nogo.bzl b/go/private/rules/nogo.bzl
index 638d067f..d71ad18b 100644
--- a/go/private/rules/nogo.bzl
+++ b/go/private/rules/nogo.bzl
@@ -115,7 +115,7 @@ def nogo(name, visibility = None, **kwargs):
native.alias(
name = name,
actual = select({
- "@io_bazel_rules_go//go/private:nogo_active": actual_name,
+ "@rules_go//go/private:nogo_active": actual_name,
"//conditions:default": Label("//:default_nogo"),
}),
visibility = visibility,
diff --git a/go/private/rules/transition.bzl b/go/private/rules/transition.bzl
index 6499caec..b978be25 100644
--- a/go/private/rules/transition.bzl
+++ b/go/private/rules/transition.bzl
@@ -44,6 +44,7 @@ def filter_transition_label(label):
way to refer to this repository (@io_bazel_rules_go from another workspace,
but only repo-relative labels if this repository is the main workspace).
"""
+ label = label.replace("@io_bazel_rules_go", "@rules_go")
if label.startswith("//command_line_option:"):
# This is a special prefix that allows transitions to access the values
# of native command-line flags. It is not a valid package, but just a
diff --git a/go/private/sdk.bzl b/go/private/sdk.bzl
index ee53cb0b..768b174d 100644
--- a/go/private/sdk.bzl
+++ b/go/private/sdk.bzl
@@ -249,7 +249,7 @@ def _sdk_build_file(ctx, platform, version):
"{goos}": goos,
"{goarch}": goarch,
"{exe}": ".exe" if goos == "windows" else "",
- "{rules_go_repo_name}": "io_bazel_rules_go",
+ "{rules_go_repo_name}": "rules_go",
"{major_version}": str(major),
"{minor_version}": str(minor),
"{patch_version}": str(patch),
diff --git a/go/toolchain/toolchains.bzl b/go/toolchain/toolchains.bzl
index b4e070cf..6a342da7 100644
--- a/go/toolchain/toolchains.bzl
+++ b/go/toolchain/toolchains.bzl
@@ -34,7 +34,7 @@ def declare_constraints():
@bazel_tools//platforms:default_platform will be used most of the time).
"""
for goos, constraint in GOOS_CONSTRAINTS.items():
- if constraint.startswith("@io_bazel_rules_go//go/toolchain:"):
+ if constraint.startswith("@rules_go//go/toolchain:"):
native.constraint_value(
name = goos,
constraint_setting = "@platforms//os:os",
@@ -46,7 +46,7 @@ def declare_constraints():
)
for goarch, constraint in GOARCH_CONSTRAINTS.items():
- if constraint.startswith("@io_bazel_rules_go//go/toolchain:"):
+ if constraint.startswith("@rules_go//go/toolchain:"):
native.constraint_value(
name = goarch,
constraint_setting = "@platforms//cpu:cpu",
diff --git a/go/tools/bazel_testing/def.bzl b/go/tools/bazel_testing/def.bzl
index d097027b..366fb4b1 100644
--- a/go/tools/bazel_testing/def.bzl
+++ b/go/tools/bazel_testing/def.bzl
@@ -26,7 +26,7 @@ def go_bazel_test(rule_files = None, **kwargs):
# Add dependency on bazel_testing library.
kwargs.setdefault("deps", [])
- bazel_testing_library = "@io_bazel_rules_go//go/tools/bazel_testing"
+ bazel_testing_library = Label("//go/tools/bazel_testing")
if bazel_testing_library not in kwargs["deps"]:
kwargs["deps"].append(bazel_testing_library)
diff --git a/tests/bcr/MODULE.bazel b/tests/bcr/MODULE.bazel
index 9d7a1bd8..8c4b5353 100644
--- a/tests/bcr/MODULE.bazel
+++ b/tests/bcr/MODULE.bazel
@@ -3,9 +3,9 @@ module(
# Test that the default SDK is registered by not registering one from the test module.
)
-bazel_dep(name = "io_bazel_rules_go", version = "", repo_name = "my_rules_go")
+bazel_dep(name = "rules_go", version = "", repo_name = "my_rules_go")
local_path_override(
- module_name = "io_bazel_rules_go",
+ module_name = "rules_go",
path = "../..",
)