[llvm-branch-commits] [llvm] [test][bazel][libc] Fix dependencies for some tests under full-build (PR #223498)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Sep 14 12:05:41 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Jackson Stogel (jtstogel)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/223498.diff


6 Files Affected:

- (modified) utils/bazel/llvm-project-overlay/libc/test/include/BUILD.bazel (+82-59) 
- (modified) utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl (+3-3) 
- (modified) utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel (+37-4) 
- (modified) utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel (+16-4) 
- (modified) utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel (+6-2) 
- (modified) utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel (+4-1) 


``````````diff
diff --git a/utils/bazel/llvm-project-overlay/libc/test/include/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/include/BUILD.bazel
index dcaf655c5b5c9..8797ade31ba29 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/include/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/include/BUILD.bazel
@@ -13,15 +13,17 @@ licenses(["notice"])
 libc_test(
     name = "assert_test",
     srcs = ["assert_test.cpp"],
-    deps = ["//libc:public_headers_deps"],
+    deps = [
+        "//libc:llvm_libc_macros_assert_macros",
+    ],
 )
 
 libc_test(
     name = "complex_test",
     srcs = ["complex_test.cpp"],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_complex_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -32,9 +34,9 @@ libc_test(
         "FpClassifyTest.h",
         "fpclassify_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -45,9 +47,9 @@ libc_test(
         "FpClassifyTest.h",
         "fpclassifyf_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -58,9 +60,9 @@ libc_test(
         "FpClassifyTest.h",
         "fpclassifyl_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -69,7 +71,9 @@ libc_test(
     name = "fpclassify_c_test",
     srcs = ["fpclassify_test.c"],
     c_test = True,
-    deps = ["//libc:public_headers_deps"],
+    deps = [
+        "//libc:llvm_libc_macros_math_function_macros",
+    ],
 )
 
 libc_test(
@@ -78,9 +82,9 @@ libc_test(
         "IsFiniteTest.h",
         "isfinite_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -91,9 +95,9 @@ libc_test(
         "IsFiniteTest.h",
         "isfinitef_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -104,9 +108,9 @@ libc_test(
         "IsFiniteTest.h",
         "isfinitel_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -115,7 +119,9 @@ libc_test(
     name = "isfinite_c_test",
     srcs = ["isfinite_test.c"],
     c_test = True,
-    deps = ["//libc:public_headers_deps"],
+    deps = [
+        "//libc:llvm_libc_macros_math_function_macros",
+    ],
 )
 
 libc_test(
@@ -124,9 +130,9 @@ libc_test(
         "IsInfTest.h",
         "isinf_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -137,9 +143,9 @@ libc_test(
         "IsInfTest.h",
         "isinff_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -150,9 +156,9 @@ libc_test(
         "IsInfTest.h",
         "isinfl_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -161,7 +167,9 @@ libc_test(
     name = "isinf_c_test",
     srcs = ["isinf_test.c"],
     c_test = True,
-    deps = ["//libc:public_headers_deps"],
+    deps = [
+        "//libc:llvm_libc_macros_math_function_macros",
+    ],
 )
 
 libc_test(
@@ -170,9 +178,9 @@ libc_test(
         "IsNanTest.h",
         "isnan_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -183,9 +191,9 @@ libc_test(
         "IsNanTest.h",
         "isnanf_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -196,9 +204,9 @@ libc_test(
         "IsNanTest.h",
         "isnanl_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -207,7 +215,9 @@ libc_test(
     name = "isnan_c_test",
     srcs = ["isnan_test.c"],
     c_test = True,
-    deps = ["//libc:public_headers_deps"],
+    deps = [
+        "//libc:llvm_libc_macros_math_function_macros",
+    ],
 )
 
 libc_test(
@@ -216,9 +226,9 @@ libc_test(
         "IsNormalTest.h",
         "isnormal_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -229,9 +239,9 @@ libc_test(
         "IsNormalTest.h",
         "isnormalf_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -242,9 +252,9 @@ libc_test(
         "IsNormalTest.h",
         "isnormall_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -253,14 +263,18 @@ libc_test(
     name = "isnormal_c_test",
     srcs = ["isnormal_test.c"],
     c_test = True,
-    deps = ["//libc:public_headers_deps"],
+    deps = [
+        "//libc:llvm_libc_macros_math_function_macros",
+    ],
 )
 
 libc_test(
     name = "issubnormal_c_test",
     srcs = ["issubnormal_test.c"],
     c_test = True,
-    deps = ["//libc:public_headers_deps"],
+    deps = [
+        "//libc:llvm_libc_macros_math_function_macros",
+    ],
 )
 
 libc_test(
@@ -269,9 +283,9 @@ libc_test(
         "IsZeroTest.h",
         "iszero_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -282,9 +296,9 @@ libc_test(
         "IsZeroTest.h",
         "iszerof_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -295,9 +309,9 @@ libc_test(
         "IsZeroTest.h",
         "iszerol_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -306,7 +320,9 @@ libc_test(
     name = "iszero_c_test",
     srcs = ["iszero_test.c"],
     c_test = True,
-    deps = ["//libc:public_headers_deps"],
+    deps = [
+        "//libc:llvm_libc_macros_math_function_macros",
+    ],
 )
 
 libc_test(
@@ -315,9 +331,9 @@ libc_test(
         "SignbitTest.h",
         "signbit_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -328,9 +344,9 @@ libc_test(
         "SignbitTest.h",
         "signbitf_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -341,9 +357,9 @@ libc_test(
         "SignbitTest.h",
         "signbitl_test.cpp",
     ],
-    full_build = True,
+    full_build_only = True,
     deps = [
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_math_function_macros",
         "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
@@ -354,31 +370,38 @@ libc_test(
         "stdbit_stub.h",
         "stdbit_test.cpp",
     ],
-    full_build = True,
-    deps = ["//libc:public_headers_deps"],
+    full_build_only = True,
+    deps = [
+        "//libc:llvm_libc_common_h",
+        "//libc:llvm_libc_macros_stdbit_macros",
+    ],
 )
 
 libc_test(
     name = "signbit_c_test",
     srcs = ["signbit_test.c"],
     c_test = True,
-    deps = ["//libc:public_headers_deps"],
+    deps = [
+        "//libc:llvm_libc_macros_math_function_macros",
+    ],
 )
 
 libc_test(
     name = "stdckdint_test",
     srcs = ["stdckdint_test.cpp"],
-    full_build = True,
-    deps = ["//libc:public_headers_deps"],
+    full_build_only = True,
+    deps = [
+        "//libc:llvm_libc_macros_stdckdint_macros",
+    ],
 )
 
 libc_test(
     name = "sys_queue_test",
     srcs = ["sys/queue_test.cpp"],
-    full_build = True,
+    full_build_only = True,
     deps = [
         "//libc:__support_char_vector",
         "//libc:__support_cpp_string",
-        "//libc:public_headers_deps",
+        "//libc:llvm_libc_macros_sys_queue_macros",
     ],
 )
diff --git a/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl b/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
index 11112590c4dae..d7c8375d4251a 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
@@ -33,7 +33,7 @@ def libc_test(
         local_defines = [],
         linkopts = [],
         c_test = False,
-        full_build = False,
+        full_build_only = False,
         target_compatible_with = [],
         tags = [],
         **kwargs):
@@ -47,7 +47,7 @@ def libc_test(
       local_defines: The list of target local_defines if any.
       linkopts: Link options for the cc_test.
       c_test: Whether this test is a C unit test (uses LibcCTest).
-      full_build: Whether the test should only be run in full-build mode.
+      full_build_only: Whether the test should only be run in full-build mode.
       target_compatible_with: Constraints the target is compatible with.
       tags: Tags for the cc_test.
       **kwargs: Attributes relevant for a cc_test.
@@ -88,7 +88,7 @@ def libc_test(
         "//conditions:default": [],
     })
 
-    if full_build:
+    if full_build_only:
         target_compatible_with = target_compatible_with + select({
             "//libc:full_build": [],
             "//conditions:default": ["@platforms//:incompatible"],
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel
index 2c54fc3726591..fa58ac8da2ac4 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel
@@ -56,7 +56,15 @@ libc_test(
         "//libc:__support_cpp_limits",
         "//libc:__support_macros_properties_architectures",
         "//libc:fprintf",
-    ],
+    ] + select({
+        "//libc:full_build": [
+            "//libc:fclose",
+            "//libc:ferror",
+            "//libc:fopen",
+            "//libc:fread",
+        ],
+        "//conditions:default": [],
+    }),
 )
 
 libc_test(
@@ -97,7 +105,15 @@ libc_test(
     srcs = ["vfprintf_test.cpp"],
     deps = [
         "//libc:vfprintf",
-    ],
+    ] + select({
+        "//libc:full_build": [
+            "//libc:fclose",
+            "//libc:ferror",
+            "//libc:fopen",
+            "//libc:fread",
+        ],
+        "//conditions:default": [],
+    }),
 )
 
 libc_test(
@@ -132,7 +148,16 @@ libc_test(
         "//libc:__support_cpp_string_view",
         "//libc:fscanf",
         "//libc:hdr_stdio_macros",
-    ],
+    ] + select({
+        "//libc:full_build": [
+            "//libc:fclose",
+            "//libc:feof",
+            "//libc:ferror",
+            "//libc:fopen",
+            "//libc:fwrite",
+        ],
+        "//conditions:default": [],
+    }),
 )
 
 libc_test(
@@ -149,5 +174,13 @@ libc_test(
     deps = [
         "//libc:__support_cpp_string_view",
         "//libc:vfscanf",
-    ],
+    ] + select({
+        "//libc:full_build": [
+            "//libc:fclose",
+            "//libc:ferror",
+            "//libc:fopen",
+            "//libc:fwrite",
+        ],
+        "//conditions:default": [],
+    }),
 )
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel
index 8b9161b537e4c..e8af353d02845 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel
@@ -235,6 +235,10 @@ libc_test_library(
 libc_test_library(
     name = "protected_pages",
     hdrs = ["memory_utils/protected_pages.h"],
+    target_compatible_with = select({
+        "//libc:full_build": ["@platforms//:incompatible"],
+        "//conditions:default": [],
+    }),
     deps = [
         "//libc:__support_macros_attributes",
         "//libc:__support_macros_properties_os",
@@ -248,11 +252,15 @@ libc_test(
     srcs = ["memcpy_test.cpp"],
     deps = [
         ":memory_check_utils",
-        ":protected_pages",
         "//libc:__support_macros_properties_os",
         "//libc:hdr_signal_macros",
         "//libc:memcpy",
-    ],
+    ] + select({
+        "//libc:full_build": [],
+        "//conditions:default": [
+            ":protected_pages",
+        ],
+    }),
 )
 
 libc_test(
@@ -278,11 +286,15 @@ libc_test(
     srcs = ["memset_test.cpp"],
     deps = [
         ":memory_check_utils",
-        ":protected_pages",
         "//libc:__support_macros_properties_os",
         "//libc:hdr_signal_macros",
         "//libc:memset",
-    ],
+    ] + select({
+        "//libc:full_build": [],
+        "//conditions:default": [
+            ":protected_pages",
+        ],
+    }),
 )
 
 libc_test(
diff --git a/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel
index 8ec7f1df874de..bcdc3481e7e2e 100644
--- a/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel
@@ -22,8 +22,11 @@ cc_library(
     name = "mpc_impl",
     hdrs = ["mpc_inc.h"],
     target_compatible_with = select({
-        "//conditions:default": [],
         "//libc:mpc_disable": ["@platforms//:incompatible"],
+        # In full build mode, the MPFR library should be built
+        # using our own facilities, which is currently not possible.
+        "//libc:full_build": ["@platforms//:incompatible"],
+        "//conditions:default": [],
     }),
     deps = select(
         {
@@ -46,8 +49,9 @@ libc_test_library(
         },
     ),
     target_compatible_with = select({
-        "//conditions:default": [],
         "//libc:mpc_disable": ["@platforms//:incompatible"],
+        "//libc:full_build": ["@platforms//:incompatible"],
+        "//conditions:default": [],
     }),
     deps = [
         ":mpc_impl",
diff --git a/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel
index fc905ce22ad95..beffebe5e32ac 100644
--- a/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel
@@ -22,8 +22,11 @@ cc_library(
     name = "mpfr_impl",
     hdrs = ["mpfr_inc.h"],
     target_compatible_with = select({
-        "//conditions:default": [],
         "//libc:mpfr_disable": ["@platforms//:incompatible"],
+        # In full build mode, the MPFR library should be built
+        # using our own facilities, which is currently not possible.
+        "//libc:full_build": ["@platforms//:incompatible"],
+        "//conditions:default": [],
     }),
     deps = select(
         {

``````````

</details>


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


More information about the llvm-branch-commits mailing list