Skip to content

Commit 4613c66

Browse files
committed
fix config setting naming
1 parent 60d6880 commit 4613c66

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

python/private/py_toolchain_suite.bzl

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ def py_toolchain_suite(*, prefix, user_repository_name, python_version, set_pyth
4444
major_minor, _, _ = python_version.rpartition(".")
4545

4646
match_any = []
47-
for v in [major_minor, python_version]:
48-
name = prefix + "_{}".format(prefix, v)
47+
for i, v in enumerate([major_minor, python_version]):
48+
name = "{prefix}_{python_version}_{i}".format(
49+
prefix = prefix,
50+
python_version = python_version,
51+
i = i,
52+
)
4953
match_any.append(name)
5054
if flag_values:
5155
is_python_config_setting(
@@ -58,23 +62,30 @@ def py_toolchain_suite(*, prefix, user_repository_name, python_version, set_pyth
5862
native.alias(
5963
name = name,
6064
actual = Label("//python/config_settings:is_python_%s" % v),
65+
visibility = ["//visibility:private"],
6166
)
6267

68+
name = "{prefix}_version_setting_{python_version}".format(
69+
prefix = prefix,
70+
python_version = python_version,
71+
visibility = ["//visibility:private"],
72+
)
6373
selects.config_setting_group(
64-
name = prefix + "_version_setting",
74+
name = name,
6575
match_any = match_any,
6676
visibility = ["//visibility:private"],
6777
)
68-
target_settings = [prefix + "_version_setting"]
78+
target_settings = [name]
6979
elif set_python_version_constraint == "False":
80+
name = "{prefix}_version_setting_default".format(prefix = prefix)
7081
native.config_setting(
71-
name = prefix + "_version_setting_default",
82+
name = name,
7283
flag_values = flag_values | {
7384
Label("//python/config_settings:python_version"): "",
7485
},
7586
visibility = ["//visibility:private"],
7687
)
77-
target_settings = [prefix + "_version_setting_default"]
88+
target_settings = [name]
7889
else:
7990
fail(("Invalid set_python_version_constraint value: got {} {}, wanted " +
8091
"either the string 'True' or the string 'False'; " +

0 commit comments

Comments
 (0)