google / googletest

GoogleTest - Google Testing and Mocking Framework
https://google.github.io/googletest/
BSD 3-Clause "New" or "Revised" License
34.96k stars 10.17k forks source link

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

Closed aaronsky closed 4 months ago

aaronsky commented 4 months ago

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

derekmauro commented 4 months ago

Thank you for reporting. It looks like you are correct. This will be patched soon.

derekmauro commented 4 months ago

Expect to see a 1.15.1 patch release soon. (Edit: Actually fixed in 1.15.2)