Add a consistent `python` interpreter symlink (#782)
When a Python repository is created, there is a difference between Unix/Windows for the path to the python interpreter.
This patch adds a symlink from the platform specific path to the interpreter.
This means that on either platform the `:python` target will always point to the interpreter.
diff --git a/python/repositories.bzl b/python/repositories.bzl
index 30c2841..ca54ab7 100644
--- a/python/repositories.bzl
+++ b/python/repositories.bzl
@@ -204,7 +204,7 @@
}}),
)
-exports_files(["{python_path}"])
+exports_files(["python", "{python_path}"])
py_runtime(
name = "py3_runtime",
@@ -223,6 +223,7 @@
python_path = python_bin,
python_version = python_short_version,
)
+ rctx.symlink(python_bin, "python")
rctx.file(STANDALONE_INTERPRETER_FILENAME, "# File intentionally left blank. Indicates that this is an interpreter repo created by rules_python.")
rctx.file("BUILD.bazel", build_content)