-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[libc][cmake] disable include tests in overlay mode #114566
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
Conversation
This avoids -Wmacro-redefinition diagnostics observed when building the libc_include_tests ninja target. For example, the signbit_test will attempt to include BOTH our math-macros.h (via math-function-macros.h), and the system's math.h (via hdr/math_macros.h). While it's nice that we can get some coverage of the headers we will provide to end users of fullbuilds in CI of overlay builds, it's not worth chasing each individual conflict and disabling some include tests as conflicts arise. Disable the include tests unless `-DLLVM_LIBC_FULL_BUILD=ON` is specified.
@llvm/pr-subscribers-libc Author: Nick Desaulniers (nickdesaulniers) ChangesThis avoids -Wmacro-redefinition diagnostics observed when building the For example, the signbit_test will attempt to include BOTH our While it's nice that we can get some coverage of the headers we will provide to Disable the include tests unless Full diff: https://github.com/llvm/llvm-project/pull/114566.diff 2 Files Affected:
diff --git a/libc/test/CMakeLists.txt b/libc/test/CMakeLists.txt
index b5c989aa1d433c..1a0780faff5125 100644
--- a/libc/test/CMakeLists.txt
+++ b/libc/test/CMakeLists.txt
@@ -18,7 +18,6 @@ if(LIBC_TARGET_OS_IS_GPU)
endif()
endif()
-add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(utils)
@@ -26,6 +25,8 @@ if(NOT LLVM_LIBC_FULL_BUILD)
return()
endif()
+add_subdirectory(include)
+
if(NOT ${LIBC_TARGET_OS} STREQUAL "linux" AND
NOT ${LIBC_TARGET_OS} STREQUAL "gpu")
# Integration tests are currently only available for linux and the GPU.
diff --git a/libc/test/include/CMakeLists.txt b/libc/test/include/CMakeLists.txt
index 0d882eb49a7386..146e43e580670b 100644
--- a/libc/test/include/CMakeLists.txt
+++ b/libc/test/include/CMakeLists.txt
@@ -36,50 +36,46 @@ add_libc_test(
-Wno-gnu-statement-expression-from-macro-expansion
)
-# stdbit_test only tests our generated stdbit.h, which is not generated in
-# overlay mode.
-if(LLVM_LIBC_FULL_BUILD AND libc.include.stdbit IN_LIST TARGET_PUBLIC_HEADERS)
- add_libc_test(
- stdbit_test
- SUITE
- libc_include_tests
- HDRS
- stdbit_stub.h
- SRCS
- stdbit_test.cpp
- DEPENDS
- libc.include.llvm-libc-macros.stdbit_macros
- libc.include.llvm_libc_common_h
- libc.include.stdbit
- # Intentionally do not depend on libc.src.stdbit.*. The include test is
- # simply testing the macros provided by stdbit.h, not the implementation
- # of the underlying functions which the type generic macros may dispatch
- # to.
- )
- add_libc_test(
- stdbit_c_test
- C_TEST
- UNIT_TEST_ONLY
- SUITE
- libc_include_tests
- HDRS
- stdbit_stub.h
- SRCS
- stdbit_test.c
- COMPILE_OPTIONS
- -Wall
- -Werror
- DEPENDS
- libc.include.llvm-libc-macros.stdbit_macros
- libc.include.llvm_libc_common_h
- libc.include.stdbit
- libc.src.assert.__assert_fail
- # Intentionally do not depend on libc.src.stdbit.*. The include test is
- # simply testing the macros provided by stdbit.h, not the implementation
- # of the underlying functions which the type generic macros may dispatch
- # to.
- )
-endif()
+add_libc_test(
+ stdbit_test
+ SUITE
+ libc_include_tests
+ HDRS
+ stdbit_stub.h
+ SRCS
+ stdbit_test.cpp
+ DEPENDS
+ libc.include.llvm-libc-macros.stdbit_macros
+ libc.include.llvm_libc_common_h
+ libc.include.stdbit
+ # Intentionally do not depend on libc.src.stdbit.*. The include test is
+ # simply testing the macros provided by stdbit.h, not the implementation
+ # of the underlying functions which the type generic macros may dispatch
+ # to.
+)
+add_libc_test(
+ stdbit_c_test
+ C_TEST
+ UNIT_TEST_ONLY
+ SUITE
+ libc_include_tests
+ HDRS
+ stdbit_stub.h
+ SRCS
+ stdbit_test.c
+ COMPILE_OPTIONS
+ -Wall
+ -Werror
+ DEPENDS
+ libc.include.llvm-libc-macros.stdbit_macros
+ libc.include.llvm_libc_common_h
+ libc.include.stdbit
+ libc.src.assert.__assert_fail
+ # Intentionally do not depend on libc.src.stdbit.*. The include test is
+ # simply testing the macros provided by stdbit.h, not the implementation
+ # of the underlying functions which the type generic macros may dispatch
+ # to.
+)
add_libc_test(
stdckdint_test
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/71/builds/9667 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/171/builds/9477 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/131/builds/9551 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/179/builds/9403 Here is the relevant piece of the build log for the reference
|
Weird, we're getting linkage failures:
but we do have those entrypoints in the DEPENDS for those tests AND exposed in that target arch's entrypoints.txt... |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/196/builds/406 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/183/builds/5673 Here is the relevant piece of the build log for the reference
|
Ok, I can reproduce at least via @michaelrj-google mentioned it might be due to the hunk added by Sh0g0-1758 to libc/cmake/modules/LLVMLibCTestRules.cmake in #111403. But removing that, I can still reproduce the issue. |
These are failing to link for some buildbots. It's not immediately clear why, disable these and add a todo to investigate. Link: llvm#111403 Link: llvm#114566 Link: llvm#114618
This avoids -Wmacro-redefinition diagnostics observed when building the libc_include_tests ninja target. For example, the signbit_test will attempt to include BOTH our math-macros.h (via math-function-macros.h), and the system's math.h (via hdr/math_macros.h). While it's nice that we can get some coverage of the headers we will provide to end users of fullbuilds in CI of overlay builds, it's not worth chasing each individual conflict and disabling some include tests as conflicts arise. Disable the include tests unless `-DLLVM_LIBC_FULL_BUILD=ON` is specified.
These are failing to link for some buildbots. It's not immediately clear why, disable these and add a todo to investigate. Link: llvm#111403 Link: llvm#114566 Link: llvm#114618
This avoids -Wmacro-redefinition diagnostics observed when building the libc_include_tests ninja target. For example, the signbit_test will attempt to include BOTH our math-macros.h (via math-function-macros.h), and the system's math.h (via hdr/math_macros.h). While it's nice that we can get some coverage of the headers we will provide to end users of fullbuilds in CI of overlay builds, it's not worth chasing each individual conflict and disabling some include tests as conflicts arise. Disable the include tests unless `-DLLVM_LIBC_FULL_BUILD=ON` is specified.
These are failing to link for some buildbots. It's not immediately clear why, disable these and add a todo to investigate. Link: llvm#111403 Link: llvm#114566 Link: llvm#114618
This avoids -Wmacro-redefinition diagnostics observed when building the
libc_include_tests ninja target.
For example, the signbit_test will attempt to include BOTH our
math-macros.h (via math-function-macros.h), and the system's math.h (via
hdr/math_macros.h).
While it's nice that we can get some coverage of the headers we will provide to
end users of fullbuilds in CI of overlay builds, it's not worth chasing each
individual conflict and disabling some include tests as conflicts arise.
Disable the include tests unless
-DLLVM_LIBC_FULL_BUILD=ON
is specified.