diff --git a/base/BUILD b/base/BUILD index 2ba7f0ed8..5820966d1 100644 --- a/base/BUILD +++ b/base/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package( # Under active development, not yet being released. default_visibility = ["//visibility:public"], diff --git a/base/internal/BUILD b/base/internal/BUILD index f653f1ad8..187b008c0 100644 --- a/base/internal/BUILD +++ b/base/internal/BUILD @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/bazel/BUILD b/bazel/BUILD index 3534ccb78..7a72be0e7 100644 --- a/bazel/BUILD +++ b/bazel/BUILD @@ -1,3 +1,4 @@ +load("@rules_cc//cc:cc_binary.bzl", "cc_binary") load("@rules_java//java:defs.bzl", "java_binary") java_binary( diff --git a/bazel/antlr.bzl b/bazel/antlr.bzl index 42fa506f7..73c5a9d2c 100644 --- a/bazel/antlr.bzl +++ b/bazel/antlr.bzl @@ -16,6 +16,10 @@ Generate C++ parser and lexer from a grammar file. """ +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc/common:cc_common.bzl", "cc_common") +load("@rules_cc//cc/common:cc_info.bzl", "CcInfo") + def antlr_cc_library(name, src, package): """Creates a C++ lexer and parser from a source grammar. Args: @@ -29,7 +33,7 @@ def antlr_cc_library(name, src, package): src = src, package = package, ) - native.cc_library( + cc_library( name = name + "_cc_parser", srcs = [generated], deps = [ diff --git a/checker/BUILD b/checker/BUILD index 62ce2474e..b83be9080 100644 --- a/checker/BUILD +++ b/checker/BUILD @@ -1,3 +1,6 @@ +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + # Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/checker/internal/BUILD b/checker/internal/BUILD index 41c7ee863..6d2254856 100644 --- a/checker/internal/BUILD +++ b/checker/internal/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package( # Implementation details for the checker library. default_visibility = ["//visibility:public"], diff --git a/codelab/BUILD b/codelab/BUILD index 8d8c0e278..954ec25ba 100644 --- a/codelab/BUILD +++ b/codelab/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + licenses(["notice"]) package(default_visibility = ["//visibility:public"]) diff --git a/codelab/solutions/BUILD b/codelab/solutions/BUILD index e0f4ce690..5068ec61e 100644 --- a/codelab/solutions/BUILD +++ b/codelab/solutions/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/common/BUILD b/common/BUILD index 008e3ceaf..ff36da33f 100644 --- a/common/BUILD +++ b/common/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/common/ast/BUILD b/common/ast/BUILD index 9b0d65c74..68bfc72e4 100644 --- a/common/ast/BUILD +++ b/common/ast/BUILD @@ -1,3 +1,6 @@ +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + # Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/common/internal/BUILD b/common/internal/BUILD index e00a8ea7a..c5ca63564 100644 --- a/common/internal/BUILD +++ b/common/internal/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/compiler/BUILD b/compiler/BUILD index e60203098..56f7e9c81 100644 --- a/compiler/BUILD +++ b/compiler/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/conformance/BUILD b/conformance/BUILD index c9892c5a9..74390abc0 100644 --- a/conformance/BUILD +++ b/conformance/BUILD @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") load("//conformance:run.bzl", "gen_conformance_tests") package(default_visibility = ["//visibility:public"]) diff --git a/conformance/run.bzl b/conformance/run.bzl index 86fc01ace..8205fa987 100644 --- a/conformance/run.bzl +++ b/conformance/run.bzl @@ -16,6 +16,8 @@ This module contains build rules for generating the conformance test targets. """ +load("@rules_cc//cc:cc_test.bzl", "cc_test") + # Converts the list of tests to skip from the format used by the original Go test runner to a single # flag value where each test is separated by a comma. It also performs expansion, for example # `foo/bar,baz` becomes two entries which are `foo/bar` and `foo/baz`. @@ -62,7 +64,7 @@ def _conformance_test_args(modern, optimize, recursive, skip_check, skip_tests, return args def _conformance_test(name, data, modern, optimize, recursive, skip_check, skip_tests, tags, dashboard): - native.cc_test( + cc_test( name = _conformance_test_name(name, optimize, recursive), args = _conformance_test_args(modern, optimize, recursive, skip_check, skip_tests, dashboard) + ["$(location " + test + ")" for test in data], data = data, diff --git a/eval/compiler/BUILD b/eval/compiler/BUILD index 7156807a7..68c6dbfca 100644 --- a/eval/compiler/BUILD +++ b/eval/compiler/BUILD @@ -1,3 +1,6 @@ +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + DEFAULT_VISIBILITY = [ "//eval:__subpackages__", "//runtime:__subpackages__", diff --git a/eval/eval/BUILD b/eval/eval/BUILD index e38c043b2..15b81ca01 100644 --- a/eval/eval/BUILD +++ b/eval/eval/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + # This package contains implementation of expression evaluator # internals. package(default_visibility = ["//visibility:public"]) diff --git a/eval/internal/BUILD b/eval/internal/BUILD index 1e845a1a2..d6f31493e 100644 --- a/eval/internal/BUILD +++ b/eval/internal/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/eval/public/BUILD b/eval/public/BUILD index d02b165bb..269309ca4 100644 --- a/eval/public/BUILD +++ b/eval/public/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) package_group( diff --git a/eval/public/containers/BUILD b/eval/public/containers/BUILD index a4e74e70e..18ad48734 100644 --- a/eval/public/containers/BUILD +++ b/eval/public/containers/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/eval/public/structs/BUILD b/eval/public/structs/BUILD index 83fa4b42c..d301ff0ca 100644 --- a/eval/public/structs/BUILD +++ b/eval/public/structs/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/eval/public/testing/BUILD b/eval/public/testing/BUILD index b2b53fff2..f4529e931 100644 --- a/eval/public/testing/BUILD +++ b/eval/public/testing/BUILD @@ -1,3 +1,6 @@ +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package( default_testonly = True, default_visibility = ["//visibility:public"], diff --git a/eval/tests/BUILD b/eval/tests/BUILD index c98c02206..ce746e6f5 100644 --- a/eval/tests/BUILD +++ b/eval/tests/BUILD @@ -4,6 +4,8 @@ load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") package(default_visibility = ["//visibility:public"]) diff --git a/extensions/BUILD b/extensions/BUILD index c448f5366..a0b3a0a0c 100644 --- a/extensions/BUILD +++ b/extensions/BUILD @@ -1,3 +1,6 @@ +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) cc_library( diff --git a/extensions/protobuf/BUILD b/extensions/protobuf/BUILD index 6c06909bf..6c3f654f9 100644 --- a/extensions/protobuf/BUILD +++ b/extensions/protobuf/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package( # Under active development, not yet being released. default_visibility = ["//visibility:public"], diff --git a/extensions/protobuf/internal/BUILD b/extensions/protobuf/internal/BUILD index 35efe1769..4a3a3e82b 100644 --- a/extensions/protobuf/internal/BUILD +++ b/extensions/protobuf/internal/BUILD @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package( # Under active development, not yet being released. default_visibility = ["//visibility:public"], diff --git a/internal/BUILD b/internal/BUILD index 7eb5472df..889279c26 100644 --- a/internal/BUILD +++ b/internal/BUILD @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") load("//bazel:cel_cc_embed.bzl", "cel_cc_embed") load("//bazel:cel_proto_transitive_descriptor_set.bzl", "cel_proto_transitive_descriptor_set") diff --git a/parser/BUILD b/parser/BUILD index 527034a62..08ae823a5 100644 --- a/parser/BUILD +++ b/parser/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/parser/internal/BUILD b/parser/internal/BUILD index 5b842c219..af815588e 100644 --- a/parser/internal/BUILD +++ b/parser/internal/BUILD @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") load("//bazel:antlr.bzl", "antlr_cc_library") package(default_visibility = ["//visibility:public"]) diff --git a/runtime/BUILD b/runtime/BUILD index e01643184..3079bcdd0 100644 --- a/runtime/BUILD +++ b/runtime/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package( # Under active development, not yet being released. default_visibility = ["//visibility:public"], @@ -364,7 +367,6 @@ cc_library( deps = [ ":runtime", ":runtime_builder", - "//common:memory", "//common:native_type", "//eval/compiler:regex_precompilation_optimization", "//internal:casts", diff --git a/runtime/internal/BUILD b/runtime/internal/BUILD index 9d89d9ed6..b5f532410 100644 --- a/runtime/internal/BUILD +++ b/runtime/internal/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package( # Internals for cel/runtime. default_visibility = ["//visibility:public"], diff --git a/runtime/standard/BUILD b/runtime/standard/BUILD index 7a65ff29a..2e4111d4b 100644 --- a/runtime/standard/BUILD +++ b/runtime/standard/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + # Provides registrars for CEL standard definitions. # TODO(uncreated-issue/41): CEL users shouldn't need to use these directly, instead they should prefer to # use RegisterBuiltins when available. diff --git a/testutil/BUILD b/testutil/BUILD index 0d2bfd63c..566fc26fd 100644 --- a/testutil/BUILD +++ b/testutil/BUILD @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/tools/BUILD b/tools/BUILD index 896d930e4..49c37a1f4 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -1,3 +1,6 @@ +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_cc//cc:cc_test.bzl", "cc_test") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/tools/internal/BUILD b/tools/internal/BUILD index 79b379ed9..ec62b4721 100644 --- a/tools/internal/BUILD +++ b/tools/internal/BUILD @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_cc//cc:cc_library.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/tools/testdata/BUILD b/tools/testdata/BUILD index 5c48819c8..493f0ff2f 100644 --- a/tools/testdata/BUILD +++ b/tools/testdata/BUILD @@ -16,6 +16,7 @@ load( "@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_library_public", ) +load("@rules_cc//cc:cc_library.bzl", "cc_library") licenses(["notice"])