From 7e5f6a9391b4446b34afcfd32f5fcd7195dfb675 Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 6 Nov 2024 06:47:33 -0800 Subject: [PATCH] Remove defs.bzl usages BEGIN_PUBLIC Remove defs.bzl usages END_PUBLIC PiperOrigin-RevId: 693709660 Change-Id: I1c92999e23c153f865ad68ab802d907abaea74eb --- BUILD | 2 +- cc/private/toolchain/BUILD | 7 +++++-- cc/private/toolchain/BUILD.empty.tpl | 4 +++- cc/private/toolchain/BUILD.static.bsd | 4 +++- cc/private/toolchain/BUILD.tpl | 3 ++- cc/private/toolchain/BUILD.windows.tpl | 4 +++- examples/custom_toolchain/BUILD | 4 +++- examples/my_c_archive/BUILD | 3 ++- examples/rule_based_toolchain/BUILD.bazel | 2 +- examples/rule_based_toolchain/dynamic_answer/BUILD.bazel | 3 ++- examples/rule_based_toolchain/static_answer/BUILD.bazel | 2 +- tests/compiler_settings/BUILD | 2 +- tests/load_from_macro/BUILD | 2 +- tests/simple_binary/BUILD | 2 +- tests/system_library/BUILD | 2 +- 15 files changed, 30 insertions(+), 16 deletions(-) diff --git a/BUILD b/BUILD index 1ed7987..fc7b2da 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,4 @@ -load("//cc:defs.bzl", "cc_library") +load("//cc:cc_library.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) diff --git a/cc/private/toolchain/BUILD b/cc/private/toolchain/BUILD index 557a6a7..5c30925 100644 --- a/cc/private/toolchain/BUILD +++ b/cc/private/toolchain/BUILD @@ -1,5 +1,3 @@ -load("//cc:defs.bzl", "cc_flags_supplier", "cc_library", "compiler_flag") - # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,6 +12,11 @@ load("//cc:defs.bzl", "cc_flags_supplier", "cc_library", "compiler_flag") # See the License for the specific language governing permissions and # limitations under the License. # + +load("//cc:cc_library.bzl", "cc_library") +load("//cc/toolchains:cc_flags_supplier.bzl", "cc_flags_supplier") +load("//cc/toolchains:compiler_flag.bzl", "compiler_flag") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) # Apache 2.0 diff --git a/cc/private/toolchain/BUILD.empty.tpl b/cc/private/toolchain/BUILD.empty.tpl index 6e2d202..3ae6387 100644 --- a/cc/private/toolchain/BUILD.empty.tpl +++ b/cc/private/toolchain/BUILD.empty.tpl @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc/toolchains:cc_toolchain.bzl", "cc_toolchain") +load("@rules_cc//cc/toolchains:cc_toolchain_suite.bzl", "cc_toolchain_suite") load(":cc_toolchain_config.bzl", "cc_toolchain_config") package(default_visibility = ["//visibility:public"]) diff --git a/cc/private/toolchain/BUILD.static.bsd b/cc/private/toolchain/BUILD.static.bsd index b0d52e6..30d57c2 100644 --- a/cc/private/toolchain/BUILD.static.bsd +++ b/cc/private/toolchain/BUILD.static.bsd @@ -14,8 +14,10 @@ # This becomes the BUILD file for @local_config_cc// under FreeBSD and OpenBSD. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc/toolchains:cc_toolchain.bzl", "cc_toolchain") +load("@rules_cc//cc/toolchains:cc_toolchain_suite.bzl", "cc_toolchain_suite") load(":cc_toolchain_config.bzl", "cc_toolchain_config") -load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite") package(default_visibility = ["//visibility:public"]) diff --git a/cc/private/toolchain/BUILD.tpl b/cc/private/toolchain/BUILD.tpl index da3c06e..2f97707 100644 --- a/cc/private/toolchain/BUILD.tpl +++ b/cc/private/toolchain/BUILD.tpl @@ -16,7 +16,8 @@ load(":cc_toolchain_config.bzl", "cc_toolchain_config") load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config") -load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite") +load("@rules_cc//cc/toolchains:cc_toolchain.bzl", "cc_toolchain") +load("@rules_cc//cc/toolchains:cc_toolchain_suite.bzl", "cc_toolchain_suite") package(default_visibility = ["//visibility:public"]) diff --git a/cc/private/toolchain/BUILD.windows.tpl b/cc/private/toolchain/BUILD.windows.tpl index d554869..75fbd0a 100644 --- a/cc/private/toolchain/BUILD.windows.tpl +++ b/cc/private/toolchain/BUILD.windows.tpl @@ -14,7 +14,9 @@ # This becomes the BUILD file for @local_config_cc// under Windows. -load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite", "cc_library") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc/toolchains:cc_toolchain.bzl", "cc_toolchain") +load("@rules_cc//cc/toolchains:cc_toolchain_suite.bzl", "cc_toolchain_suite") load(":windows_cc_toolchain_config.bzl", "cc_toolchain_config") load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config") diff --git a/examples/custom_toolchain/BUILD b/examples/custom_toolchain/BUILD index de188b4..0631d7d 100644 --- a/examples/custom_toolchain/BUILD +++ b/examples/custom_toolchain/BUILD @@ -29,7 +29,9 @@ # # This example demonstrates both approaches. -load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc/toolchains:cc_toolchain.bzl", "cc_toolchain") +load("@rules_cc//cc/toolchains:cc_toolchain_suite.bzl", "cc_toolchain_suite") # Load the Starlark logic defining the toolchain's behavior. For example: what # program runs to compile a source file and how its command line is diff --git a/examples/my_c_archive/BUILD b/examples/my_c_archive/BUILD index 4484684..d800738 100644 --- a/examples/my_c_archive/BUILD +++ b/examples/my_c_archive/BUILD @@ -15,7 +15,8 @@ # Example showing how to create a custom Starlark rule that rules_cc can depend on load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") +load("@rules_cc//cc:cc_library.bzl", "cc_library") load("//examples/my_c_archive:my_c_archive.bzl", "my_c_archive") load("//examples/my_c_compile:my_c_compile.bzl", "my_c_compile") diff --git a/examples/rule_based_toolchain/BUILD.bazel b/examples/rule_based_toolchain/BUILD.bazel index 28103fd..bc09fb2 100644 --- a/examples/rule_based_toolchain/BUILD.bazel +++ b/examples/rule_based_toolchain/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_cc//cc:defs.bzl", "cc_test") +load("@rules_cc//cc:cc_test.bzl", "cc_test") licenses(["notice"]) diff --git a/examples/rule_based_toolchain/dynamic_answer/BUILD.bazel b/examples/rule_based_toolchain/dynamic_answer/BUILD.bazel index 7a8d640..3085cdf 100644 --- a/examples/rule_based_toolchain/dynamic_answer/BUILD.bazel +++ b/examples/rule_based_toolchain/dynamic_answer/BUILD.bazel @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_cc//cc:defs.bzl", "cc_library", "cc_shared_library") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_shared_library.bzl", "cc_shared_library") licenses(["notice"]) diff --git a/examples/rule_based_toolchain/static_answer/BUILD.bazel b/examples/rule_based_toolchain/static_answer/BUILD.bazel index f185f06..3c89a50 100644 --- a/examples/rule_based_toolchain/static_answer/BUILD.bazel +++ b/examples/rule_based_toolchain/static_answer/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_cc//cc:defs.bzl", "cc_library") +load("@rules_cc//cc:cc_library.bzl", "cc_library") licenses(["notice"]) diff --git a/tests/compiler_settings/BUILD b/tests/compiler_settings/BUILD index a377a51..7c6db4a 100644 --- a/tests/compiler_settings/BUILD +++ b/tests/compiler_settings/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//cc:defs.bzl", "cc_binary") +load("//cc:cc_binary.bzl", "cc_binary") licenses(["notice"]) diff --git a/tests/load_from_macro/BUILD b/tests/load_from_macro/BUILD index 93b902a..132703a 100644 --- a/tests/load_from_macro/BUILD +++ b/tests/load_from_macro/BUILD @@ -13,7 +13,7 @@ # limitations under the License. load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("//cc:defs.bzl", "cc_library") +load("//cc:cc_library.bzl", "cc_library") load(":tags.bzl", "TAGS") licenses(["notice"]) diff --git a/tests/simple_binary/BUILD b/tests/simple_binary/BUILD index c8d78a6..259e5a5 100644 --- a/tests/simple_binary/BUILD +++ b/tests/simple_binary/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//cc:defs.bzl", "cc_binary") +load("//cc:cc_binary.bzl", "cc_binary") licenses(["notice"]) diff --git a/tests/system_library/BUILD b/tests/system_library/BUILD index 5672fc2..59f1e75 100644 --- a/tests/system_library/BUILD +++ b/tests/system_library/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//third_party/rules_shell/shell:sh_test.bzl", "sh_test") +load("//third_party/bazel_rules/rules_shell/shell:sh_test.bzl", "sh_test") sh_test( name = "system_library_test",