From 58ed930008c2288155c23bf547389e7b3fd73cc8 Mon Sep 17 00:00:00 2001 From: Matt Clarkson Date: Fri, 5 Aug 2022 12:16:00 +0100 Subject: [PATCH] Add a consistent `python` interpreter symlink 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. --- python/repositories.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/repositories.bzl b/python/repositories.bzl index 30c284191a..ca54ab717e 100644 --- a/python/repositories.bzl +++ b/python/repositories.bzl @@ -204,7 +204,7 @@ cc_import( }}), ) -exports_files(["{python_path}"]) +exports_files(["python", "{python_path}"]) py_runtime( name = "py3_runtime", @@ -223,6 +223,7 @@ py_runtime_pair( 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)