Skip to content

bazel build: pass __support_macros_config dep explicitly (NFCI) #98999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

krasimirgg
Copy link
Contributor

Passing it explicitly makes it that it's not made available to targets that don't need it (also we've got some internal integration that trips on it being passed implicitly in the rule definition).

@krasimirgg krasimirgg requested a review from d0k July 16, 2024 08:14
@krasimirgg krasimirgg marked this pull request as ready for review July 16, 2024 08:15
@llvmbot llvmbot added libc bazel "Peripheral" support tier build system: utils/bazel labels Jul 16, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 16, 2024

@llvm/pr-subscribers-libc

Author: Krasimir Georgiev (krasimirgg)

Changes

Passing it explicitly makes it that it's not made available to targets that don't need it (also we've got some internal integration that trips on it being passed implicitly in the rule definition).


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

6 Files Affected:

  • (modified) utils/bazel/llvm-project-overlay/libc/BUILD.bazel (+20-3)
  • (modified) utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl (+1-1)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel (+8-2)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel (+5-2)
  • (modified) utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel (+1)
  • (modified) utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel (+1)
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 919eea6175707..5d47f4a9cd640 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -254,6 +254,7 @@ libc_support_library(
     hdrs = ["src/__support/macros/optimization.h"],
     deps = [
         ":__support_macros_attributes",
+        ":__support_macros_config",
         ":__support_macros_properties_compiler",
     ],
 )
@@ -261,6 +262,9 @@ libc_support_library(
 libc_support_library(
     name = "__support_macros_sanitizer",
     hdrs = ["src/__support/macros/sanitizer.h"],
+    deps = [
+        ":__support_macros_config",
+    ],
 )
 
 libc_support_library(
@@ -271,6 +275,7 @@ libc_support_library(
     ],
     deps = [
         ":__support_macros_attributes",
+        ":__support_macros_config",
         ":__support_macros_properties_architectures",
     ],
 )
@@ -280,6 +285,7 @@ libc_support_library(
     hdrs = ["src/__support/CPP/algorithm.h"],
     deps = [
         ":__support_macros_attributes",
+        ":__support_macros_config",
     ],
 )
 
@@ -317,6 +323,7 @@ libc_support_library(
     hdrs = ["src/__support/CPP/bitset.h"],
     deps = [
         ":__support_macros_attributes",
+        ":__support_macros_config",
     ],
 )
 
@@ -334,6 +341,7 @@ libc_support_library(
     hdrs = ["src/__support/CPP/expected.h"],
     deps = [
         ":__support_macros_attributes",
+        ":__support_macros_config",
     ],
 )
 
@@ -424,6 +432,7 @@ libc_support_library(
     ],
     deps = [
         ":__support_macros_attributes",
+        ":__support_macros_config",
         ":__support_macros_properties_types",
         ":llvm_libc_macros_stdfix_macros",
     ],
@@ -573,7 +582,10 @@ libc_support_library(
 libc_support_library(
     name = "__support_str_to_num_result",
     hdrs = ["src/__support/str_to_num_result.h"],
-    deps = [":__support_macros_attributes"],
+    deps = [
+        ":__support_macros_attributes",
+        ":__support_macros_config",
+    ],
 )
 
 libc_support_library(
@@ -612,7 +624,10 @@ libc_support_library(
 libc_support_library(
     name = "__support_ctype_utils",
     hdrs = ["src/__support/ctype_utils.h"],
-    deps = [":__support_macros_attributes"],
+    deps = [
+        ":__support_macros_attributes",
+        ":__support_macros_config",
+    ],
 )
 
 libc_support_library(
@@ -785,6 +800,7 @@ libc_support_library(
     hdrs = ["src/__support/FPUtil/rounding_mode.h"],
     deps = [
         ":__support_macros_attributes",
+        ":__support_macros_config",
         ":hdr_fenv_macros",
     ],
 )
@@ -1126,6 +1142,7 @@ libc_support_library(
     hdrs = ["src/__support/threads/sleep.h"],
     deps = [
         ":__support_macros_attributes",
+        ":__support_macros_config",
     ],
 )
 
@@ -3408,9 +3425,9 @@ libc_support_library(
         ":__support_arg_list",
         ":__support_file_file",
         ":__support_macros_attributes",
-        ":types_FILE",
         ":printf_main",
         ":printf_writer",
+        ":types_FILE",
     ],
 )
 
diff --git a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
index cc732effb243e..ec3714407cb91 100644
--- a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
@@ -43,7 +43,7 @@ def _libc_library(name, hidden, copts = [], deps = [], local_defines = [], **kwa
         name = name,
         copts = copts + libc_common_copts(),
         local_defines = local_defines + LIBC_CONFIGURE_OPTIONS,
-        deps = deps + ["//libc:__support_macros_config"],
+        deps = deps,
         linkstatic = 1,
         **kwargs
     )
diff --git a/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
index 6126a4a8fca83..3e130cd9dc6f0 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
@@ -18,6 +18,7 @@ libc_support_library(
         "//libc:__support_big_int",
         "//libc:__support_cpp_string",
         "//libc:__support_cpp_string_view",
+        "//libc:__support_macros_config",
         "//libc:__support_macros_properties_types",
         "//libc:__support_osutil_io",
         "//libc:__support_uint128",
@@ -52,6 +53,7 @@ libc_support_library(
         "//libc:__support_fputil_fp_bits",
         "//libc:__support_fputil_fpbits_str",
         "//libc:__support_fputil_rounding_mode",
+        "//libc:__support_macros_config",
         "//libc:__support_macros_properties_architectures",
         "//libc:__support_macros_properties_types",
         "//libc:__support_stringutil",
@@ -89,10 +91,11 @@ libc_support_library(
         "//libc:__support_fputil_fp_bits",
         "//libc:__support_fputil_fpbits_str",
         "//libc:__support_fputil_rounding_mode",
+        "//libc:__support_macros_config",
         "//libc:__support_macros_properties_architectures",
+        "//libc:hdr_fenv_macros",
         "//libc:hdr_math_macros",
-	    "//libc:hdr_fenv_macros",
-	    "//libc:types_fenv_t",
+        "//libc:types_fenv_t",
     ],
 )
 
@@ -110,6 +113,7 @@ libc_support_library(
         "//libc:__support_cpp_bitset",
         "//libc:__support_cpp_span",
         "//libc:__support_cpp_type_traits",
+        "//libc:__support_macros_config",
     ],
 )
 
@@ -125,6 +129,7 @@ libc_support_library(
         ":LibcUnitTest",
         ":string_utils",
         "//libc:__support_fputil_fp_bits",
+        "//libc:__support_macros_config",
         "//libc:printf_core_structs",
     ],
 )
@@ -138,5 +143,6 @@ libc_support_library(
         "//libc:__support_big_int",
         "//libc:__support_cpp_string",
         "//libc:__support_cpp_type_traits",
+        "//libc:__support_macros_config",
     ],
 )
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
index 2940326d5bfc3..57e3f9f6e9458 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
@@ -298,8 +298,8 @@ libc_support_library(
         "//libc:__support_fputil_fp_bits",
         "//libc:__support_fputil_manipulation_functions",
         "//libc:hdr_math_macros",
-        "//libc/test/UnitTest:fp_test_helpers",
         "//libc/test/UnitTest:LibcUnitTest",
+        "//libc/test/UnitTest:fp_test_helpers",
     ],
 )
 
@@ -559,7 +559,10 @@ math_test(
 libc_support_library(
     name = "sdcomp26094",
     hdrs = ["sdcomp26094.h"],
-    deps = ["//libc:__support_cpp_array"],
+    deps = [
+        "//libc:__support_cpp_array",
+        "//libc:__support_macros_config",
+    ],
 )
 
 math_test(
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 fb0046e9f89d1..b11bf163473be 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
@@ -121,6 +121,7 @@ libc_support_library(
     deps = [
         "//libc:__support_cpp_span",
         "//libc:__support_libc_assert",
+        "//libc:__support_macros_config",
         "//libc:__support_macros_sanitizer",
         "//libc:string_memory_utils",
     ],
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 c708f008dec2c..adf4b235b1b5e 100644
--- a/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel
@@ -48,6 +48,7 @@ libc_support_library(
         "//libc:__support_cpp_type_traits",
         "//libc:__support_fputil_fp_bits",
         "//libc:__support_fputil_fpbits_str",
+        "//libc:__support_macros_config",
         "//libc:__support_macros_properties_types",
         "//libc:hdr_math_macros",
         "//libc/test/UnitTest:LibcUnitTest",

@krasimirgg krasimirgg removed request for keith, rupprecht and d0k July 16, 2024 08:16
@krasimirgg krasimirgg merged commit dcf30d3 into llvm:main Jul 16, 2024
5 checks passed
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary:
Passing it explicitly makes it that it's not made available to targets
that don't need it (also we've got some internal integration that trips
on it being passed implicitly in the rule definition).

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251590
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel "Peripheral" support tier build system: utils/bazel libc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants