8000 rules_python bzlmod should register a default toolchain · Issue #1233 · bazel-contrib/rules_python · GitHub
[go: up one dir, main page]

Skip to content
rules_python bzlmod should register a default toolchain #1233
Closed
@rickeylev

Description

@rickeylev

🚀 feature request

Well, sort of a feature-parity / bug report, too; see below.

Relevant Rules

bzlmod module

Description

Today, users must manually specify a toolchain and manually register it. This adds friction and causes problems for a few reasons:

  1. User configs are more verbose. They end up having to specify a version and toolchain to use.
  2. What they specify above is somewhat misleading and can lead to surprising behavior because another module can specify a different toolchain and version, and it might be used instead (it depends on the order of register_toolchain calls)
  3. It's just a general barrier to entry; configuring the toolchain is extra steps that get in the way to just getting started. I, myself, have put off trying out various ideas and bug fixes because setting up a MODULE with all the boiler plate is a chore.

It's also worth noting that WORKSPACE builds already register a default toolchain -- whatever is found on the local system (@bazel_tools//tools/python:autodetecting_toolchain). This toolchain is problematic for various reasons, but that is the existing WORKSPACE-based behavior.

Describe the solution you'd like

Instead, rules_python should register a toolchain by default. This avoids the three issues above.

I propose that it register the most recent version of Python available. We should be clear that this is for convenience -- the default provided shouldn't be relied upon.

If a module needs a specific version, then it should use the multi-version rules.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0