You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All cc_test targets fail to build when targeting linux-arm64 because of a failure to detect a suitable toolchain. Toolchain resolution for tests apparently differs from library and binary targets, presumably because tests are built for the execution platform rather than the target platform by default.
Reproduction Steps
To reproduce, run the following on an x86_64 machine with Linux and version 12.2.0 of aarch64-linux-gnu-gcc installed:
% bazel build --aarch64_linux_gnu_gcc_version="12.2.0" --host_platform=//:aarch64_linux_gnu_gcc-linux-x86_64 --platforms=//:linux-arm64 --toolchain_resolution_debug='.*' ...INFO: Build option --toolchain_resolution_debug has changed, discarding analysis cache.INFO: ToolchainResolution: Target platform //:linux-arm64: Selected execution platform //:aarch64_linux_gnu_gcc-linux-x86_64,INFO: ToolchainResolution: Target platform //:linux-arm64: Selected execution platform //:aarch64_linux_gnu_gcc-linux-x86_64,INFO: ToolchainResolution: Type @bazel_tools//tools/cpp:toolchain_type: target platform //:linux-arm64: execution //:aarch64_linux_gnu_gcc-linux-x86_64: Selected toolchain //bazel/toolchain:aarch64_linux_gnu_gcc-linux-x86_64INFO: ToolchainResolution: Type @bazel_tools//tools/cpp:toolchain_type: target platform //:linux-arm64: Rejected toolchain //bazel/toolchain:clang-linux-x86_64; mismatching values: x86_64INFO: ToolchainResolution: Type @bazel_tools//tools/cpp:toolchain_type: target platform //:linux-arm64: Rejected toolchain //bazel/toolchain:gcc-linux-x86_64; mismatching values: x86_64INFO: ToolchainResolution: Type @bazel_tools//tools/cpp:toolchain_type: target platform //:linux-arm64: execution //:aarch64_linux_gnu_gcc-linux-x86_64: Selected toolchain //bazel/toolchain:aarch64_linux_gnu_gcc-linux-x86_64INFO: ToolchainResolution: Type @bazel_tools//tools/cpp:toolchain_type: target platform //:linux-arm64: Rejected toolchain //bazel/toolchain:clang-linux-x86_64; mismatching values: x86_64INFO: ToolchainResolution: Type @bazel_tools//tools/cpp:toolchain_type: target platform //:linux-arm64: Rejected toolchain //bazel/toolchain:gcc-linux-x86_64; mismatching values: x86_64INFO: ToolchainResolution: Target platform //:linux-arm64: Selected execution platform //:aarch64_linux_gnu_gcc-linux-x86_64, type @bazel_tools//tools/cpp:toolchain_type -> toolchain //bazel/toolchain:aarch64_linux_gnu_gcc-linux-x86_64INFO: ToolchainResolution: Target platform //:linux-arm64: Selected execution platform //:aarch64_linux_gnu_gcc-linux-x86_64, type @bazel_tools//tools/cpp:toolchain_type -> toolchain //bazel/toolchain:aarch64_linux_gnu_gcc-linux-x86_64INFO: ToolchainResolution: Target platform //:aarch64_linux_gnu_gcc-linux-x86_64: Selected execution platform //:aarch64_linux_gnu_gcc-linux-x86_64,INFO: ToolchainResolution: Target platform //:linux-arm64: Selected execution platform //:aarch64_linux_gnu_gcc-linux-x86_64,INFO: ToolchainResolution: Type @rules_foreign_cc//toolchains:m4_toolchain: target platform //:linux-arm64: execution //:aarch64_linux_gnu_gcc-linux-x86_64: Selected toolchain @rules_foreign_cc//toolchains:preinstalled_m4INFO: ToolchainResolution: Type @rules_foreign_cc//toolchains:automake_toolchain: target platform //:linux-arm64: execution //:aarch64_linux_gnu_gcc-linux-x86_64: Selected toolchain @rules_foreign_cc//toolchains:preinstalled_automakeINFO: ToolchainResolution: Target platform //:aarch64_linux_gnu_gcc-linux-x86_64: Selected execution platform //:aarch64_linux_gnu_gcc-linux-x86_64,INFO: ToolchainResolution: Type @rules_foreign_cc//toolchains:pkgconfig_toolchain: target platform //:linux-arm64: execution //:aarch64_linux_gnu_gcc-linux-x86_64: Selected toolchain @rules_foreign_cc//toolchains:preinstalled_pkgconfigINFO: ToolchainResolution: Type @rules_foreign_cc//toolchains:make_toolchain: target platform //:linux-arm64: execution //:aarch64_linux_gnu_gcc-linux-x86_64: Selected toolchain @rules_foreign_cc//toolchains:preinstalled_makeINFO: ToolchainResolution: Type @rules_foreign_cc//toolchains:autoconf_toolchain: target platform //:linux-arm64: execution //:aarch64_linux_gnu_gcc-linux-x86_64: Selected toolchain @rules_foreign_cc//toolchains:preinstalled_autoconfINFO: ToolchainResolution: Type @rules_foreign_cc//foreign_cc/private/framework:shell_toolchain: target platform //:linux-arm64: execution //:aarch64_linux_gnu_gcc-linux-x86_64: Selected toolchain @rules_foreign_cc_framework_toolchain_linux//:commandsINFO: ToolchainResolution: Target platform //:linux-arm64: Selected execution platform //:aarch64_linux_gnu_gcc-linux-x86_64, type @rules_foreign_cc//toolchains:autoconf_toolchain -> toolchain @rules_foreign_cc//toolchains:preinstalled_autoconf, type @rules_foreign_cc//toolchains:m4_toolchain -> toolchain @rules_foreign_cc//toolchains:preinstalled_m4, type @rules_foreign_cc//foreign_cc/private/framework:shell_toolchain -> toolchain @rules_foreign_cc_framework_toolchain_linux//:commands, type @bazel_tools//tools/cpp:toolchain_type -> toolchain //bazel/toolchain:aarch64_linux_gnu_gcc-linux-x86_64, type @rules_foreign_cc//toolchains:pkgconfig_toolchain -> toolchain @rules_foreign_cc//toolchains:preinstalled_pkgconfig, type @rules_foreign_cc//toolchains:automake_toolchain -> toolchain @rules_foreign_cc//toolchains:preinstalled_automake, type @rules_foreign_cc//toolchains:make_toolchain -> toolchain @rules_foreign_cc//toolchains:preinstalled_makeINFO: ToolchainResolution: Type @bazel_tools//tools/cpp:toolchain_type: target platform //:aarch64_linux_gnu_gcc-linux-x86_64: Rejected toolchain //bazel/toolchain:aarch64_linux_gnu_gcc-linux-x86_64; mismatching values: arm64INFO: ToolchainResolution: Type @bazel_tools//tools/cpp:toolchain_type: execution platform //:aarch64_linux_gnu_gcc-linux-x86_64: Rejected toolchain //bazel/toolchain:clang-linux-x86_64; mismatching values: clangINFO: ToolchainResolution: Type @bazel_tools//tools/cpp:toolchain_type: execution platform //:aarch64_linux_gnu_gcc-linux-x86_64: Rejected toolchain //bazel/toolchain:gcc-linux-x86_64; mismatching values: gccINFO: ToolchainResolution: Type @bazel_tools//tools/cpp:toolchain_type: target platform //:aarch64_linux_gnu_gcc-linux-x86_64: No toolchains found.ERROR: /home/tlon/.cache/bazel/_bazel_tlon/d85bfd16708db53fe097086a278bf2d0/external/remote_coverage_tools/BUILD:9:12: While resolving toolchains for target @remote_coverage_tools//:Main: 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 '//pkg/noun:nock_tests' failed; build aborted:INFO: Elapsed time: 0.271sINFO: 0 processes.FAILED: Build did NOT complete successfully (1 packages loaded, 1225 targets configu\red)
Description
All
cc_test
targets fail to build when targetinglinux-arm64
because of a failure to detect a suitable toolchain. Toolchain resolution for tests apparently differs from library and binary targets, presumably because tests are built for the execution platform rather than the target platform by default.Reproduction Steps
To reproduce, run the following on an
x86_64
machine with Linux and version 12.2.0 ofaarch64-linux-gnu-gcc
installed:Related
The text was updated successfully, but these errors were encountered: