You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Correctly reference os-specific labels from central alias repo (#889)
* Correctly reference os-specific labels from central alias repo
The current aliases hardcode the bazel host os, which does not work when cross compiling.
* Update toolchains_repo.bzl
* fix: remove spaces from key in dict
Co-authored-by: Thulio Ferraz Assis <[email protected]>
alias(name = "files", actual = "@{py_repository}_{host_platform}//:files")
101
-
alias(name = "includes", actual = "@{py_repository}_{host_platform}//:includes")
102
-
alias(name = "libpython", actual = "@{py_repository}_{host_platform}//:libpython")
103
-
alias(name = "py3_runtime", actual = "@{py_repository}_{host_platform}//:py3_runtime")
104
-
alias(name = "python_headers", actual = "@{py_repository}_{host_platform}//:python_headers")
105
-
alias(name = "python_runtimes", actual = "@{py_repository}_{host_platform}//:python_runtimes")
106
-
alias(name = "python3", actual = "@{py_repository}_{host_platform}//:{python3_binary_path}")
102
+
alias(name = "files", actual = select({{":" + item: "@{py_repository}_" + item + "//:files" for item in PLATFORMS.keys()}}))
103
+
alias(name = "includes", actual = select({{":" + item: "@{py_repository}_" + item + "//:includes" for item in PLATFORMS.keys()}}))
104
+
alias(name = "libpython", actual = select({{":" + item: "@{py_repository}_" + item + "//:libpython" for item in PLATFORMS.keys()}}))
105
+
alias(name = "py3_runtime", actual = select({{":" + item: "@{py_repository}_" + item + "//:py3_runtime" for item in PLATFORMS.keys()}}))
106
+
alias(name = "python_headers", actual = select({{":" + item: "@{py_repository}_" + item + "//:python_headers" for item in PLATFORMS.keys()}}))
107
+
alias(name = "python_runtimes", actual = select({{":" + item: "@{py_repository}_" + item + "//:python_runtimes" for item in PLATFORMS.keys()}}))
108
+
alias(name = "python3", actual = select({{":" + item: "@{py_repository}_" + item + "//:" + ("python.exe" if "windows" in item else "bin/python3") for item in PLATFORMS.keys()}}))
107
109
""".format(
108
110
py_repository=rctx.attr.user_repository_name,
109
-
host_platform=host_platform,
110
-
python3_binary_path=python3_binary_path,
111
111
)
112
112
ifnotis_windows:
113
113
build_contents+="""\
114
-
alias(name = "pip", actual = "@{py_repository}_{host_platform}//:bin/pip")
114
+
alias(name = "pip", actual = select({{":" + item: "@{py_repository}_" + item + "//:python_runtimes" for item in PLATFORMS.keys() if "windows" not in item}}))
0 commit comments