Skip to content

Commit 85fcd7a

Browse files
authored
refactor: rename host_toolchain rule to host_compatible_python_repo (#2926)
The host_toolchain name is misleading, so rename it to some more accurate. Work towards #2913
1 parent cd550d9 commit 85fcd7a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

python/private/python.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ load(":full_version.bzl", "full_version")
2121
load(":python_register_toolchains.bzl", "python_register_toolchains")
2222
load(":pythons_hub.bzl", "hub_repo")
2323
load(":repo_utils.bzl", "repo_utils")
24-
load(":toolchains_repo.bzl", "host_toolchain", "multi_toolchain_aliases", "sorted_host_platforms")
24+
load(":toolchains_repo.bzl", "host_compatible_python_repo", "multi_toolchain_aliases", "sorted_host_platforms")
2525
load(":util.bzl", "IS_BAZEL_6_4_OR_HIGHER")
2626
load(":version.bzl", "version")
2727

@@ -321,7 +321,7 @@ def _python_impl(module_ctx):
321321
host_platforms[platform_name] = platform_info
322322

323323
host_platforms = sorted_host_platforms(host_platforms)
324-
host_toolchain(
324+
host_compatible_python_repo(
325325
name = toolchain_info.name + "_host",
326326
# NOTE: Order matters. The first found to be compatible is (usually) used.
327327
platforms = host_platforms.keys(),

python/private/python_register_toolchains.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ load(":full_version.bzl", "full_version")
2828
load(":python_repository.bzl", "python_repository")
2929
load(
3030
":toolchains_repo.bzl",
31-
"host_toolchain",
31+
"host_compatible_python_repo",
3232
"toolchain_aliases",
3333
"toolchains_repo",
3434
)
@@ -185,7 +185,7 @@ def python_register_toolchains(
185185
impl_repos = impl_repos,
186186
)
187187

188-
host_toolchain(
188+
host_compatible_python_repo(
189189
name = name + "_host",
190190
platforms = loaded_platforms,
191191
python_version = python_version,

python/private/toolchains_repo.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def _host_toolchain_impl(rctx):
379379

380380
# NOTE: The term "toolchain" is a misnomer for this rule. This doesn't define
381381
# a repo with toolchains or toolchain implementations.
382-
host_toolchain = repository_rule(
382+
host_compatible_python_repo = repository_rule(
383383
_host_toolchain_impl,
384384
doc = """\
385385
Creates a repository with a shorter name meant to be used in the repository_ctx,
@@ -400,7 +400,7 @@ If set, overrides the platform metadata. Keyed by index in `platforms`
400400
),
401401
"platforms": attr.string_list(mandatory = True),
402402
"python_version": attr.string(mandatory = True),
403-
"_rule_name": attr.string(default = "host_toolchain"),
403+
"_rule_name": attr.string(default = "host_compatible_python_repo"),
404404
"_rules_python_workspace": attr.label(default = Label("//:WORKSPACE")),
405405
},
406406
)

0 commit comments

Comments
 (0)