bazelbuild / bazelbuild/examples

Error No matching toolchains found for types @@bazel_tools//tools/jdk:runtime_toolchain_type.

Open
#400 7 comments 1 reaction 0 assignees View on GitHub
Dominant language
Starlark
Stars
957
Forks
578
Avg merge
3d 22h
Merged PRs (30d)
1

Description

CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3599#018d1aba-719c-4797-b00a-1d83dfafff2b
https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3608#018d2ef4-1d2c-446b-a314-c133272f58d9

Platform: Ubuntu

Logs:
```ERROR: /var/lib/buildkite-agent/builds/bk-docker-cf6t/bazel-org-repo-root/examples/android/jetpack-compose/app/src/main/BUILD.bazel:4:19: While resolving toolchains for target //app/src/main:lib_kt (1d1b4b7): No matching toolchains found for types @@bazel_tools//tools/jdk:runtime_toolchain_type.
To debug, rerun with --toolchain_resolution_debug='@@bazel_tools//tools/jdk:runtime_toolchain_type'
If platforms or toolchains are a new concept for you, we'd encourage reading https://bazel.build/concepts/platforms-intro.
(04:01:26) ERROR: Analysis of target '//app/src/main:app' failed; build aborted: Analysis failed
(04:01:26) INFO: Elapsed time: 3.047s, Critical Path: 0.02s
(04:01:26) INFO: 1 process: 1 internal.
(04:01:26) ERROR: Build did NOT complete successfully
(04:01:26) FAILED:`
```
```
Traceback (most recent call last):
File "/virtual_builtins_bzl/common/cc/cc_toolchain_alias.bzl", line 26, column 48, in _impl
File "/virtual_builtins_bzl/common/cc/cc_helper.bzl", line 217, column 13, in _find_cpp_toolchain
Error in fail: Unable to find a CC toolchain using toolchain resolution. Target: @@bazel_tools//tools/cpp:current_cc_toolchain, Platform: @@//:arm64-v8a, Exec platform: @@local_config_platform//:host
(02:20:31) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/051ad6a69d7a84f28cf16b88c532f996/external/bazel_tools/tools/cpp/BUILD:58:19: Analysis of target '@@bazel_tools//tools/cpp:current_cc_toolchain' failed
(02:20:31) ERROR: Analysis of target '//app/src/main:app' failed; build aborted: Analysis failed
```

Culprit: https://github.com/bazelbuild/bazel/commit/03490b9f72dc479c979afff6b1731a72787cba8b, https://github.com/bazelbuild/bazel/commit/8ba66188e378fe3df5db9549b3b9661d62cf93bb
Steps:
```
git clone -v https://github.com/bazelbuild/examples.git
git reset d18ce42623f136616e9512d713a47c33f9ad6a58 --hard
export USE_BAZEL_VERSION=3e7052824b54158d72e4b07d6330aa41a9857707
cd /android/jetpack-compose
bazel build --android_platforms=//:arm64-v8a --remote_download_outputs=all --enable_bzlmod //app/src/main:app
```
CC Greenteam @meteorcloudy

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.