bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
22.77k stars 3.99k forks source link

No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. #16248

Open rajhlinux opened 1 year ago

rajhlinux commented 1 year ago

Description of the bug:

ERROR: /usr/home/user/.cache/bazel/_bazel_user/dce2e5f5daa25516313b94e75e515765/external/com_google_protobuf/BUILD:515:10: While resolving toolchains for target @com_google_protobuf//:protoc: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configure_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.

ERROR: Analysis of target '//mediapipe/examples/desktop/hello_world:hello_world' failed; build aborted: 

Pastebin to the error: https://pastebin.com/Cu57nw0b

screenshot

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

I followed the installation for c++:

$ bazel build --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 Then wanted to run c++ hello world example:

$ bazel run --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 mediapipe/examples/desktop/hello_world:hello_world

I get the error mentioned above.

Which operating system are you running Bazel on?

FreeBSD 13.1

What is the output of bazel info release?

release 5.3.0

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

No response

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

https://github.com/google/mediapipe.git
6cdc6443b6a7ed662744e2a2ce2d58d9c83e6d6f
6cdc6443b6a7ed662744e2a2ce2d58d9c83e6d6f

Have you found anything relevant by searching the web?

https://github.com/bazelbuild/bazel/issues/10134

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

Pastebin to the error: https://pastebin.com/Cu57nw0b

I have an AMD Radeon RX 580 GPU and would like to use MediaPipe using my GPU for the examples.

sgowroji commented 1 year ago

Hello @rajhlinux, Could you please confirm are you seeing the above issue with 5.3.0 ? Its resolved in 5.2.0. from this [PR](https://github.com/bazelbuild/bazel/commit/45f462893df4d55cee19c05ab01e051e229597a3#:~:text=.toString(),%7D) . Thanks!

sgowroji commented 1 year ago

Hello @rajhlinux, Could you please respond to my above comments. Otherwise its hard to provide any resolution to your query. Thanks!

mcramer-billgo commented 1 year ago

@sgowroji I am seeing this same error on bazel 5.3.2

github-actions[bot] commented 1 month ago

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.