bazel-contrib / bazel-contrib/rules_foreign_cc

No matching toolchain for ninja_toolchain on arm64

Open
#1,305 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
737
Forks
270
PR merge metrics
No merged PRs in 30d

Description

Env:
I'm running OL8 docker on Apple Silicon and trying to build a C++ repo on it. There is a third-party which is being built using below cmake

While using the load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") I get below errors . Looking at the docs ideally it should be work right ?

`
WARNING: Build option --toolchain_resolution_debug has changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
INFO: ToolchainResolution: Performing resolution of @@bazel_tools//tools/cpp:toolchain_type for target platform @@platforms//host:host
ToolchainResolution: Toolchain @@bazel_tools~cc_configure_extension~local_config_cc//:cc-compiler-aarch64 is compatible with target plaform, searching for execution platforms:
ToolchainResolution: Compatible execution platform @@platforms//host:host
ToolchainResolution: All execution platforms have been assigned a @@bazel_tools//tools/cpp:toolchain_type toolchain, stopping
ToolchainResolution: Recap of selected @@bazel_tools//tools/cpp:toolchain_type toolchains for target platform @@platforms//host:host:
ToolchainResolution: Selected @@bazel_tools~cc_configure_extension~local_config_cc//:cc-compiler-aarch64 to run on execution platform @@platforms//host:host
ERROR: /root/dpp-workspace/third-party/rules_libevent/BUILD:26:6: While resolving toolchains for target //third-party/rules_libevent:event (47d3177): No matching toolchains found for types @@rules_foreign_cc~//toolchains:ninja_toolchain.
To debug, rerun with --toolchain_resolution_debug='@@rules_foreign_cc~//toolchains:ninja_toolchain'
`

Contributor guide

Open the contributing guide

Research direction

Reproduce the OL8 Docker-on-Apple-Silicon build using load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") and inspect third-party/rules_libevent/BUILD:26:6. Trace toolchain resolution for @@rules_foreign_cc~//toolchains:ninja_toolchain, using --toolchain_resolution_debug with that toolchain type; done means the CMake target resolves a matching Ninja toolchain on arm64.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, docker
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.