mirror of https://github.com/bazelbuild/rules_cc
Update rules_cc to use the correct toolchain type (@bazel_tools//tools/cpp:toolchain_type).
PiperOrigin-RevId: 361158816 Change-Id: Ief011b23ddb9bdf3b49237f90fa631b6f916e8de
This commit is contained in:
parent
25193de8f5
commit
88ef31b429
|
@ -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
|
||||
|
|
|
@ -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"],
|
||||
)
|
||||
|
|
|
@ -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
|
||||
],
|
||||
)
|
||||
|
|
|
@ -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"],
|
||||
)
|
||||
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
|
|
@ -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"],
|
||||
)
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue