bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Remove `--python_path` flag

Open brandjon opened this issue 6 years ago • 4 comments

This had to be broken out of #7375 because it turns out python_path is used on windows to communicate 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.

brandjon avatar Mar 29 '19 19:03 brandjon

Blocked in part on #7844.

brandjon avatar Mar 29 '19 19:03 brandjon

Looks like there's some background on the windows workaround in #3717.

brandjon avatar Mar 29 '19 19:03 brandjon

Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.

sgowroji avatar Feb 16 '23 08:02 sgowroji

This is more important to address as we are moving out flags to rules_python: https://github.com/bazelbuild/bazel/pull/27792

Otherwise, it means rules_python has to be always fetched on Windows.

meteorcloudy avatar Dec 03 '25 08:12 meteorcloudy

@rickeylev Do you have any idea how to remove the need of --python_path on Windows? I guess the biggest problem we need to figure out is how to make sure py_binary can find the python binary for the launcher?

Currently, I'm having some test failures in https://github.com/bazelbuild/bazel/pull/27924

meteorcloudy avatar Dec 11 '25 11:12 meteorcloudy

OK, this is probably not an issue in rules_python, found a fix for the failure windows tests while removing the use of --python_path. https://github.com/bazelbuild/bazel/pull/27924

meteorcloudy avatar Dec 11 '25 13:12 meteorcloudy