Skip to content

gazelle not working with windows #1163

@chrislovecnm

Description

@chrislovecnm

🐞 bug report

Affected Rule

Gazelle is not finding the default Python interpreter when configuring gazelle with bzlmod.

Is this a regression?

No.

Description

When generating the modules_map for gazelle, the rules are not finding Python in its default path.

ERROR: An error occurred during the fetch of repository 'rules_python~override~pip~pip_typing_extensions':
   Traceback (most recent call last):
        File "C:/users/chris/_bazel_chris/r4du22do/external/rules_python~override/python/pip_install/pip_repository.bzl", line 658, column 53, in _whl_library_impl
                python_interpreter = _resolve_python_interpreter(rctx)
        File "C:/users/chris/_bazel_chris/r4du22do/external/rules_python~override/python/pip_install/pip_repository.bzl", line 80, column 17, in _resolve_python_interpreter
                fail("python interpreter `{}` not found in PATH".format(python_interpreter))
Error in fail: python interpreter `python.exe` not found in PATH

🔬 Minimal Reproduction

See #1155

🔥 Exception or Error

Run:

bazelisk.exe build //:modules_map

Part of the error will end with:

ERROR: An error occurred during the fetch of repository 'rules_python~override~pip~pip_typing_extensions':
   Traceback (most recent call last):
        File "C:/users/chris/_bazel_chris/r4du22do/external/rules_python~override/python/pip_install/pip_repository.bzl", line 658, column 53, in _whl_library_impl
                python_interpreter = _resolve_python_interpreter(rctx)
        File "C:/users/chris/_bazel_chris/r4du22do/external/rules_python~override/python/pip_install/pip_repository.bzl", line 80, column 17, in _resolve_python_interpreter
                fail("python interpreter `{}` not found in PATH".format(python_interpreter))
Error in fail: python interpreter `python.exe` not found in PATH
ERROR: <builtin>: fetching whl_library rule @rules_python~override//python:rules_python~override~pip~pip_typing_extensions: Traceback (most recent call last):
        File "C:/users/chris/_bazel_chris/r4du22do/external/rules_python~override/python/pip_install/pip_repository.bzl", line 658, column 53, in _whl_library_impl
                python_interpreter = _resolve_python_interpreter(rctx)
        File "C:/users/chris/_bazel_chris/r4du22do/external/rules_python~override/python/pip_install/pip_repository.bzl", line 80, column 17, in _resolve_python_interpreter
                fail("python interpreter `{}` not found in PATH".format(python_interpreter))
Error in fail: python interpreter `python.exe` not found in PATH
ERROR: C:/users/chris/_bazel_chris/r4du22do/external/rules_python~override~pip~pip/typing_extensions/BUILD.bazel:13:6: @rules_python~override~pip~pip//typing_extensions:whl depends on @rules_python~override~pip~pip_typing_extensions//:whl in repository @rules_python~override~pip~pip_typing_extensions which failed to fetch. no such package '@rules_python~override~pip~pip_typing_extensions//': python interpreter `python.exe` not found in PATH
ERROR: Analysis of target '//:modules_map' failed; build aborted:
INFO: Elapsed time: 0.133s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 5 targets configured)

🌍 Your Environment

Operating System:

Windows 10

C:\Users\chris\Workspace\rules_python\examples\bzlmod>bazelisk version
Bazelisk version: v1.15.0
Build label: 6.0.0
Build target: bazel-out/x64_windows-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Dec 19 15:54:13 2022 (1671465253)
Build timestamp: 1671465253
Build timestamp as int: 1671465253

Rules_python version:

main

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions