-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Revert "[runtimes] Allow building against an installed LLVM tree" #113920
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
Revert "[runtimes] Allow building against an installed LLVM tree" #113920
Conversation
This reverts commit b1be213.
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Nikolas Klauser (philnik777) ChangesReverts llvm/llvm-project#86209 This patch breaks running tests locally, which is extremely disruptive to libc++ development. Full diff: https://github.com/llvm/llvm-project/pull/113920.diff 4 Files Affected:
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index b2f33d1a961c74..e3d81d241b1054 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -773,7 +773,6 @@ function(configure_compiler_rt_lit_site_cfg input output)
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_TEST_COMPILER ${COMPILER_RT_TEST_COMPILER})
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_OUTPUT_DIR ${COMPILER_RT_OUTPUT_DIR})
- string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_EXEC_OUTPUT_DIR ${COMPILER_RT_EXEC_OUTPUT_DIR})
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR ${output_dir})
configure_lit_site_cfg(${input} ${output})
diff --git a/compiler-rt/test/hwasan/lit.cfg.py b/compiler-rt/test/hwasan/lit.cfg.py
index bbf23e683240ac..594f3294a84ac1 100644
--- a/compiler-rt/test/hwasan/lit.cfg.py
+++ b/compiler-rt/test/hwasan/lit.cfg.py
@@ -2,9 +2,6 @@
import os
-from lit.llvm import llvm_config
-from lit.llvm.subst import ToolSubst, FindTool
-
# Setup config name.
config.name = "HWAddressSanitizer" + getattr(config, "name_suffix", "default")
@@ -77,12 +74,6 @@ def build_invocation(compile_flags):
("%env_hwasan_opts=", "env HWASAN_OPTIONS=" + default_hwasan_opts_str)
)
-# Ensure that we can use hwasan_symbolize from the expected location
-llvm_config.add_tool_substitutions(
- [ToolSubst("hwasan_symbolize", unresolved="fatal")],
- search_dirs=[config.compiler_rt_bindir],
-)
-
# Default test suffixes.
config.suffixes = [".c", ".cpp"]
diff --git a/compiler-rt/test/lit.common.configured.in b/compiler-rt/test/lit.common.configured.in
index 050792b6b26217..66935c358afedd 100644
--- a/compiler-rt/test/lit.common.configured.in
+++ b/compiler-rt/test/lit.common.configured.in
@@ -28,7 +28,6 @@ set_default("python_executable", "@Python3_EXECUTABLE@")
set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@)
set_default("compiler_rt_intercept_libdispatch", @COMPILER_RT_INTERCEPT_LIBDISPATCH_PYBOOL@)
set_default("compiler_rt_output_dir", "@COMPILER_RT_RESOLVED_OUTPUT_DIR@")
-set_default("compiler_rt_bindir", "@COMPILER_RT_RESOLVED_EXEC_OUTPUT_DIR@")
set_default("compiler_rt_libdir", "@COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR@")
set_default("emulator", "@COMPILER_RT_EMULATOR@")
set_default("asan_shadow_scale", "@COMPILER_RT_ASAN_SHADOW_SCALE@")
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index 67368dcedb3bf6..830165c799c2ab 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -239,23 +239,6 @@ foreach(entry ${runtimes})
endforeach()
if(LLVM_INCLUDE_TESTS)
- # If built with the runtimes build (rooted at runtimes/CMakeLists.txt), we
- # won't have llvm-lit. If built with the bootstrapping build (rooted at
- # llvm/CMakeLists.txt), the top-level llvm CMake invocation already generated
- # the llvm-lit script.
- if (NOT HAVE_LLVM_LIT)
- # Add lit before adding any runtimes since their CMake tests configuration
- # might depend on lit being present.
- set(LLVM_LIT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin)
- add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit
- ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
- # Ensure that the testsuites use the local lit rather than
- # ${LLVM_INSTALL_DIR}/bin/llvm-lit (which may not exist if LLVM_BINARY_DIR
- # points at an installed LLVM tree rather than a build tree).
- get_llvm_lit_path(_base_dir _file_name)
- set(LLVM_EXTERNAL_LIT "${_base_dir}/${_file_name}" CACHE STRING "Command used to spawn lit" FORCE)
- endif()
-
set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")
if (MSVC OR XCODE)
set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
@@ -289,6 +272,14 @@ if(LLVM_INCLUDE_TESTS)
# and we know the total set of lit testsuites.
umbrella_lit_testsuite_end(check-runtimes)
+ if (NOT HAVE_LLVM_LIT)
+ # If built by manually invoking cmake on this directory, we don't have
+ # llvm-lit. If invoked via llvm/runtimes, the toplevel llvm cmake
+ # invocation already generated the llvm-lit script.
+ add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit
+ ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
+ endif()
+
get_property(LLVM_RUNTIMES_LIT_TESTSUITES GLOBAL PROPERTY LLVM_RUNTIMES_LIT_TESTSUITES)
string(REPLACE ";" "\n" LLVM_RUNTIMES_LIT_TESTSUITES "${LLVM_RUNTIMES_LIT_TESTSUITES}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/lit.tests ${LLVM_RUNTIMES_LIT_TESTSUITES})
@@ -318,10 +309,10 @@ if(SUB_COMPONENTS)
if(LLVM_RUNTIMES_TARGET)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/runtimes/${LLVM_RUNTIMES_TARGET}/Components.cmake)
+ ${LLVM_BINARY_DIR}/runtimes/${LLVM_RUNTIMES_TARGET}/Components.cmake)
else()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Components.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/runtimes/Components.cmake)
+ ${LLVM_BINARY_DIR}/runtimes/Components.cmake)
endif()
endif()
|
CC @arichardson |
I'm landing this now, since everything seems to work fine and not being able to run tests being extremely disruptive. @arichardson If you need any help reproducing the issue feel free to ask. I've tried multiple configurations and couldn't get the tests to ever run, so the issue is hopefully quite easy to fix. |
Sorry about this, will try to reproduce! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/139/builds/5496 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/4/builds/3163 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/38/builds/544 Here is the relevant piece of the build log for the reference
|
Looks like this break the QEMU Sanitizer build: https://lab.llvm.org/buildbot/#/builders/139/builds/5496/steps/30/logs/stdio |
I don't think that failure could have been caused by the revert? I would expect something like "could not find Lit" if this revert was causing an issue (and then the fix would be to revert the dependent patch that was made since #86209 landed). |
NM, it looks like it was happening before your patch. Sorry about the noise. |
…vm#113920) Reverts llvm#86209 This patch breaks running tests locally, which is extremely disruptive to libc++ development.
Reverts #86209
This patch breaks running tests locally, which is extremely disruptive to libc++ development.