Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bzlmod build occurred some resolution problem: No matching toolchains found for types @bazel_tools//tools/python:toolchain_type #17866

Closed
xushaoxiao opened this issue Mar 23, 2023 · 3 comments
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests P3 We're not considering working on this, but happy to review a PR. (No assignee) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: support / not a bug (process)

Comments

@xushaoxiao
Copy link

Description of the bug:

Hi Bazel teams,

I am doing build monorepo via bazel mod, my example github repo is https://github.com/xushaoxiao/allinone-via-bazelmod.
it occurred a error when i build the source code that includes rules_java and rules_python and other bazel rules, the details is "While resolving toolchains for target @bazel_tools//tools/jdk:proguard_whitelister: No matching toolchains found for types @bazel_tools//tools/python:toolchain_type.", conflicts between rules_java and rules_python imports in MODULE.bazel.

run the build command bazel build --enable_bzlmod ..., output error log details is:

LCNC02GG727MD6R:allinone-via-bazelmod shaoxixu$ bazel build --enable_bzlmod ...
Starting local Bazel server and connecting to it...
DEBUG: [email protected]/MODULE.bazel:8:6: WARNING: The rules_go Bazel module is still highly experimental and subject to change at any time. Only use it to try out bzlmod for now.
DEBUG: [email protected]/MODULE.bazel:7:6: WARNING: The bazel_gazelle Bazel module is still highly experimental and subject to change at any time. Only use it to try out bzlmod for now.
DEBUG: [email protected]/MODULE.bazel:7:6: WARNING: The rules_go Bazel module is still highly experimental and subject to change at any time. Only use it to try out bzlmod for now.
INFO: Repository rules_java~5.5.0~toolchains~remote_java_tools instantiated at:
  callstack not available
Repository rule http_archive defined at:
  /private/var/tmp/_bazel_shaoxixu/4d55580d1e210b29889ae47b4f95eda7/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
INFO: repository @rules_java~5.5.0~toolchains~remote_java_tools' used the following cache hits instead of downloading the corresponding file.
 * Hash '6efab6ca6e16e02c90e62bbd08ca65f61527984ab78564ea7ad7a2692b2ffdbb' for https://mirror.bazel.build/bazel_java_tools/releases/java/v12.0/java_tools-v12.0.zip
If the definition of 'repository @rules_java~5.5.0~toolchains~remote_java_tools' was updated, verify that the hashes were also updated.
ERROR: /private/var/tmp/_bazel_shaoxixu/4d55580d1e210b29889ae47b4f95eda7/external/bazel_tools/tools/jdk/BUILD:393:10: While resolving toolchains for target @bazel_tools//tools/jdk:proguard_whitelister: No matching toolchains found for types @bazel_tools//tools/python:toolchain_type.
To debug, rerun with --toolchain_resolution_debug='@bazel_tools//tools/python:toolchain_type'
If platforms or toolchains are a new concept for you, we'd encourage reading https://bazel.build/concepts/platforms-intro.
ERROR: Analysis of target '//grpc_ecosystem/protobuf/support:pagination_java_proto' failed; build aborted: 
INFO: Elapsed time: 26.695s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (54 packages loaded, 1029 targets configured)
    Fetching repository @rules_go~0.38.1~go_sdk~go_default_sdk; Downloading and extracting Go toolchain 14s
    Fetching /private/var/tmp/_bazel_shaoxixu/4d55580d1e210b29889ae47b4f95eda7/external/rules_java~5.5.0~toolchains~remote_java_tools; Extracting java_tools-v12.0.zip

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. git clone https://github.com/xushaoxiao/allinone-via-bazelmod.git
  2. bazel build --enable_bzlmod ...

Which operating system are you running Bazel on?

Mac os

What is the output of bazel info release?

6.1.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

LCNC02GG727MD6R:allinone-via-bazelmod shaoxixu$ bazel info release
release 6.1.1-homebrew

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

LCNC02GG727MD6R:allinone-via-bazelmod shaoxixu$ git remote get-url origin
[email protected]:xushaoxiao/allinone-via-bazelmod.git

LCNC02GG727MD6R:allinone-via-bazelmod shaoxixu$ git rev-parse HEAD
d6535bc02673aa0dea0bb96fb39dfa14a3fce5c5

Have you found anything relevant by searching the web?

Not found any issues in internet.

Any other information, logs, or outputs that you want to share?

No response

@ShreeM01 ShreeM01 added stale Issues or PRs that are stale (no activity for 30 days) type: bug team-Rules-Java Issues for Java rules untriaged team-Rules-Python Native rules for Python and removed stale Issues or PRs that are stale (no activity for 30 days) labels Mar 23, 2023
@sgowroji sgowroji added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. area-Bzlmod Bzlmod-specific PRs, issues, and feature requests and removed team-Rules-Java Issues for Java rules team-Rules-Python Native rules for Python labels Mar 24, 2023
@Wyverald
Copy link
Member

Same here -- could you please reduce the repro case to a minimal one? Looking through your "all-in-one" repro is quite time consuming.

@xushaoxiao
Copy link
Author

Same here -- could you please reduce the repro case to a minimal one? Looking through your "all-in-one" repro is quite time consuming.

Hi Xudong @Wyverald , thanks for reaching out this issue. the name is "all in one", but currently this repo is small, only includes simple code, a few bazel target exists.

@meisterT meisterT changed the title bzlmod build occurred some resoluation problem: No matching toolchains found for types @bazel_tools//tools/python:toolchain_type bzlmod build occurred some resolution problem: No matching toolchains found for types @bazel_tools//tools/python:toolchain_type Apr 4, 2023
@meteorcloudy meteorcloudy added P3 We're not considering working on this, but happy to review a PR. (No assignee) type: support / not a bug (process) and removed untriaged type: bug labels Apr 4, 2023
@Wyverald
Copy link
Member

Closing as inactionable.

@Wyverald Wyverald closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests P3 We're not considering working on this, but happy to review a PR. (No assignee) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: support / not a bug (process)
Projects
None yet
Development

No branches or pull requests

5 participants