diff --git a/cc/private/rules_impl/cc_flags_supplier.bzl b/cc/private/rules_impl/cc_flags_supplier.bzl index e026284..afd73e0 100644 --- a/cc/private/rules_impl/cc_flags_supplier.bzl +++ b/cc/private/rules_impl/cc_flags_supplier.bzl @@ -13,7 +13,7 @@ # limitations under the License. """Rule that provides the CC_FLAGS Make variable.""" -load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") +load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain") load("//cc:action_names.bzl", "CC_FLAGS_MAKE_VARIABLE_ACTION_NAME") load("//cc/private/rules_impl:cc_flags_supplier_lib.bzl", "build_cc_flags") @@ -30,6 +30,6 @@ cc_flags_supplier = rule( attrs = { "_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")), }, - toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], # copybara-use-repo-external-label + toolchains = use_cpp_toolchain(), # copybara-use-repo-external-label fragments = ["cpp"], ) diff --git a/examples/my_c_archive/my_c_archive.bzl b/examples/my_c_archive/my_c_archive.bzl index eb3648c..4ab2dd5 100644 --- a/examples/my_c_archive/my_c_archive.bzl +++ b/examples/my_c_archive/my_c_archive.bzl @@ -14,7 +14,7 @@ """Example showing how to create a rule that rules_cc can depend on.""" -load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") +load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain") load("@rules_cc//cc:action_names.bzl", "CPP_LINK_STATIC_LIBRARY_ACTION_NAME") load("//examples/my_c_compile:my_c_compile.bzl", "MyCCompileInfo") @@ -95,5 +95,5 @@ my_c_archive = rule( "_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")), }, fragments = ["cpp"], - toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], # copybara-use-repo-external-label + toolchains = use_cpp_toolchain(), # copybara-use-repo-external-label ) diff --git a/examples/my_c_compile/my_c_compile.bzl b/examples/my_c_compile/my_c_compile.bzl index 668c256..d78fe09 100644 --- a/examples/my_c_compile/my_c_compile.bzl +++ b/examples/my_c_compile/my_c_compile.bzl @@ -14,7 +14,7 @@ """Example showing how to create a rule that just compiles C sources.""" -load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") +load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain") load("@rules_cc//cc:action_names.bzl", "C_COMPILE_ACTION_NAME") MyCCompileInfo = provider(doc = "", fields = ["object"]) @@ -76,6 +76,6 @@ my_c_compile = rule( "src": attr.label(mandatory = True, allow_single_file = True), "_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")), }, - toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], # copybara-use-repo-external-label + toolchains = use_cpp_toolchain(), # copybara-use-repo-external-label fragments = ["cpp"], ) diff --git a/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl b/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl index 152521a..90100ba 100644 --- a/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl +++ b/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl @@ -14,7 +14,7 @@ """Example showing how to get CcToolchainInfo in a custom rule.""" -load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") +load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain") def _write_cc_toolchain_cpu_impl(ctx): cc_toolchain = find_cpp_toolchain(ctx) @@ -28,5 +28,5 @@ write_cc_toolchain_cpu = rule( attrs = { "_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")), }, - toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], # copybara-use-repo-external-label + toolchains = use_cpp_toolchain(), # copybara-use-repo-external-label )