From 1a538e330825f1ef528cc0a9b4d5caf44b76f7f8 Mon Sep 17 00:00:00 2001 From: pcloudy Date: Thu, 14 Sep 2017 10:36:02 +0200 Subject: Update Windows doc about building Python BAZEL_PYTHON was only used for the old MSVC python wrapper script. After we use wrapper-free CROSSTOOL by default, it's not used anymore. It has nothing to do with building Python rules. The correct way to specify python interpreter is to use --python_path flag. RELNOTES: None PiperOrigin-RevId: 168655953 --- site/docs/windows.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'site') diff --git a/site/docs/windows.md b/site/docs/windows.md index ef32c292a2..22d02449f8 100644 --- a/site/docs/windows.md +++ b/site/docs/windows.md @@ -155,14 +155,19 @@ To build Python targets, you need: Both Python 2 and Python 3 are supported. - Bazel tries to locate the Python runtime the first time you build any - target. To tell Bazel where Python is, you can set the `BAZEL_PYTHON` - environment variable to the Python interpreter's path. For example: + To tell Bazel where Python is, you can use `--python_path=`. + For example: ``` - set BAZEL_PYTHON=C:\Python27\python.exe + bazel build --python_path=C:/Python27/python.exe ... ``` + If `--python_path` is not specified, Bazel uses `python.exe` as + the interpreter and the binary looks for it in `$PATH` during runtime. + If it is not in `$PATH`(for example, when you use `py_binary` as an action's + executable, Bazel will sanitize `$PATH`), then the execution will fail. + + On Windows, Bazel builds two output files for `py_binary` rules: * a self-extracting zip file -- cgit v1.2.3