Remove `--python_path` flag
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
This had to be broken out of #7375 because it turns out `python_path` is [used on windows](https://github.com/bazelbuild/bazel/blob/49107ad79ef08811db22636928dfd113a9acf902/src/main/cpp/blaze_util_windows.cc#L1483-L1491) to [communicate](https://github.com/bazelbuild/bazel/blob/f59fad7c97ed9b4d5ae577e6ef50cefd3927e4bd/src/main/cpp/blaze_util_platform.h#L265-L269) the location of the Python interpreter even when it's not otherwise available on the `PATH` at execution time.
We can possibly switch this bit of client-server communication to use a hidden flag in place of `--python_path`. Alternatively (and probably preferably), we can replace this logic with a repo rule that detects the host platform's Python interpreter, and feed that into the Python toolchain. Another option is to deprecate this bit of niceness and instead require that the interpreter either be available on `PATH` at execution time or else have its path embedded into an appropriate `py_runtime` of a toolchain definition.
Contributor guide
Research direction
Start by reading the Windows handling in src/main/cpp/blaze_util_windows.cc and the communication details in src/main/cpp/blaze_util_platform.h. Compare the proposed approaches for replacing or deprecating --python_path and determine how Python interpreter discovery should work afterward. Done means the flag is removed without losing the intended Windows interpreter behavior, with tests covering the chosen design.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- build-system
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100