Skip to content

Running latest with latest rules_python fails on trying to use Python 3.8 #209

@Ahajha

Description

@Ahajha

Repro:
I have a local rules_python checked out at ~/Documents/rules_python, at the current latest commit: 2a2e136c2a4e393f5c84d90684680e01690278e3

Going to e2e/pdm/vendored_lock_file_bzlmod (probably will fail in the same way with others) I get:

$ bazel build ... --override_module=rules_python=~/Documents/rules_python
INFO: Repository rules_pycross++toolchains+pycross_toolchains instantiated at:
  <builtin>: in <toplevel>
Repository rule pycross_toolchains_repo defined at:
  /home/alextrotta/.cache/bazel/_bazel_alextrotta/e0ec58afde134c1ece0f1b3d6f11eb23/external/rules_pycross+/pycross/private/toolchain_helpers.bzl:401:42: in <toplevel>
ERROR: /home/alextrotta/.cache/bazel/_bazel_alextrotta/e0ec58afde134c1ece0f1b3d6f11eb23/external/rules_pycross+/pycross/private/toolchain_helpers.bzl:20:9: An error occurred during the fetch of repository 'rules_pycross++toolchains+pycross_toolchains':
   Traceback (most recent call last):
        File "/home/alextrotta/.cache/bazel/_bazel_alextrotta/e0ec58afde134c1ece0f1b3d6f11eb23/external/rules_pycross+/pycross/private/toolchain_helpers.bzl", line 389, column 46, in _pycross_toolchain_repo_impl
                computed_toolchains = _compute_toolchains(
        File "/home/alextrotta/.cache/bazel/_bazel_alextrotta/e0ec58afde134c1ece0f1b3d6f11eb23/external/rules_pycross+/pycross/private/toolchain_helpers.bzl", line 138, column 36, in _compute_toolchains
                for version in _dedupe_versions(python_versions):
        File "/home/alextrotta/.cache/bazel/_bazel_alextrotta/e0ec58afde134c1ece0f1b3d6f11eb23/external/rules_pycross+/pycross/private/toolchain_helpers.bzl", line 71, column 43, in _dedupe_versions
                micro_version = _get_micro_version(version)
        File "/home/alextrotta/.cache/bazel/_bazel_alextrotta/e0ec58afde134c1ece0f1b3d6f11eb23/external/rules_pycross+/pycross/private/toolchain_helpers.bzl", line 20, column 9, in _get_micro_version
                fail("Unknown Python version: {}".format(version))
Error in fail: Unknown Python version: 3.8
ERROR: Analysis of target '//:test_regex' failed; build aborted: Unknown Python version: 3.8
INFO: Elapsed time: 3.960s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
FAILED: 
    Fetching repository @@rules_pycross++environments+rules_pycross_e2e_environments; starting

rules_python recently dropped 3.8 support, which is definitely related, but I don't see any explicit references to it so this is likely a bug, but I don't know if the bug is here or with rules_python, the stack trace seems to suggest here though.

I'm seeing the same issue with an internal codebase as well, but this was easy to repro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions