[llvm] [bazel] fix libc build (PR #119433)

Nick Desaulniers via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 11:01:06 PST 2024


================
@@ -0,0 +1,60 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+# Tests for LLVM libc string.h functions.
+
+load("//libc:libc_build_rules.bzl", "libc_support_library")
+load("//libc/test:libc_test_rules.bzl", "libc_test")
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+# libc_support_library(
+#     name = "memory_check_utils",
+#     hdrs = ["memory_utils/memory_check_utils.h"],
+#     deps = [
+#         "//libc:__support_cpp_span",
+#         "//libc:__support_libc_assert",
+#         "//libc:__support_macros_config",
+#         "//libc:__support_macros_sanitizer",
+#         "//libc:string_memory_utils",
+#     ],
+# )
+
+libc_test(
+    name = "bcopy_test",
+    srcs = ["bcopy_test.cpp"],
+    libc_function_deps = [
+        "//libc:bcopy",
+    ],
+    deps = [
+        "//libc/test/string:memory_check_utils",
----------------
nickdesaulniers wrote:

This isn't quite right, not sure the correct incantation:

```
ERROR: no such package '@@llvm-project//libc/test/string': BUILD file not found in directory 'libc/test/string' of external repository @@llvm-project. Add a BUILD file to a directory to mark it as a package.
ERROR: /usr/local/google/home/ndesaulniers/.cache/bazel/_bazel_ndesaulniers/02cf1b716d72de9bb7498bab3b083b83/external/llvm-project/libc/test/src/strings/BUILD.bazel:39:10: no such package '@@llvm-project//libc/test/string': BUILD file not found in directory 'libc/test/string' of external repository @@llvm-project. Add a BUILD file to a directory to mark it as a package. and referenced by '@@llvm-project//libc/test/src/strings:bcmp_test'
ERROR: Analysis of target '@@llvm-project//libc/test/src/strings:bcmp_test' failed; build aborted: Analysis failed
```

https://github.com/llvm/llvm-project/pull/119433


More information about the llvm-commits mailing list