google / emboss

Emboss is a tool for generating code that reads and writes binary data structures.
Apache License 2.0
67 stars 20 forks source link

Bazel: emboss_cpp_library fails with "you must include the '@bazel_tools//tools/cpp:toolchain_type' in the toolchains argument to your rule" #103

Closed BenjaminLawson closed 5 months ago

BenjaminLawson commented 5 months ago
ERROR: .../build/bazel/output_base/external/pigweed/pw_bluetooth/BUILD.bazel:103:18: in @com_google_emboss//:build_defs.bzl%_cc_emboss_aspect aspect on emboss_library rule @pigweed//pw_bluetooth:emboss_hci_common_ir: 
Traceback (most recent call last):
        File ".../build/bazel/output_base/external/com_google_emboss/build_defs.bzl", line 150, column 38, in _cc_emboss_aspect_impl
                cc_toolchain = find_cpp_toolchain(ctx, mandatory = True)
        File ".../build/bazel/output_base/external/bazel_tools/tools/cpp/toolchain_utils.bzl", line 43, column 17, in find_cpp_toolchain
                fail("In order to use find_cpp_toolchain, you must include the '%s' in the toolchains argument to your rule." % CPP_TOOLCHAIN_TYPE)
Error in fail: In order to use find_cpp_toolchain, you must include the '@bazel_tools//tools/cpp:toolchain_type' in the toolchains argument to your rule.
ERROR: Analysis of target '@pigweed//pw_bluetooth:emboss_hci_common_ir' failed

I think we need to add toolchains = @bazel_tools//tools/cpp:toolchain_type to _cc_emboss_aspect, but I'm new to Bazel so I'm not sure.