Skip to content

[Bug]: Python toolchain in MODULE.bazel conflicts with downstream registered versions #4581

@aaronsky

Description

@aaronsky

Describe the issue

Forgive me if this has already been reported.

In 1.15.0 of googletest, when using Bzlmod and rules_python to register a toolchain, this line in googletest's MODULE.bazel interferes with any other subsequently registered toolchains. This is consistent with this disclaimer:

IMPORTANT: this should only be done in a root module, and may intefere with the toolchains rules_python registers.

Given that this makes googletest impossible to use in a repository with both C++ and Python, it would be great to see this line removed.

Steps to reproduce the problem

  1. Take the rules_python bzlmod example. Add googletest 1.15.0 as a bazel_dep to the MODULE.bazel.
  2. Try running any tests in that project.
  3. Observe that the Python toolchain used is the system Python, not either of the toolchains registered in MODULE.bazel.

What version of GoogleTest are you using?

1.15.0

What operating system and version are you using?

macOS 14.5

What compiler and version are you using?

python

What build system are you using?

N/A

Additional context

No response

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