8000 python_register_toolchains defs.bzl "interpreter" symbol not found in v1.0.0 · Issue #2494 · bazel-contrib/rules_python · GitHub
[go: up one dir, main page]

Skip to content
python_register_toolchains defs.bzl "interpreter" symbol not found in v1.0.0 #2494
@mikex-oss

Description

@mikex-oss

🐞 bug report

Affected Rule

The issue is caused by the rule: python_register_toolchains

Is this a regression?

Yes, the previous version in which this bug was not present was: 0.40.0

Description

A clear and concise description of the problem...

Our existing Python toolchain registration WORKSPACE setup follows the docs at https://rules-python.readthedocs.io/en/latest/toolchains.html#workspace-toolchain-registration. This code no longer works in the latest rules_python release because the symbol cannot be found.

https://github.com/google/xls/blob/a1f5872de1b6a186c2392dfdf630d31ccef1a1f0/dependency_support/initialize_external.bzl#L22C43-L22C52

🔬 Minimal Reproduction

# WORKSPACE
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_python",
    sha256 = "4f7e2aa1eb9aa722d96498f5ef514f426c1f55161c3c9ae628c857a7128ceb07",
    strip_prefix = "rules_python-1.0.0",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.0.0/rules_python-1.0.0.tar.gz",
)

load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()

load("@rules_python//python:repositories.bzl", "python_register_toolchains")

python_register_toolchains(
    name = "python_3_11",
    # Available versions are listed in @rules_python//python:versions.bzl.
    # We recommend using the same version your team is already standardized on.
    python_version = "3.11",
)

load("@python_3_11//:defs.bzl", "interpreter")

> bazel fetch --noenable_bzlmod

🔥 Exception or Error




 load("@python_3_11//:defs.bzl", "interpreter")
Error: file '@project_python//:defs.bzl' does not contain symbol 'interpreter'

🌍 Your Environment

Operating System:

  
Ubuntu 22.04 (GCP Docker)
  

Output of bazel version:

  
7.4.1
  

Rules_python version:

  
1.0.0
  

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

      0