From ab8b67a0abc63c4d9958ab490f1d17de5a64798e Mon Sep 17 00:00:00 2001 From: Christopher Peterson Sauer Date: Tue, 5 Apr 2022 23:58:12 -0700 Subject: [PATCH] Move examples from deprecated find_cpp_toolchain -> find_cc_toolchain --- examples/my_c_archive/my_c_archive.bzl | 4 ++-- examples/my_c_compile/my_c_compile.bzl | 4 ++-- examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/my_c_archive/my_c_archive.bzl b/examples/my_c_archive/my_c_archive.bzl index 43eaf80..cee73df 100644 --- a/examples/my_c_archive/my_c_archive.bzl +++ b/examples/my_c_archive/my_c_archive.bzl @@ -15,11 +15,11 @@ """Example showing how to create a rule that rules_cc can depend on.""" load("@rules_cc//cc:action_names.bzl", "CPP_LINK_STATIC_LIBRARY_ACTION_NAME") -load("@rules_cc//cc:toolchain_utils.bzl", "find_cpp_toolchain") +load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain") load("//examples/my_c_compile:my_c_compile.bzl", "MyCCompileInfo") def _my_c_archive_impl(ctx): - cc_toolchain = find_cpp_toolchain(ctx) + cc_toolchain = find_cc_toolchain(ctx) object_file = ctx.attr.object[MyCCompileInfo].object output_file = ctx.actions.declare_file(ctx.label.name + ".a") diff --git a/examples/my_c_compile/my_c_compile.bzl b/examples/my_c_compile/my_c_compile.bzl index d650468..a766a92 100644 --- a/examples/my_c_compile/my_c_compile.bzl +++ b/examples/my_c_compile/my_c_compile.bzl @@ -15,7 +15,7 @@ """Example showing how to create a rule that just compiles C sources.""" load("@rules_cc//cc:action_names.bzl", "C_COMPILE_ACTION_NAME") -load("@rules_cc//cc:toolchain_utils.bzl", "find_cpp_toolchain") +load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain") MyCCompileInfo = provider(doc = "", fields = ["object"]) @@ -24,7 +24,7 @@ DISABLED_FEATURES = [ ] def _my_c_compile_impl(ctx): - cc_toolchain = find_cpp_toolchain(ctx) + cc_toolchain = find_cc_toolchain(ctx) source_file = ctx.file.src output_file = ctx.actions.declare_file(ctx.label.name + ".o") feature_configuration = cc_common.configure_features( 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 e854b09..f9a92ba 100644 --- a/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl +++ b/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl @@ -14,10 +14,10 @@ """Example showing how to get CcToolchainInfo in a custom rule.""" -load("@rules_cc//cc:toolchain_utils.bzl", "find_cpp_toolchain") +load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain") def _write_cc_toolchain_cpu_impl(ctx): - cc_toolchain = find_cpp_toolchain(ctx) + cc_toolchain = find_cc_toolchain(ctx) output = ctx.actions.declare_file(ctx.label.name + "_cpu") ctx.actions.write(output, cc_toolchain.cpu) return [DefaultInfo(files = depset([output]))]