From d0416b91f0390f6e69dacf3d5d076531221e0767 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 8 Nov 2019 14:09:40 -0800 Subject: [PATCH] Don't attempt to upgrade debug-info-tests to Python3. There was CMake code that would attempt to detect Python 3 even if LLVM was configured with Python 2, but it messed with the environment for the other LLVM projects. This commit removes this functionality and just lkeaves a hard error if Python < 3 is detected and debuginfo-tests are required. --- debuginfo-tests/CMakeLists.txt | 35 ---------------------------------- 1 file changed, 35 deletions(-) diff --git a/debuginfo-tests/CMakeLists.txt b/debuginfo-tests/CMakeLists.txt index 025f468c48a6..36863e030b7f 100644 --- a/debuginfo-tests/CMakeLists.txt +++ b/debuginfo-tests/CMakeLists.txt @@ -18,26 +18,6 @@ if (WIN32) set(DEBUGINFO_TEST_DEPS ${DEBUGINFO_TEST_DEPS} lld) endif() -# If we don't already have Python 3, throw away any previous results and try to -# find it again. -set(DEBUGINFO_UNSET_PYTHON3 OFF) -if (PYTHON_VERSION_MAJOR LESS 3) - unset(PYTHONINTERP_FOUND CACHE) - unset(PYTHON_EXECUTABLE CACHE) - unset(PYTHON_LIBRARY CACHE) - unset(PYTHON_DLL CACHE) - unset(PYTHON_INCLUDE_DIR CACHE) - unset(PYTHON_VERSION_STRING CACHE) - unset(PYTHON_VERSION_MAJOR CACHE) - unset(PYTHON_VERSION_MINOR CACHE) - unset(PYTHON_VERSION_PATCH CACHE) - unset(PYTHONLIBS_VERSION_STRING CACHE) - - # Try to find python3. If it doesn't exist, dexter tests can't run. - find_package(PythonInterp "3") - set(DEBUGINFO_UNSET_PYTHON3 ON) -endif() - if (NOT DEFINED PYTHON_EXECUTABLE) message(FATAL_ERROR "Cannot run debuginfo-tests without python") elseif(PYTHON_VERSION_MAJOR LESS 3) @@ -56,18 +36,3 @@ else() ) set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests") endif() - -# Prevent the rest of llvm observing our secret python3-ness, if that wasn't -# what was originally found. -if (DEBUGINFO_UNSET_PYTHON3) - unset(PYTHONINTERP_FOUND CACHE) - unset(PYTHON_EXECUTABLE CACHE) - unset(PYTHON_LIBRARY CACHE) - unset(PYTHON_DLL CACHE) - unset(PYTHON_INCLUDE_DIR CACHE) - unset(PYTHON_VERSION_STRING CACHE) - unset(PYTHON_VERSION_MAJOR CACHE) - unset(PYTHON_VERSION_MINOR CACHE) - unset(PYTHON_VERSION_PATCH CACHE) - unset(PYTHONLIBS_VERSION_STRING CACHE) -endif()