diff --git a/cc/find_cc_toolchain.bzl b/cc/find_cc_toolchain.bzl index c520f97..463e79a 100644 --- a/cc/find_cc_toolchain.bzl +++ b/cc/find_cc_toolchain.bzl @@ -40,7 +40,7 @@ Returns the current `CcToolchainInfo`. foo = rule( implementation = _foo_impl, toolchains = [ - "@rules_cc//cc:toolchain_type", # copybara-use-repo-external-label + "@bazel_tools//tools/cpp:toolchain_type", # copybara-use-repo-external-label ], ) @@ -63,9 +63,9 @@ Returns the current `CcToolchainInfo`. # Check the incompatible flag for toolchain resolution. if hasattr(cc_common, "is_cc_toolchain_resolution_enabled_do_not_use") and cc_common.is_cc_toolchain_resolution_enabled_do_not_use(ctx = ctx): - if not "//cc:toolchain_type" in ctx.toolchains: + if not "@bazel_tools//tools/cpp:toolchain_type" in ctx.toolchains: # copybara-use-repo-external-label fail("In order to use find_cc_toolchain, your rule has to depend on C++ toolchain. See find_cc_toolchain.bzl docs for details.") - toolchain_info = ctx.toolchains["//cc:toolchain_type"] + toolchain_info = ctx.toolchains["@bazel_tools//tools/cpp:toolchain_type"] # copybara-use-repo-external-label if hasattr(toolchain_info, "cc_provider_in_toolchain") and hasattr(toolchain_info, "cc"): return toolchain_info.cc return toolchain_info diff --git a/cc/private/rules_impl/cc_flags_supplier.bzl b/cc/private/rules_impl/cc_flags_supplier.bzl index 252103c..f15f1c2 100644 --- a/cc/private/rules_impl/cc_flags_supplier.bzl +++ b/cc/private/rules_impl/cc_flags_supplier.bzl @@ -30,7 +30,7 @@ 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"], + toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], # copybara-use-repo-external-label incompatible_use_toolchain_transition = True, fragments = ["cpp"], ) diff --git a/cc/private/rules_impl/compiler_flag.bzl b/cc/private/rules_impl/compiler_flag.bzl index 4a59a03..1487ccd 100644 --- a/cc/private/rules_impl/compiler_flag.bzl +++ b/cc/private/rules_impl/compiler_flag.bzl @@ -26,6 +26,6 @@ compiler_flag = rule( "_cc_toolchain": attr.label(default = Label("//cc:current_cc_toolchain")), }, toolchains = [ - "@rules_cc//cc:toolchain_type", # copybara-use-repo-external-label + "@bazel_tools//tools/cpp:toolchain_type", # copybara-use-repo-external-label ], ) diff --git a/examples/experimental_cc_shared_library.bzl b/examples/experimental_cc_shared_library.bzl index 608f4c6..6793e96 100644 --- a/examples/experimental_cc_shared_library.bzl +++ b/examples/experimental_cc_shared_library.bzl @@ -460,7 +460,7 @@ cc_shared_library = rule( "_experimental_debug": attr.label(default = "//examples:experimental_debug"), "_incompatible_link_once": attr.label(default = "//examples:incompatible_link_once"), }, - toolchains = ["@rules_cc//cc:toolchain_type"], # copybara-use-repo-external-label + toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], # 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 86cebe9..b4138af 100644 --- a/examples/my_c_archive/my_c_archive.bzl +++ b/examples/my_c_archive/my_c_archive.bzl @@ -95,6 +95,6 @@ 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"], + toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], # copybara-use-repo-external-label incompatible_use_toolchain_transition = True, ) diff --git a/examples/my_c_compile/my_c_compile.bzl b/examples/my_c_compile/my_c_compile.bzl index edb839c..f29207e 100644 --- a/examples/my_c_compile/my_c_compile.bzl +++ b/examples/my_c_compile/my_c_compile.bzl @@ -76,7 +76,7 @@ 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"], + toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], # copybara-use-repo-external-label incompatible_use_toolchain_transition = True, 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 7830240..b4e63a3 100644 --- a/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl +++ b/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl @@ -28,6 +28,6 @@ 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"], + toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], # copybara-use-repo-external-label incompatible_use_toolchain_transition = True, )