diff --git a/src/bazel/dotnet_tool_repository.bzl b/src/bazel/dotnet_tool_repository.bzl index abb2e35dd..130623b58 100644 --- a/src/bazel/dotnet_tool_repository.bzl +++ b/src/bazel/dotnet_tool_repository.bzl @@ -50,7 +50,9 @@ def _dotnet_tool_repo_impl(repo_ctx): tool_name = repo_ctx.attr.tool_name if not tool_name: # In bzlmod, repo_ctx.attr.name has a prefix like "_main~_repo_rules~wix". - tool_name = repo_ctx.attr.name.split("~")[-1] + # Note also that Bazel 8.0+ uses "+" instead of "~". + # https://github.com/bazelbuild/bazel/issues/23127 + tool_name = repo_ctx.attr.name.replace("~", "+").split("+")[-1] version = repo_ctx.attr.version repo_ctx.execute([ diff --git a/src/bazel/pkg_config_repository.bzl b/src/bazel/pkg_config_repository.bzl index c850d0364..8d46e01ff 100644 --- a/src/bazel/pkg_config_repository.bzl +++ b/src/bazel/pkg_config_repository.bzl @@ -105,7 +105,9 @@ def _pkg_config_repository_impl(repo_ctx): _symlinks(repo_ctx, includes) data = { # In bzlmod, repo_ctx.attr.name has a prefix like "_main~_repo_rules~ibus". - "name": repo_ctx.attr.name.split("~")[-1], + # Note also that Bazel 8.0+ uses "+" instead of "~". + # https://github.com/bazelbuild/bazel/issues/23127 + "name": repo_ctx.attr.name.replace("~", "+").split("+")[-1], "hdrs": _make_strlist([item + "/**" for item in includes]), "copts": _make_strlist(_exec_pkg_config(repo_ctx, "--cflags-only-other")), "includes": _make_strlist(includes),