Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Unable to specify base_url in python.toolchain() when using bzlmod #1172

Copy link
Copy link
Closed
@vadikmironov

Description

@vadikmironov
Issue body actions

🐞 bug report

Affected Rule

The issue is caused by the rule: python:extensions.bzl

Is this a regression?

Yes, the previous version in which this bug was not present was: works fine without bzlmod

Description

While trying to prepare my test repo for bzlmod switch, I've noticed that it seems to be no longer possible to override base_url location for python toolchains. This is a super useful feature for someone working behind a corporate firewall and maintaining a mirror of python-build-standalone artefacts.

🔬 Minimal Reproduction

Following example is perfectly valid when using WORKSPACE.bazel:

load("@rules_python//python:repositories.bzl", "python_register_toolchains")
python_register_toolchains(
    name = "python3_8_13",
    python_version = "3.8",
    base_url = "https://github.com/indygreg/python-build-standalone/releases/download",
)

but when defining a toolchain in bzlmod, there is simply no parameter to pass base_url value:

python = use_extension("@rules_python//python:extensions.bzl", "python")
python.toolchain(
    name = "python3_8_13",
    python_version = "3.8",
)

🔥 Exception or Error



None

🌍 Your Environment

Operating System:

  
Linux
  

Output of bazel version:

  
Bazelisk version: v1.16.0
Build label: 6.1.1
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Mar 15 15:44:56 2023 (1678895096)
Build timestamp: 1678895096
Build timestamp as int: 1678895096
  

Rules_python version:

  
bazel_dep(name = "rules_python", version = "0.20.0")
  

Anything else relevant?

jbgcarnes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.